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

allow the Compiler.jl stdlib to be installed on older version of Julia #56553

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

aviatesk
Copy link
Member

Since #56409, Compiler.jl as a standard library has become available. However, for Julia versions prior to this change, even though the stdlib can be installed via Pkg.jl, the precompilation fails due to code compatibility issues. Consequently, when an external package that uses the Compiler stdlib adds Compiler.jl to its Project.toml, the package would stop working on older Julia versions.

To address this, this commit adopts the same approach as JET.jl. Specifically, on older Julia versions, a dummy Compiler module is defined, allowing dependent packages to switch between using the Compiler.jl stdlib or the previous Core.Compiler. While this is a somewhat hacky solution, it should resolve the issue for now.

@aviatesk aviatesk force-pushed the avi/Compiler-stdlib-compat branch from e6a9ffc to da54d89 Compare November 14, 2024 08:36
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 14, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 14, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
Compiler/src/Compiler.jl Outdated Show resolved Hide resolved
@aviatesk aviatesk force-pushed the avi/Compiler-stdlib-compat branch from c4ef8b5 to 2d70790 Compare November 14, 2024 09:08
@aviatesk aviatesk force-pushed the avi/Compiler-stdlib-compat branch 2 times, most recently from 214f580 to 92d6adc Compare November 14, 2024 10:13
Since #56409, Compiler.jl as a standard library has
become available. However, for Julia versions prior to this change, even
though the stdlib can be installed via Pkg.jl, the precompilation fails
due to code compatibility issues. Consequently, when an external package
that uses the Compiler stdlib adds Compiler.jl to its Project.toml, the
package would stop working on older Julia versions.

To address this, this commit adopts the same approach as JET.jl.
Specifically, on older Julia versions, a dummy `Compiler` module is
defined, allowing dependent packages to switch between using the
Compiler.jl stdlib or the previous `Core.Compiler`. While this is a
somewhat hacky solution, it should resolve the issue for now.
@aviatesk aviatesk force-pushed the avi/Compiler-stdlib-compat branch from 92d6adc to da0116a Compare November 14, 2024 10:15
Compiler/src/Compiler.jl Outdated Show resolved Hide resolved
@aviatesk
Copy link
Member Author

Ok, now this PR is ready to be merged.

To ensure that stale precompilation caches aren't used.
@aviatesk aviatesk force-pushed the avi/Compiler-stdlib-compat branch from a1edc3f to 3d0dc3b Compare November 14, 2024 12:24
@aviatesk aviatesk merged commit 1e063d8 into master Nov 14, 2024
4 of 7 checks passed
@aviatesk aviatesk deleted the avi/Compiler-stdlib-compat branch November 14, 2024 15:47
@Keno
Copy link
Member

Keno commented Nov 14, 2024

This PR broke the Revise test

@Keno
Copy link
Member

Keno commented Nov 14, 2024

I'll fix it, but just be careful merging things that break that test.

@Keno
Copy link
Member

Keno commented Nov 14, 2024

I'll fix it, but just be careful merging things that break that test.

timholy/Revise.jl#863

aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 15, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 15, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 15, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Nov 15, 2024
This requires JuliaLang/julia#56553 to be merged, and the new
Compiler.jl stdlib to be registered in General beforehand.
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