Skip to content

Conditionally use Base.JuliaSyntax on newer Julia; keep vendored JuliaSyntax for older support#177

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nightly-failure
Draft

Conditionally use Base.JuliaSyntax on newer Julia; keep vendored JuliaSyntax for older support#177
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nightly-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

Nightly started failing in inspect_session because the vendored JuliaSyntax parser rejects syntax now accepted/produced in newer Julia versions. This change switches parser backend by Julia version so newer Julia uses Base.JuliaSyntax, while older supported Julia continues using the vendored copy.

  • Backend selection

    • Added a version gate in src/ExplicitImports.jl:
      • VERSION >= v"1.12.0-DEV.0" → use Base.JuliaSyntax
      • older versions → use Vendored.JuliaSyntax
    • Kept a single internal JuliaSyntax binding so downstream parsing logic remains unchanged.
  • Vendoring behavior

    • Stopped loading vendored JuliaSyntax on newer Julia entirely.
    • Continued vendoring/loading AbstractTrees as before.
  • Regression coverage

    • Added a focused testset in test/runtests.jl to assert:
      • newer Julia uses Base.JuliaSyntax and Vendored.JuliaSyntax is not defined
      • older Julia uses Vendored.JuliaSyntax
const BASE_JULIASYNTAX_VERSION = v"1.12.0-DEV.0"
const USE_BASE_JULIASYNTAX = VERSION >= BASE_JULIASYNTAX_VERSION

module Vendored
using ..ExplicitImports: USE_BASE_JULIASYNTAX
if !USE_BASE_JULIASYNTAX
    include(joinpath("vendored", "JuliaSyntax", "src", "JuliaSyntax.jl"))
end
end

if USE_BASE_JULIASYNTAX
    import Base: JuliaSyntax
else
    import .Vendored: JuliaSyntax
end

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/e357641bb3e0638d353c4b29ea0e40ea644066a6
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/d8928e9169ff76c6281f39a659f9bca3a573f24c
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/ebe7e59b37c400f694f52b58c93d26201387da70
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTesting/Aqua.jl/tarball/d57fd255a8932b6509baf43284c416fc44d0b903
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTesting/MetaTesting.jl/tarball/fdd09ae407b46f83aaaadc8a839d5ef090929762
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/211530a7dc76ab59087f4d4d1fc3f086fbe87594
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/d05693d339e37d6ab134c5ab53c29fce5ee5d7d5
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • install.julialang.org
    • Triggering command: /usr/bin/curl curl -fsSL REDACTED (dns block)
  • julialang-s3.julialang.org
    • Triggering command: /usr/bin/curl curl -I REDACTED (dns block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (dns block)
    • Triggering command: `/usr/local/julia1.12.5/bin/julia /usr/local/julia1.12.5/bin/julia -C native -J/usr/local/julia1.12.5/lib/julia/sys.so -g1 --threads=1,1 --code-coverage=none --color=yes --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --eval append!(empty!(Base.DEPOT_PATH), ["/home/REDACTED/.julia", "/usr/local/julia1.12.5/local/share/julia", "/usr/local/julia1.12.5/share/julia"])
      append!(empty!(Base.DL_LOAD_PATH), String[])

cd("/home/REDACTED/work/ExplicitImports.jl/ExplicitImports.jl/test")
ap` (dns block)

  • Triggering command: /usr/bin/julia julia --project=.. runtests.jl (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>nightly failure</issue_title>
<issue_description>```julia
inspect_session: Error During Test at /home/runner/work/ExplicitImports.jl/ExplicitImports.jl/test/runtests.jl:1282
Got exception outside of a @test
ParseError:

Error @ line 447:50

  @label fail begin
      ex isa Expr && ex.head === :call || break fail

└───┘ ── unexpected token after break

Stacktrace:
[1] _parse(rule::Symbol, need_eof::Bool, ::Type{ExplicitImports.Vendored.JuliaSyntax.SyntaxNode}, text::String, index::Int64; version::VersionNumber, ignore_trivia::Bool, filename::Nothing, first_line::Int64, ignore_errors::Bool, ignore_warnings::Bool, kws::@kwargs{})
@ ExplicitImports.Vendored.JuliaSyntax ~/work/ExplicitImports.jl/ExplicitImports.jl/src/vendored/JuliaSyntax/src/parser_api.jl:98
┌ [2] _parse
│ @ ~/work/ExplicitImports.jl/ExplicitImports.jl/src/vendored/JuliaSyntax/src/parser_api.jl:82 [inlined]
╰──── repeated 2 times
[4] parseall
@ ~/work/ExplicitImports.jl/ExplicitImports.jl/src/vendored/JuliaSyntax/src/parser_api.jl:148 [inlined]
[5] SyntaxNodeWrapper(file::String; bad_locations::Set{String})
@ ExplicitImports ~/work/ExplicitImports.jl/ExplicitImports.jl/src/parse_utilities.jl:36
[6] SyntaxNodeWrapper
@ ~/work/ExplicitImports.jl/ExplicitImports.jl/src/parse_utilities.jl:19 [inlined]
[7] analyze_all_names(file::String)
@ ExplicitImports ~/work/ExplicitImports.jl/ExplicitImports.jl/src/get_names_used.jl:783
[8] get_names_used
@ ~/work/ExplicitImports.jl/ExplicitImports.jl/src/get_names_used.jl:1039 [inlined]
[9] fill_cache!(file_analysis::Dict{String, ExplicitImports.FileAnalysis}, files::Vector{String})
@ ExplicitImports ~/work/ExplicitImports.jl/ExplicitImports.jl/src/ExplicitImports.jl:405
[10] explicit_imports(mod::Module, file::String; skip::Tuple{Module, Module, Module}, strict::Bool, warn_stale::Nothing, file_analysis::Dict{String, ExplicitImports.FileAnalysis})
@ ExplicitImports ~/work/ExplicitImports.jl/ExplicitImports.jl/src/ExplicitImports.jl:149
[11] explicit_imports
@ ~/work/ExplicitImports.jl/ExplicitImports.jl/src/ExplicitImports.jl:137 [inlined]


<agent_instructions>JuliaSyntax has moved to https://github.com/JuliaLang/julia/tree/master/JuliaSyntax instead of being in its own repo, and I think it may not be being released as a package anymore. We currently vendor JuliaSyntax. I want you to make that vendoring conditional on a Julia version, and for newer julia versions use `Base.JuliaSyntax` instead (and don't load the vendored code at all in that case). Run and ensure tests pass on julia nightly and the lowest supported julia version. You can run julia nightly with juliaup via `juliaup add nightly`, then `julia +nightly --project....`. You can install juliaup with


curl -fsSL https://install.julialang.org | sh -s -- --yes


## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 8, 2026 17:57
Co-authored-by: ericphanson <5846501+ericphanson@users.noreply.github.com>
Co-authored-by: ericphanson <5846501+ericphanson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix nightly failure in test for inspect_session Conditionally use Base.JuliaSyntax on newer Julia; keep vendored JuliaSyntax for older support Mar 8, 2026
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.

nightly failure

2 participants