Skip to content

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

Merged
aviatesk merged 4 commits intomasterfrom
avi/Compiler-stdlib-compat
Nov 14, 2024
Merged

allow the Compiler.jl stdlib to be installed on older version of Julia#56553
aviatesk merged 4 commits intomasterfrom
avi/Compiler-stdlib-compat

Conversation

@aviatesk
Copy link
Copy Markdown
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.
@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
@aviatesk
Copy link
Copy Markdown
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
@aviatesk aviatesk deleted the avi/Compiler-stdlib-compat branch November 14, 2024 15:47
@Keno
Copy link
Copy Markdown
Member

Keno commented Nov 14, 2024

This PR broke the Revise test

@Keno
Copy link
Copy Markdown
Member

Keno commented Nov 14, 2024

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

@Keno
Copy link
Copy Markdown
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.
serenity4 pushed a commit to serenity4/julia that referenced this pull request May 1, 2025
JuliaLang#56553)

Since JuliaLang#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.

Also includes a change to include `ssair/show.jl` in the context of
`Compiler` to ensure that stale precompilation caches are not used.

And as a result this commit bumps the version of the Compiler.jl
standard library.
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