Skip to content

Do not rely on Base.active_repl#643

Merged
aviatesk merged 1 commit into
JuliaDebug:masterfrom
serenity4:dont-use-active-repl
May 14, 2025
Merged

Do not rely on Base.active_repl#643
aviatesk merged 1 commit into
JuliaDebug:masterfrom
serenity4:dont-use-active-repl

Conversation

@serenity4

Copy link
Copy Markdown
Collaborator

Relying on Base.active_repl introduced two failure modes:

  • If Cthulhu.REPL !== parentmodule(typeof(Base.active_repl)), we error.
  • If we launch in non-interactive mode, Base.active_repl is not defined and we error.

We used it only to retrieve a terminal, but as it turns out the setup is extremely simple so it seems we can just do that ourselves. From what I understand, it hooks into stdout/stdin/stderr, but nothing requires interacting with Base.active_repl.

This should fix #450.

Reproducing the first failure mode (and ensuring it is now fixed) is a bit tricky, these conditions seem to work for me:

  • Copy the REPL package from its stdlib location to somewhere else (e.g. ~/.julia/dev).
  • dev it within the Cthulhu project.
  • Launch Julia with julia --project --startup-file=no then execute using Cthulhu; @descend exp(4).
  • This should error on master and pass on this PR.

The second failure mode can be reproduced with #450 (comment).

@serenity4 serenity4 requested a review from aviatesk May 14, 2025 06:06
@codecov-commenter

codecov-commenter commented May 14, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2c33b9a) to head (53e6772).
⚠️ Report is 99 commits behind head on master.

Files with missing lines Patch % Lines
src/CthulhuBase.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #643   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           9      11    +2     
  Lines        1556    1592   +36     
======================================
- Misses       1556    1592   +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aviatesk aviatesk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, confirmed this fixes the both failure modes.

@aviatesk aviatesk merged commit 1596ab0 into JuliaDebug:master May 14, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UndefVarError: active_repl not defined in jupyter notebook

3 participants