Skip to content

Source git-tree-sha1 written to build/environments #90

@stemann

Description

@stemann

The git-tree-sha1 written to build/environments seem to be that of the source package - and not the rewritten packages. Not sure if this is intended?

More elaborate description:

When doing julia --project bundle.jl for a package named Foo from a private registry, where Foo exists in General (but with a different UUID), the git-tree-sha1 written to build/environments/ExampleEnv/Manifest.toml is that of the source package (b7a1e1a09fc1a40240dcce5a5c39f1e4b7920661) and not the git-tree-sha1 of the re-written package (in build/packages), which makes Pkg.instantiate() fail:

julia --project=environments/ExampleEnv --eval 'using Pkg; Pkg.instantiate()'

ERROR: Foo: git object b7a1e1a09fc1a40240dcce5a5c39f1e4b7920661 could not be found
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] install_git(io::IOContext{IO}, uuid::Base.UUID, name::String, hash::Base.SHA1, urls::Set{String}, version_path::String)
   @ Pkg.Operations /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:727
 [3] download_source(ctx::Pkg.Types.Context; readonly::Bool)
   @ Pkg.Operations /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:943
 [4] download_source
   @ /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:824 [inlined]
 [5] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, kwargs::@Kwargs{})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:1270
 [6] instantiate
   @ /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:1172 [inlined]
 [7] instantiate(; kwargs::@Kwargs{})
   @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:1171
 [8] top-level scope
   @ none:1

Not using the environment in build/environments/ExampleEnv works just fine:

julia --eval 'using Pkg; Pkg.add("Foo"); using Foo; print(read(pathof(Foo), String))'
module Foo
cd(@__DIR__) do
    pkgid = Base.PkgId(Base.UUID("9e88b42a-f829-5b0c-bbe9-9e923198166b"), "Serialization")
    buffer = seekstart(IOBuffer(xor.(read("Foo.jl.$(VERSION).jls"), 0x0a)))
    for x in Base.invokelatest(Base.require(pkgid).deserialize, buffer).args
        Core.eval(@__MODULE__, x)
    end
end
end

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