PackageCompiler.jl
PackageCompiler.jl copied to clipboard
`create_sysimage` gets confused by unrelated projects matching `JULIA_PROJECT`
This is on julia 1.8.4, PC.jl 2.1.2.
A MWE can be:
$ mkdir /tmp/jl_project; cd /tmp/jl_project$ julia --project=.]generate XYZ;]dev ./XYZ$ mkdir image; cd image; julia --startup-file=no]activate --temp]add InlineTestENV["JULIA_PROJECT"] = "@."using PackageCompiler; create_sysimage(sysimage_path="./image.so")
This results in the following error:
julia> using PackageCompiler; create_sysimage(sysimage_path="./image.so")
0 dependencies successfully precompiled in 0 seconds
ERROR: The following 1 direct dependency failed to precompile:
XYZ [12bc79f3-ea85-4693-851d-069bcf1ea768]
Error: Missing source file for XYZ [12bc79f3-ea85-4693-851d-069bcf1ea768
Stacktrace:
[...]
It doesn't seem correct to consider the project at "/tmp/jl_project" inside create_sysimage, as the current active project is something else.
I was encountering the exact same problem this morning. In my case, I fixed it by clearing my JULIA_PROJECT environment variable, which was pointing to an unrelated project. This seems like undesirable behavior on the part of PackageCompiler as it shouldn't get confused by that when you're asking to build an image for specific package(s) or your current active project?