Subject: [bug#73197] [PATCH] gnu: julia: Update to 1.9.3.

From: Simon Tournier <[email-masked]>
Date: Mon, 13 Jan 2025 19:31:16 +0100

Hi Ludo,

On Wed, 08 Jan 2025 at 11:44, Ludovic Courtès <[email-masked]> wrote:

> This branch is built already:
> <https://ci.guix.gnu.org/jobset/julia-upgrade>.

Thanks, cool!

>>> The problem is that the julia-build-system needs to be adapted to the
>>> newer versions of Julia.
>
> To be clear, the build failures here have to do with JULIA_LOAD_PATH or
> JULIA_DEPOT_PATH somehow not being set to the right value.  (That’s why
> roughly packages with no dependency other than Julia build fine, while
> those that depend on other julia-* packages fails to build.)

It appears to me more complicated than only JULIA_LOAD_PATH and/or
JULIA_DEPOT_PATH.  When I sent the email, I also was thinking something
in this area.  Then it took me some time to understand what’s wrong. :-)

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---

My debugging session if someone has a good fix for that. :-) Well, I
instructed the ’precompile’ phase of the julia-build-system in order to
better see; here the trace:

--8<---------------cut here---------------start------------->8---
starting phase `precompile'
(init)JULIA_DEPOT_PATH: "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia/:/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/"
(init)JULIA_LOAD_PATH: "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/"
JULIA_DEPOT_PATH: "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia/:/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/:/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/"
JULIA_LOAD_PATH: "/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/:/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/"
(before)DEPOT_PATH: ["/homeless-shelter/.julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/local/share/julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia/", "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/", "/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/"]
(before)LOAD_PATH: ["@", "@v#.#", "@stdlib", "/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/", "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/"]
IDENTIFY_PACKAGE_ENV: (ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9], "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/")
LOCATE_PACKAGE: /gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/ConstructionBase/src/ConstructionBase.jl
DEPOT_PATH: ["/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/", "/homeless-shelter/.julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/local/share/julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia/", "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/"]
LOAD_PATH: ["/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/environments/v1.9/Project.toml", "/gnu/store/acvkqdyipdrsa5jrzb185ch37iyliw13-julia-1.9.3/share/julia/stdlib/v1.9", "/gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/", "/gnu/store/iiykv7r9ckygxlz0qb9aag5zv317ffz9-julia-constructionbase-1.3.0/share/julia/loadpath/"]
PKG: Unitful [1986cc42-f94f-5a68-af5c-568840ba703d]
ENV: /gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/
PATH: /gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/Unitful/src/Unitful.jl
PKG: ConstructionBase [187b0558-2788-49d3-abe0-74a17ed4e7c9]
ENV: /gnu/store/p6iq6pkc04lj8c43n5a2s058s3ng6rkc-julia-unitful-1.12.2/share/julia/loadpath/
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---

Indeed, it cannot find ’ConstructionBase’ under the “environment” of
’Unitful’ although it clearly appears both via LOAD_PATH
(JULIA_LOAD_PATH) and DEPOT_PATH (JULIA_DEPOT_PATH).  Well, Julia
package management is designed to have one central place (usually
~/.julia), arf!

I will try to be creative if no one beats me. :-)

To be continued…

Cheers,
simon