Skip to content

Conversation

@ericphanson
Copy link
Member

@ericphanson ericphanson commented Jun 12, 2025

Since developing ExplicitImports, JuliaSyntax has reached 1.0! 🎉

This however has meant some breaking changes in the syntax tree, which required some updating in ExplicitImports. I have a branch (this PR) that is JuliaSyntax-1.0-compatible that you can install here:

pkg> add ExplicitImports#eph/js_v1

The branch is now passing all my tests (on non-beta/nightly which is failing unrelatedly), and I plan to release it as ExplicitImports v1.12 next week.

However in the meantime if you are currently using ExplicitImports in your codebase, if you could test out this branch and verify it still works (e.g. does not start failing your tests) that would be very helpful. Both success and failure reports are useful, and you can reply here (in this PR), on discourse, file an issue on ExplicitImports.jl, or message me on the open source Julia slack.

@JoshuaLampert
Copy link

On Julia v1.11.5, ExplicitImports.jl fails to precompile on this branch for me:

(@v1.11) pkg> activate --temp
  Activating new project at `/tmp/jl_VKLMqt`

(jl_VKLMqt) pkg> add ExplicitImports#eph/js_v1
    Updating git-repo `https://github.com/ericphanson/ExplicitImports.jl.git`
   Resolving package versions...
    Updating `/tmp/jl_VKLMqt/Project.toml`
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
    Updating `/tmp/jl_VKLMqt/Manifest.toml`
  [1520ce14] + AbstractTrees v0.4.5
  [34da2185] + Compat v4.16.0
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
  [70703baa] + JuliaSyntax v1.0.2
⌅ [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [0dad84c5] + ArgTools v1.1.2
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [ade2ca70] + Dates v1.11.0
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching v1.11.0
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2 v1.11.0
  [8f399da3] + Libdl v1.11.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.11.0
  [de0858da] + Printf v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [deac9b47] + LibCURL_jll v8.6.0+0
  [e37daf67] + LibGit2_jll v1.7.2+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.6+0
  [14a3606d] + MozillaCACerts_jll v2023.12.12
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850ede] + nghttp2_jll v1.59.0+0
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`

julia> using ExplicitImports
Precompiling ExplicitImports...
Info Given ExplicitImports was explicitly requested, output will be shown live 
ERROR: LoadError: unknown Kind name "iteration"
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] (::JuliaSyntax.var"#4#6"{String})()
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:980
  [3] get
    @ ./dict.jl:526 [inlined]
  [4] convert(::Type{JuliaSyntax.Kind}, s::String)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:979
  [5] var"@K_str"(__source__::LineNumberNode, __module__::Module, s::Any)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:1014
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
  [7] include(x::String)
    @ ExplicitImports ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
  [8] top-level scope
    @ ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:51
  [9] include
    @ ./Base.jl:557 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:280
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:276
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
in expression starting at stdin:6
  ✗ ExplicitImports
  0 dependencies successfully precompiled in 3 seconds. 28 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

ExplicitImports 

Failed to precompile ExplicitImports [7d51a73a-1435-4ff3-83d9-f097790105c7] to "/home/lampert/.julia/compiled/v1.11/ExplicitImports/jl_DlWqLt".
ERROR: LoadError: unknown Kind name "iteration"
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] (::JuliaSyntax.var"#4#6"{String})()
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:980
  [3] get
    @ ./dict.jl:526 [inlined]
  [4] convert(::Type{JuliaSyntax.Kind}, s::String)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:979
  [5] var"@K_str"(__source__::LineNumberNode, __module__::Module, s::Any)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:1014
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
  [7] include(x::String)
    @ ExplicitImports ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
  [8] top-level scope
    @ ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:51
  [9] include
    @ ./Base.jl:557 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:280
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:276
in expression starting at /home/lampert/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
in expression starting at stdin:

@ericphanson
Copy link
Member Author

@JoshuaLampert is it possible an older version of JuliaSyntax is already loaded in your session? potentially in a startup file or similar? (If so, Julia won't load the new version required by ExplicitImports).

Here is one way you can check which version is loaded, e.g. run this after you get the crash to confirm it's JS 0.4.10 that is actually loaded:

julia> using TOML # stdlib

julia> mods = filter(Base.loaded_modules) do (k, v)
       string(v) == "JuliaSyntax"
       end
Dict{Base.PkgId, Module} with 1 entry:
  PkgId(UUID("70703baa-626e-46a2-a12c-08ffd08c73b4"), "JuliaSynt… => JuliaSyntax

julia> TOML.parsefile(joinpath(pkgdir(only(mods)[2]), "Project.toml"))
Dict{String, Any} with 8 entries:
  "deps"    => Dict{String, Any}()
  "name"    => "JuliaSyntax"
  "extras"  => Dict{String, Any}("Test"=>"8dfed614-e22c-5e08-85e1-65c5234f0b40"
  "uuid"    => "70703baa-626e-46a2-a12c-08ffd08c73b4"
  "compat"  => Dict{String, Any}("julia"=>"1.0")
  "targets" => Dict{String, Any}("test"=>["Test", "Logging"])
  "authors" => ["Claire Foster <aka.c42f@gmail.com> and contributors"]
  "version" => "0.4.10"

I was able to reproduce only in that setting:

Reproduction of crash by loading JS 0.4.10 first

Here I've copied my session where I first install the branch on 1.11.5 without a crash. Then I load JS 0.4.10, then activate a new env, install ExplicitImports from the branch, and trigger a crash on using.

eph@Erics-MacBook-Air ~ % julia +1.11.5
]act	               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.5 (2025-04-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.11) pkg> activate --temp
  Activating new project at `/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_NFV5W3`

(jl_NFV5W3) pkg> add ExplicitImports#eph/js_v1

     Cloning git-repo `ssh://git@github.com/ericphanson/ExplicitImports.jl.git`
    Updating git-repo `ssh://git@github.com/ericphanson/ExplicitImports.jl.git`
    Updating registry at `~/.julia/registries/Beacon`
    Updating git-repo `ssh://git@github.com/beacon-biosignals/BeaconRegistry.git`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed JuliaSyntax ─ v1.0.2
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_NFV5W3/Project.toml`
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_NFV5W3/Manifest.toml`
  [1520ce14] + AbstractTrees v0.4.5
  [34da2185] + Compat v4.16.0
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
  [70703baa] + JuliaSyntax v1.0.2
⌅ [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [0dad84c5] + ArgTools v1.1.2
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [ade2ca70] + Dates v1.11.0
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching v1.11.0
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2 v1.11.0
  [8f399da3] + Libdl v1.11.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.11.0
  [de0858da] + Printf v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [deac9b47] + LibCURL_jll v8.6.0+0
  [e37daf67] + LibGit2_jll v1.7.2+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.6+0
  [14a3606d] + MozillaCACerts_jll v2023.12.12
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850ede] + nghttp2_jll v1.59.0+0
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  3 dependencies successfully precompiled in 16 seconds. 26 already precompiled.

julia> using ExplicitImports

julia>
eph@Erics-MacBook-Air ~ % julia +1.11.5
]ac               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.5 (2025-04-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.11) pkg> activate --temp
  Activating new project at `/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_6UKpNU`

(jl_6UKpNU) pkg> add [email protected]
   Resolving package versions...
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_6UKpNU/Project.toml`
⌃ [70703baa] + JuliaSyntax v0.4.10
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_6UKpNU/Manifest.toml`
⌃ [70703baa] + JuliaSyntax v0.4.10
        Info Packages marked with ⌃ have new versions available and may be upgradable.
Precompiling project...
  1 dependency successfully precompiled in 8 seconds

julia> using JuliaSyntax

