Skip to content

Incremental sysimage build doesn't support packages with same name but different uuid #768

@krynju

Description

@krynju

This one is similiar to #767, but setup and place where it errors are different.

Setup

Simple two projects that have a top level dependency PackageA, but with different uuids

using PackageCompiler

using Pkg

Pkg.activate("project1") # has Package1 with uuid=1234
create_sysimage(["Package1"]; sysimage_path="sysimage5.so")

Pkg.activate("project2") # has Package1 with uuid=5678
create_sysimage(["Package1"]; sysimage_path="sysimage6.so", base_sysimage="sysimage5.so")

Error

julia> create_sysimage(["Package1"]; sysimage_path="sysimage6.so", base_sysimage="sysimage5.so")
⠙ [00m:07s] PackageCompiler: compiling incremental system imageLoadError
⡆ [00m:08s] PackageCompiler: compiling incremental system imageimporting Package1 into Main conflicts with an existing identifier
in expression starting at /tmp/jl_bOn2oN:7
✖ [00m:08s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`/home/krynju/julia-1.7.3/bin/julia --color=yes --startup-file=no --cpu-target=native -O3 --sysimage=sysimage5.so --project=/home/krynju/sameuuidtest/project2 --output-o=/tmp/jl_sKRDQC.o /tmp/jl_bOn2oN`, ProcessExited(1)) [1]

Error appears due to this code:

# Make packages available in Main. It is unclear if this is the right thing to do.
for pkg in packages
print(julia_code_buffer, """
import $pkg
""")
end

Solution

I worked around this by commenting out this part of code and everything looks to be functioning just right.

The error didn't appear if the package was the same uuid, but a different version, which is probably something weird to handle as well

A build flag to turn off this import behavior would probably be good enough as I'm not sure what the import to Main is dedicated for

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions