Skip to content

rez.package_maker.make_package is bad #2145

Description

@vanridal

We had a issue where a bad pip package got created due to a network issue and we discovered it is down to how rez.package_maker.make_package makes a package.

variant_ = variant.install(path)

for variant in src_variants:
    variant_ = variant.install(path)

    base = variant_.base
    if make_base and base:
        os.makedirs(base, exist_ok=True)
        os.chdir(base)
        make_base(variant_, base)

    root = variant_.root
    if make_root and root:
        os.makedirs(root, exist_ok=True)
        os.chdir(root)
        make_root(variant_, root)

    maker.installed_variants.append(variant_)

variant_ = variant.install(path)
Creates a package.py and the package is then available to resolves before any data has been written to the payload. It also does not create .building{version} tag in the repo to make it invisible to resolves till building is done.

I suggest changing this to be more in line with how a build process builds a package by calling repository.pre_variant_install(variant.resource) and only variant.install once the package has data in the payload

Also a build process uses repository.get_package_payload_path() to get the variant.base

Environment

  • Rez version ("3.4.0")
  • Rez python version ("3.11")

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI related issuesbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions