-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Track a distinct compile cache for julia-debug. #33669
Conversation
@@ -633,7 +633,7 @@ end | |||
|
|||
cache_file_entry(pkg::PkgId) = joinpath( | |||
"compiled", | |||
"v$(VERSION.major).$(VERSION.minor)", | |||
"v$(VERSION.major).$(VERSION.minor)" * (JLOptions().debug_level > 1 ? "-debug" : ""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JLOptions().debug_level > 1
is my best guess for the most robust way to test for julia-debug
, but others much more knowledgeable may have a different opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, I chose to prefer it to something like:
endswith(basename(unsafe_string(Base.JLOptions().julia_bin)),"-debug")
so as to be insensitive to a name change of the executable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JLOptions().debug_level
corresponds to the -g
option and not whether the binary was build with debug information embedded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the test should be ccall(:jl_is_debugbuild, Cint, ()) > 0
.
FYI an alternative implementation may be to include Lines 136 to 141 in fa5f1b1
A major advantage might be that using |
@tkf, different system images similarly clobber the compile cache? Tweaking the slug is one way to go. You might also consider qualifying the path, like I did here. It might be a more palatable solution to the maintainers, as it is guaranteed not to interact with the existing implementation. |
Yes, especially because you can use PackageCompiler to bundle a different set of packages in the system image.
Yes, using suffix as you do in this PR does have a benefit like refreshing precompilation cache is as easy as |
@tkf, I think I'll attempt a modest extension of this solution that would, for instance, keep the caches distinct for distinct build images. |
@twadleigh I actually don't know how much core devs want to play with it. So maybe just wait for a response? I don't want to request a feature that would be rejected by core devs :) |
@tkf, fair enough. I'll propose an extension in a separate PR only if/when this is merged. |
FYI, @KristofferC just merged PR #29914. I'm not sure @KristofferC was aware of this patch. Sorry, I should have mentioned there that an alternative patch was suggested in this PR... |
@tkf, I'll close this. If it turns out master still doesn't have the functionality I'm looking for, I'll reopen. |
Addresses #33668.