Hi, On Mon, 13 Jan 2025 at 19:31, Simon Tournier wrote: > For the record, it’s about base/loading.jl: > > --8<---------------cut here---------------start------------->8--- > try > toplevel_load[] = false > # perform the search operation to select the module file require intends to load > - path = locate_package(pkg) > + path = locate_package(pkg, env) > if path === nothing > throw(ArgumentError(""" > Package $pkg is required but does not seem to be installed: > --8<---------------cut here---------------end--------------->8--- Welcome to a debugging session using the most advanced technique: print! :-) Attached the base/loading.jl with many ’println’. Well, that’s very interesting because it seems related to some Julia internals. Somehow, the order of LOAD_PATH matters! In all the dance, the code enters once and it founds it! --8<---------------cut here---------------start------------->8--- ENTRY _require: Call locate_package( ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] , /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ ) [...] RESULT _require: path = /gnu/store/yg4bz2kb7dqb6haaj0v7hj4mrd8rn27l-julia-constructionbase-1.3.0/share/julia/loadpath/ConstructionBase/src/ConstructionBase.jl --8<---------------cut here---------------end--------------->8--- Then, it enters later with the same call… And bang! --8<---------------cut here---------------start------------->8--- ENTRY _require: Call locate_package( ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] , /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ ) [...] RESULT _require: path = nothing ERROR: LoadError: ArgumentError: Package ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] is required but does not seem to be installed: - Run `Pkg.instantiate()` to install all recorded dependencies. --8<---------------cut here---------------end--------------->8--- What’s different? The call loops over load_path(), something like: --8<---------------cut here---------------start------------->8--- locate_package_env: START LOOP; over load_path() = ["/gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/environments/v1.9/Project.toml", "/gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9", "/gnu/store/yg4bz2kb7dqb6haaj0v7hj4mrd8rn27l-julia-constructionbase-1.3.0/share/julia/loadpath/", "/gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/"] locate_package_env: loop = 1 locate_package_env: env = /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/environments/v1.9/Project.toml locate_package_env: path = nothing locate_package_env: loop = 2 locate_package_env: env = /gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9 locate_package_env: path = nothing locate_package_env: loop = 3 locate_package_env: env = /gnu/store/yg4bz2kb7dqb6haaj0v7hj4mrd8rn27l-julia-constructionbase-1.3.0/share/julia/loadpath/ locate_package_env: path = /gnu/store/yg4bz2kb7dqb6haaj0v7hj4mrd8rn27l-julia-constructionbase-1.3.0/share/julia/loadpath/ConstructionBase/src/ConstructionBase.jl --8<---------------cut here---------------end--------------->8--- And for the second case, tandam! --8<---------------cut here---------------start------------->8--- locate_package_env: START LOOP; over load_path() = ["/tmp/.julia/environments/v1.9/Project.toml", "/gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9", "/gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/", "/gnu/store/yg4bz2kb7dqb6haaj0v7hj4mrd8rn27l-julia-constructionbase-1.3.0/share/julia/loadpath/"] locate_package_env: loop = 1 locate_package_env: env = /tmp/.julia/environments/v1.9/Project.toml locate_package_env: path = nothing locate_package_env: loop = 2 locate_package_env: env = /gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9 locate_package_env: path = nothing locate_package_env: loop = 3 locate_package_env: env = /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ locate_package_env: path = nothing locate_package_env: BREAK: /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ == /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ locate_package_env: : loading_extension = false locate_package_env: : precompiling_extension = false locate_package_env: END LOOP locate_package_env: pkg = ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] locate_package_env: Sys.STDLIB = /gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9 locate_package_env: Call manifest_uuid_path( /gnu/store/cp0fbzd4j1znnp4fjpsknap0ksnp2xk1-julia-1.9.3/share/julia/stdlib/v1.9 , ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] ) locate_package_env: mbypath = nothing String? false locate_package_env: RETURN: path = nothing ; env = /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ locate_package: RETURN: nothing _require: Post locate_package( ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9] , /gnu/store/garmz1dz382ib25p2ckl0kj9rjay4xd4-julia-unitful-1.12.2/share/julia/loadpath/ ) RESULT _require: path = nothing --8<---------------cut here---------------end--------------->8--- The attentive reader notes that load_path() is a list of 4 elements –the last contains what we want– but a test breaks the loop. Well, I do not know the details about the reasons of all that. Maybe something worth to ask upstream. :-) Well, I’ll (force) push shortly a trivial fix to the branch wip-julia-upgrade. Cheers, simon PS: For the record, some elements: 1. Checkout wip-julia-upgrade 2. cp $(./pre-inst-env guix build julia -S) /tmp/ 3. Uncompress the source and copy (e.g., /home/simon/tmp/julia-1.9.3) 4. Tweak the base/loading.jl file (and other as base/initdefs.jl) 5. Use this source with: (source (local-file "/home/simon/tmp/julia-1.9.3" #:recursive? #t)) 6. guix shell -CPNWD guix --expose=/home/simon/tmp/=/home/simon/tmp/ 7. Build: ./pre-inst-env guix build --no-grafts --without-tests=julia julia 8. Tweak guix/build-system/julia-build-system.scm 9. Loop ./pre-inst-env guix build --no-grafts --without-tests=julia julia-unitful Hope that helps. --