(jl_6UKpNU) pkg> activate --temp
  Activating new project at `/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_pYkNhY`

(jl_pYkNhY) pkg> add ExplicitImports#eph/js_v1

    Updating git-repo `ssh://git@github.com/ericphanson/ExplicitImports.jl.git`
   Resolving package versions...
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_pYkNhY/Project.toml`
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
    Updating `/private/var/folders/gj/l9rbktlj6qndlnz1nk164d280000gn/T/jl_pYkNhY/Manifest.toml`
  [1520ce14] + AbstractTrees v0.4.5
  [34da2185] + Compat v4.16.0
  [7d51a73a] + ExplicitImports v1.12.0 `https://github.com/ericphanson/ExplicitImports.jl.git#eph/js_v1`
  [70703baa] + JuliaSyntax v1.0.2
⌅ [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [0dad84c5] + ArgTools v1.1.2
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [ade2ca70] + Dates v1.11.0
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching v1.11.0
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2 v1.11.0
  [8f399da3] + Libdl v1.11.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.11.0
  [de0858da] + Printf v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [deac9b47] + LibCURL_jll v8.6.0+0
  [e37daf67] + LibGit2_jll v1.7.2+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.6+0
  [14a3606d] + MozillaCACerts_jll v2023.12.12
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850ede] + nghttp2_jll v1.59.0+0
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`

julia> using ExplicitImports
Precompiling ExplicitImports...
Info Given ExplicitImports was explicitly requested, output will be shown live
ERROR: LoadError: unknown Kind name "iteration"
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] (::JuliaSyntax.var"#4#6"{String})()
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:980
  [3] get
    @ ./dict.jl:526 [inlined]
  [4] convert(::Type{JuliaSyntax.Kind}, s::String)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:979
  [5] var"@K_str"(__source__::LineNumberNode, __module__::Module, s::Any)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:1014
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
  [7] include(x::String)
    @ ExplicitImports ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
  [8] top-level scope
    @ ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:51
  [9] include
    @ ./Base.jl:557 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:280
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:276
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
in expression starting at stdin:6
  ✗ ExplicitImports
  0 dependencies successfully precompiled in 2 seconds. 28 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

ExplicitImports

Failed to precompile ExplicitImports [7d51a73a-1435-4ff3-83d9-f097790105c7] to "/Users/eph/.julia/compiled/v1.11/ExplicitImports/jl_Ht0cQl".
ERROR: LoadError: unknown Kind name "iteration"
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] (::JuliaSyntax.var"#4#6"{String})()
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:980
  [3] get
    @ ./dict.jl:526 [inlined]
  [4] convert(::Type{JuliaSyntax.Kind}, s::String)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:979
  [5] var"@K_str"(__source__::LineNumberNode, __module__::Module, s::Any)
    @ JuliaSyntax ~/.julia/packages/JuliaSyntax/BHOG8/src/kinds.jl:1014
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
  [7] include(x::String)
    @ ExplicitImports ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
  [8] top-level scope
    @ ~/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:51
  [9] include
    @ ./Base.jl:557 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:280
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/get_names_used.jl:276
in expression starting at /Users/eph/.julia/packages/ExplicitImports/Mdb6v/src/ExplicitImports.jl:1
in expression starting at stdin:

@JoshuaLampert
Copy link

JoshuaLampert commented Jun 13, 2025

Oh, yes that is true. With julia --startup=no, I don't get the error. Something (edit: it was About.jl) in my default environment is holding me back to get JuliaSyntax@1. Thanks for the hint and sorry for the noise.

@ericphanson ericphanson changed the base branch from main to eph/tests June 13, 2025 20:49
Base automatically changed from eph/tests to main June 13, 2025 21:02
@ericphanson ericphanson merged commit f98b7dd into main Jun 18, 2025
7 checks passed
@ericphanson ericphanson deleted the eph/js_v1 branch June 18, 2025 11:34
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