Skip to content

Preserve existing release archives when replacement packaging fails #141

Closed

Description

@LunaStev

Problem

x.py — create_archive and package_targets unlinks an existing release archive before writing its replacement directly to the final path. A creation failure destroys the previous archive.

If create_archive raises before returning, package_targets still has archive = None, so its failure handler also leaves the partial final file behind.

Reproduction

Create a staging directory containing a dummy vex file and put known bytes at its existing .tar.gz destination. Call create_archive for a Linux target with epoch 2**32.

The gzip timestamp write raises an out-of-range error and the old destination becomes a four-byte partial gzip header. source_date_epoch currently accepts that non-negative value. Archive-write failures have the same preservation problem.

Acceptance criteria

  • Write a replacement to a unique temporary sibling of the final archive.
  • Complete archive creation and verification before replacing the final destination.
  • Preserve an existing archive byte-for-byte on write or verification failure, and leave no final partial archive on a failed first package.
  • Remove temporary output on handled failure.
  • Add isolated tests/xpy regressions for tar.gz and ZIP write failures, verification failure, and successful replacement.
  • Preserve archive names and reproducible contents.

Difficulty: medium. Limit this task to publication of an individual package archive; checksum aggregation and release-tag policy are separate.

Activity

  1. added
    bug
    help wanted
    release
    tooling
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wantedreleasetooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions