JuliaPy / Conda.jl

Conda managing Julia binary dependencies
Other
171 stars 57 forks source link

Julia v1.10-rc1: Conda.jl does not build when `startup.jl` loads packages #250

Closed jtschneider closed 7 months ago

jtschneider commented 7 months ago

Hello!

I encountered a mildly annoying bug: Conda.jl does not build when the file ${JULIA_DEPOT_PATH}/config/startup.jl loads any package, including one in the Standard Library.

The trivial bypass is to build Conda.jl by (temporarily) commenting out all loaded packages in startup.jl, which is nothing dramatic. Still, I wanted to report this issue so nobody new gets frustrated.

In all cases below, my startup.jl reads:

ENV["CONDA_JL_HOME"] = "/home/jan/anaconda3/envs/conda_jl"
ENV["PYTHON"] = "/home/jan/anaconda3/envs/conda_jl/bin/python"
# using OhMyREPL
using Pkg

Here is the error output and my versioninfo() output:

Output v1.10-rc1

```julia (@v1.10) pkg> status Conda Status `~/.julia/environments/v1.10/Project.toml` [8f4d0f93] Conda v1.10.0 (@v1.10) pkg> build Conda PyCall PyPlot Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/51cab8e982c5b598eea9c8ceaced4b58d9dd37c9/build.log` ERROR: Error building `Conda`: ERROR: LoadError: ArgumentError: Package Pkg not found in current path. - Run `import Pkg; Pkg.add("Pkg")` to install the Pkg package. Stacktrace: [1] macro expansion @ Base ./loading.jl:1766 [inlined] [2] macro expansion @ Base ./lock.jl:267 [inlined] [3] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1747 [4] #invoke_in_world#3 @ Base ./essentials.jl:921 [inlined] [5] invoke_in_world @ Base ./essentials.jl:918 [inlined] [6] require(into::Module, mod::Symbol) @ Base ./loading.jl:1740 in expression starting at /home/jan/.julia/config/startup.jl:6 julia> versioninfo() Julia Version 1.10.0-rc1 Commit 5aaa9485436 (2023-11-03 07:44 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 32 × AMD Ryzen 9 7950X 16-Core Processor WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, znver3) Threads: 1 on 32 virtual cores Environment: JULIA_DEPOT_PATH = /home/jan/.julia ```

Note that this error does not occur in v1.9:

Output v1.9.4

```julia (@v1.9) pkg> status Conda Status `~/.julia/environments/v1.9/Project.toml` [8f4d0f93] Conda v1.10.0 (@v1.9) pkg> build Conda PyCall PyPlot Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/51cab8e982c5b598eea9c8ceaced4b58d9dd37c9/build.log` Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/1cb97fa63a3629c6d892af4f76fcc4ad8191837c/build.log` Precompiling project... 3 dependencies successfully precompiled in 4 seconds. 603 already precompiled. julia> versioninfo() Julia Version 1.9.4 Commit 8e5136fa297 (2023-11-14 08:46 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 32 × AMD Ryzen 9 7950X 16-Core Processor WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, znver3) Threads: 1 on 32 virtual cores Environment: JULIA_DEPOT_PATH = /home/jan/.julia JULIA_IMAGE_THREADS = 1 ```

stevengj commented 7 months ago

This is a bug in Pkg.jl, fixed by: https://github.com/JuliaLang/Pkg.jl/pull/3699