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

fix: Julia 1.11 compat #280

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/jlpkgbutler-ci-master-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9']
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', 'nightly']
julia-arch: [x64, x86]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
Expand All @@ -37,4 +37,3 @@ jobs:
files: ./lcov.info
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

7 changes: 2 additions & 5 deletions .github/workflows/jlpkgbutler-ci-pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9']
julia-arch: [x64, x86]
julia-version: ['1.0', '1.6', '1.9', 'nightly']
julia-arch: [x64]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
- os: macOS-latest
julia-arch: x86

steps:
- uses: actions/checkout@v3
Expand Down
10 changes: 9 additions & 1 deletion src/SymbolServer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,15 @@ function getstore(ssi::SymbolServerInstance, environment_path::AbstractString, p
end
end
take!(server_is_ready)
p = open(pipeline(Cmd(`$jl_cmd --code-coverage=$(use_code_coverage==0 ? "none" : "user") --startup-file=no --compiled-modules=no --history-file=no --project=$environment_path $server_script $(ssi.store_path) $pipename`, env=env_to_use), stderr=stderr_for_client_process), read=true, write=true)

# 1.11 introduces the --compiled-modules=existing option, which should be much faster than no
# as of 2023-11-09, loading Pkg with --compiled-modules=no also changes something with the
# active project, which breaks the server.jl script
p = if VERSION > v"1.11-"
open(pipeline(Cmd(`$jl_cmd --code-coverage=$(use_code_coverage==0 ? "none" : "user") --startup-file=no --compiled-modules=existing --history-file=no --project=$environment_path $server_script $(ssi.store_path) $pipename`, env=env_to_use), stderr=stderr), read=true, write=true)
else
open(pipeline(Cmd(`$jl_cmd --code-coverage=$(use_code_coverage==0 ? "none" : "user") --startup-file=no --compiled-modules=no --history-file=no --project=$environment_path $server_script $(ssi.store_path) $pipename`, env=env_to_use), stderr=stderr), read=true, write=true)
end
ssi.process = p

yield()
Expand Down
6 changes: 4 additions & 2 deletions src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ write_depot(server, server.context, written_caches)

@info "Symbol server indexing took $((time_ns() - start_time) / 1e9) seconds."

println(conn, "DONE")
close(conn)
if conn !== nothing
println(conn, "DONE")
close(conn)
end

end
17 changes: 13 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ function check_varrefs(env, m=nothing)
for x in values(m.vals)
if x isa SymbolServer.VarRef && x.parent !== nothing
x0 = SymbolServer._lookup(x.parent, env, true)

if x0 === nothing && x.parent !== nothing && x.parent.name === :Pidfile
# these are dynamically put into Base when loading FileWatching, so we
# don't need to error out when not finding them from the root env
continue
end

@test x0 !== nothing
@test x0 !== m
elseif x isa SymbolServer.ModuleStore
Expand Down Expand Up @@ -90,14 +97,15 @@ end
end

mktempdir() do path
cp(joinpath(@__DIR__, "testenv", "Project.toml"), joinpath(path, "Project.toml"))
cp(joinpath(@__DIR__, "testenv", "Manifest.toml"), joinpath(path, "Manifest.toml"))
cp(joinpath(@__DIR__, "testenv"), path; force=true)

store_path = joinpath(path, "store")
mkpath(store_path)

jl_cmd = joinpath(Sys.BINDIR, Base.julia_exename())
run(`$jl_cmd --project=$path --startup-file=no -e 'using Pkg; Pkg.instantiate()'`)
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
run(`$jl_cmd --project=$path --startup-file=no -e 'using Pkg; Pkg.instantiate()'`)
end

ssi = SymbolServerInstance("", store_path)

Expand All @@ -108,9 +116,10 @@ end
end

# We sleep for a second here to make sure the async task we started
# previously gets run first
# previously gets started first
sleep(1)

# this will cancel the previous getstore request
ret_status2, store2 = getstore(ssi, path, download = false)

if ret_status2 == :failure
Expand Down
1 change: 1 addition & 0 deletions test/testenv/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
IteratorInterfaceExtensions = "82899510-4779-5014-852e-03e436cf321d"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
TableTraits = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"