Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_sysimage(; project) does not support shared environments #1022

Open
omus opened this issue Dec 21, 2024 · 1 comment
Open

create_sysimage(; project) does not support shared environments #1022

omus opened this issue Dec 21, 2024 · 1 comment

Comments

@omus
Copy link
Member

omus commented Dec 21, 2024

Attempting to use a shared environment (e.g. julia --project=@shared) does not work when using the @ syntax when calling create_sysimage with the project keyword. For example:

julia --project=@sysimage -e 'using Pkg; Pkg.add("Example")'
julia -e '
    using Pkg
    Pkg.add(PackageSpec(name="PackageCompiler", version="2"))
    using PackageCompiler
    create_sysimage(; project="@sysimage", sysimage_path="sysimage.so")'

Which results in the error:

ERROR: could not find project at "@sysimage"
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] create_pkg_context(project::String)
   @ PackageCompiler ~/.julia/packages/PackageCompiler/UbaS4/src/PackageCompiler.jl:71
 [3] create_sysimage(packages::Nothing; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, julia_init_h_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String, import_into_main::Bool)
   @ PackageCompiler ~/.julia/packages/PackageCompiler/UbaS4/src/PackageCompiler.jl:560
 [4] create_sysimage
   @ ~/.julia/packages/PackageCompiler/UbaS4/src/PackageCompiler.jl:527 [inlined]
 [5] top-level scope
   @ none:5

This can be worked around by specifying the full path to the shared environment (e.g. convert project="@sysimage" to project=joinpath(first(DEPOT_PATH), "environments", "sysimage"))

@omus
Copy link
Member Author

omus commented Dec 21, 2024

Discovered while working on: JuliaTime/TimeZones.jl#479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant