Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable REPL completion for GAP records in Julia 1.10 #914

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

fingolfin
Copy link
Member

The added annotation might also benefit performance of some code.

Thanks to @aviatesk who helpfully suggested this in this comment.

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #914 (e059363) into master (3623cee) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #914   +/-   ##
=======================================
  Coverage   75.56%   75.56%           
=======================================
  Files          51       51           
  Lines        4170     4170           
=======================================
  Hits         3151     3151           
  Misses       1019     1019           
Files Changed Coverage Δ
src/globals.jl 100.00% <ø> (ø)
src/ccalls.jl 99.17% <100.00%> (ø)

@fingolfin
Copy link
Member Author

Weird. The CI on 1.10 keeps failing. But locally on my laptop with Julia 1.10.0-alpha1, the tests pass just fine.

@ThomasBreuer
Copy link
Member

@fingolfin The same happens in my installation of 1.10.0-alpha1.
I get the error messages from the CI tests when I run the tests in the master branch, but with the changes from this pull request the errors disappear.

@fingolfin fingolfin force-pushed the mh/repl-compl branch 3 times, most recently from 318d8d6 to a3c27ab Compare July 28, 2023 10:10
@fingolfin
Copy link
Member Author

I figured out how to reproduce the errors locally: by enabling coverage, i.e., using Pkg; Pkg.test(; coverage = true).

Indeed, I can also reproduce the problem interactively if I start Julia with the option --code-coverage, then do using GAP and try to tab complete e.g. GAP.Globals.MTX.IsInd.

So why does code coverage break this? Huh.

@ThomasBreuer
Copy link
Member

@fingolfin I can confirm your observation: When Julia 1.10 is started with --code-coverage, completion does not work in the session, but completion works when Julia 1.10 is started without --code-coverage.

Very strange.

@ThomasBreuer
Copy link
Member

I have run the two Julia sessions (with and without --code-coverage) in parallel, and followed the code that is used for the input s = "GAP.Globals.MTX.IsI"; @which completions(s,lastindex(s)).

I get a difference at res = repl_eval_ex(ex, context_module) where ex = :(GAP.Globals.MTX) and context_module = Main.
Specifically, calling repl_eval_ex(:(GAP.Globals.MTX), Main) yields Any in one Julia session and a complicated object of type Core.Const in the other session.

(Inside REPLCompletions.repl_eval_ex, the first difference occurs in the result of REPLInterpreter(result), which looks rather cryptic.)

@fingolfin
Copy link
Member Author

I wonder if code coverage collection interferes in some way with @assume_effects :effect_free :terminates_globally

@fingolfin
Copy link
Member Author

OK this is a known thing, see JuliaLang/julia#49978

@fingolfin
Copy link
Member Author

Based on that bug and the discussion on the Julia slack, I think the best solution for now is to just skip this test when code coverage tracking is on. It'll still work in REPL mode for 99.9% of users (I think people rarely turn on code coverage tracking for interactive use)

The added annotation might also benefit performance of some code
@fingolfin fingolfin merged commit 85e50f5 into oscar-system:master Sep 11, 2023
@fingolfin fingolfin deleted the mh/repl-compl branch September 11, 2023 10:03
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.

2 participants