JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.39k stars 185 forks source link

`create_sysimage` gets confused by unrelated projects matching `JULIA_PROJECT` #759

Open rfourquet opened 1 year ago

rfourquet commented 1 year ago

This is on julia 1.8.4, PC.jl 2.1.2.

A MWE can be:

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.

parrangoiz commented 4 weeks ago

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?