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

tweak how Pkg is loaded for precompiling when testing #3606

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

KristofferC
Copy link
Member

This is to prevent #3442 when moving Pkg out of the sysimage.

@KristofferC KristofferC merged commit f570abd into master Sep 5, 2023
10 of 13 checks passed
@KristofferC KristofferC deleted the kc/pkg_load_precompile branch September 5, 2023 08:23
@IanButterworth
Copy link
Member

hmm I think something's wrong here. On latest julia master

(@v1.11) pkg> test MyFoo
     Testing MyFoo
      Status `/private/var/folders/1z/jf841bdj73bdj3vk7kc7f_3w0000gn/T/jl_yhzuNm/Project.toml`
...
Precompiling project...
        Info Given Pkg was explicitly requested, output will be shown live 
ERROR: LoadError: Replacing module `Pkg`
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] macro expansion
   @ Base ./loading.jl:1847 [inlined]
 [3] macro expansion
   @ Base ./lock.jl:267 [inlined]
 [4] register_root_module(m::Module)
   @ Base ./loading.jl:1841
 [5] include
   @ Base ./Base.jl:493 [inlined]
 [6] 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:2216
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/ian/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/Pkg.jl:3
in expression starting at stdin:3
  ✗ Pkg
  0 dependencies successfully precompiled in 1 seconds. 3 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Pkg [44cfe95a-1eb2-52ea-b672-e2afdf69b78f]

Failed to precompile Pkg [44cfe95a-1eb2-52ea-b672-e2afdf69b78f] to "/Users/ian/.julia/compiled/v1.11/Pkg/jl_0iskQe".
ERROR: LoadError: Replacing module `Pkg`
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] macro expansion
   @ Base ./loading.jl:1847 [inlined]
 [3] macro expansion
   @ Base ./lock.jl:267 [inlined]
 [4] register_root_module(m::Module)
   @ Base ./loading.jl:1841
 [5] include
   @ Base ./Base.jl:493 [inlined]
 [6] 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:2216
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/ian/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/Pkg.jl:3
in expression starting at stdin:
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/Types.jl:70
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{io::Base.TTY})
   @ Pkg.API ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/API.jl:1626
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{warn_loaded::Bool})
   @ Pkg.API ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/API.jl:159
 [4] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::@Kwargs{warn_loaded::Bool})
   @ Pkg.API ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.11/Pkg/src/API.jl:174
 [5] top-level scope
   @ none:6
     Testing Precompilation of test environment failed. Continuing to tests
     Testing Running tests...

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