diff --git a/.github/workflows/jlpkgbutler-ci-master-workflow.yml b/.github/workflows/jlpkgbutler-ci-master-workflow.yml index 8d881dc8..590569f7 100644 --- a/.github/workflows/jlpkgbutler-ci-master-workflow.yml +++ b/.github/workflows/jlpkgbutler-ci-master-workflow.yml @@ -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: @@ -37,4 +37,3 @@ jobs: files: ./lcov.info flags: unittests token: ${{ secrets.CODECOV_TOKEN }} - \ No newline at end of file diff --git a/.github/workflows/jlpkgbutler-ci-pr-workflow.yml b/.github/workflows/jlpkgbutler-ci-pr-workflow.yml index 8793bf55..b23117bd 100644 --- a/.github/workflows/jlpkgbutler-ci-pr-workflow.yml +++ b/.github/workflows/jlpkgbutler-ci-pr-workflow.yml @@ -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 diff --git a/src/SymbolServer.jl b/src/SymbolServer.jl index c95adee4..e9eee75a 100644 --- a/src/SymbolServer.jl +++ b/src/SymbolServer.jl @@ -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() diff --git a/src/server.jl b/src/server.jl index f588b6a2..c7f091a2 100644 --- a/src/server.jl +++ b/src/server.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index b884bf9d..46098377 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 @@ -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) @@ -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 diff --git a/test/testenv/Project.toml b/test/testenv/Project.toml index 2f49da57..3abccfd4 100644 --- a/test/testenv/Project.toml +++ b/test/testenv/Project.toml @@ -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"