-
-
Notifications
You must be signed in to change notification settings - Fork 197
Initialize global Base.PROGRAM_FILE correctly
#1068
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
Initialize global Base.PROGRAM_FILE correctly
#1068
Conversation
Julia 1.12 does not allow setting the global Base.PROGRAM_FILE from another module (probably Main) at program startup with the existing logic. There probably is a reason why the logic is so complicated. But I currently can't see it. Therefore, just use the already initialized Julia to simply do the work in Julia for all Julia versions instead of hand-crafting solutions which adapt to the evolving C API in different Julia versions. Fixes JuliaLang#1066
|
This is one of the cases, where you think that everything must be much easier than everyone else thought. In my experience, these cases are typically followed by learning that it's much more complicated than you thought. So could you, @KristofferC, please review this? If this should indeed be the solution, I would be happy to get a new release of PackageCompiler.jl soon, as currently it's not working with 1.12. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1068 +/- ##
=======================================
Coverage 86.21% 86.21%
=======================================
Files 3 3
Lines 805 805
=======================================
Hits 694 694
Misses 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It used to be like that, but was removed in #649 due to:
So I think it would be best if we had a C-version of this. Not sure how hard that is. |
|
It at least looks to be hard for me. I'll try a bit more, but don't know whether this will lead somewhere. Note (partially to myself): If we can't fix this, we can at least limit the fix of this PR to 1.12. Being able to get apps depending on including |
|
Yeah, that's fair. |
|
1.13 contains 1.12 could use Then there is a hint by @Keno how it might be solvable, which I do not understand (assigning to which field?), but which might be irrelevant as it uses I prepared the targeted fix for 1.12. Whoever wants to improve on this can do so in a future PR. But for the moment with this PR PackageCompiler.jl is usable again with 1.12 for at least the majority of the users. |
The reason for using the C API is described in [JuliaLang#649](JuliaLang#649). But for the moment use the Julia logic for Julia >= 1.12 as it is still better than not being able to compile an app at all.
|
The error is known and not from this PR. |
|
I wasn't sure whether the other errors are a problem, so I tested at least 1.12 locally both for master and for this PR on Julia 1.12.1. This is the output: To be honest, I am still not sure. But at least it looks like this PR does not add any problem to 1.12.1. Additionally, there are no changes expected to any other released Julia version. Therefore, I think you can merge this, @KristofferC. But please double-check whether you see a blocker. |
Julia 1.12 does not allow setting the global Base.PROGRAM_FILE from another module (probably Main) at program startup with the existing logic.
There probably is a reason why the logic is so complicated. But I currently can't see it. Therefore, just use the already initialized Julia to simply do the work in Julia for all Julia versions instead of hand-crafting solutions which adapt to the evolving C API in different Julia versions.
Fixes #1066