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

Unable to activate environments with [sources] with relative paths #92

Open
mortenpi opened this issue Dec 17, 2024 · 0 comments · May be fixed by #93
Open

Unable to activate environments with [sources] with relative paths #92

mortenpi opened this issue Dec 17, 2024 · 0 comments · May be fixed by #93

Comments

@mortenpi
Copy link

mortenpi commented Dec 17, 2024

In short, if you have a package that depends on another local path via

[sources]
DependentEnv = {path = "../DependentEnv"}

Then TestEnv.activate() will fail with

ERROR: LoadError: expected package `DependentEnv [c9261501]` to exist at path `/tmp/DependentEnv`
...
caused by: expected package `DependentEnv [c9261501]` to exist at path `/tmp/DependentEnv`

This is with Julia 1.11.2.

Full Stacktrace
ERROR: LoadError: expected package `DependentEnv [c9261501]` to exist at path `/tmp/DependentEnv`
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Types.jl:68
  [2] collect_fixed!(env::Pkg.Types.EnvCache, pkgs::Vector{Pkg.Types.PackageSpec}, names::Dict{Base.UUID, String})
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:334
  [3] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, installed_only::Bool)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:400
  [4] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, level::Pkg.Types.UpgradeLevel; skip_writing_project::Bool, preserve::Nothing)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1622
  [5] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, preserve::Nothing, update_registry::Bool, skip_writing_project::Bool, kwargs::@Kwargs{io::Base.DevNull})
    @ Pkg.API ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:382
  [6] up
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:356 [inlined]
  [7] up
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:164 [inlined]
  [8] #resolve#143
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:388 [inlined]
  [9] resolve
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:387 [inlined]
 [10] activate(pkg::String; allow_reresolve::Bool)
    @ TestEnv ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:68
 [11] activate
    @ ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:9 [inlined]
 [12] activate()
    @ TestEnv ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:9
 [13] top-level scope
    @ ~/oss/testenv/julia-TestEnv-mwe/testenv-activate.jl:5
in expression starting at /home/mortenpi/oss/testenv/julia-TestEnv-mwe/testenv-activate.jl:5

caused by: expected package `DependentEnv [c9261501]` to exist at path `/tmp/DependentEnv`
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Types.jl:68
  [2] collect_fixed!(env::Pkg.Types.EnvCache, pkgs::Vector{Pkg.Types.PackageSpec}, names::Dict{Base.UUID, String})
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:334
  [3] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, installed_only::Bool)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:400
  [4] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, level::Pkg.Types.UpgradeLevel; skip_writing_project::Bool, preserve::Nothing)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1622
  [5] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, preserve::Nothing, update_registry::Bool, skip_writing_project::Bool, kwargs::@Kwargs{io::Base.DevNull})
    @ Pkg.API ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:382
  [6] up
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:356 [inlined]
  [7] up
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:164 [inlined]
  [8] #resolve#143
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:388 [inlined]
  [9] resolve
    @ ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:387 [inlined]
 [10] activate(pkg::String; allow_reresolve::Bool)
    @ TestEnv ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:58
 [11] activate
    @ ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:9 [inlined]
 [12] activate()
    @ TestEnv ~/.julia/packages/TestEnv/tgnBf/src/julia-1.11/activate_set.jl:9
 [13] top-level scope
    @ ~/oss/testenv/julia-TestEnv-mwe/testenv-activate.jl:5

I also threw together a simple MWE for this: https://github.com/mortenpi/julia-TestEnv-mwe

The entry point is https://github.com/mortenpi/julia-TestEnv-mwe/blob/main/mwe.sh

@mortenpi mortenpi linked a pull request Dec 17, 2024 that will close this issue
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 a pull request may close this issue.

1 participant