Skip to content

fix: stop packaging tarball inside dist#138

Merged
behrangsa merged 1 commit intomasterfrom
fix/release-packaging
Sep 24, 2025
Merged

fix: stop packaging tarball inside dist#138
behrangsa merged 1 commit intomasterfrom
fix/release-packaging

Conversation

@behrangsa
Copy link
Contributor

Summary

  • package release archives outside the dist/ staging directory to avoid tar re-reading its own output
  • move the archive and checksum back into dist/ after creation while preserving Windows/macOS branching

Testing

  • cargo fmt --check
  • cargo clippy --all-targets --all-features
  • cargo test -- --test-threads=1
  • simulated packaging script locally (Linux target) with new logic; tar now succeeds

Copilot AI review requested due to automatic review settings September 24, 2025 22:03
@behrangsa behrangsa merged commit 5aa138c into master Sep 24, 2025
6 checks passed
@behrangsa behrangsa deleted the fix/release-packaging branch September 24, 2025 22:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a packaging issue where tar was attempting to read its own output by creating archives outside the dist/ directory and then moving them back in. The change prevents tar from recursively processing its own output file during archive creation.

  • Moves archive creation outside the dist/ directory to avoid tar self-reference
  • Unifies archive naming logic with a common ARCHIVE_BASENAME variable
  • Preserves platform-specific branching for Windows/macOS while consolidating the workflow

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 253 to +262

cd dist
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
shasum -a 256 "${ARCHIVE_NAME}"* > "${ARCHIVE_NAME}.sha256"
shasum -a 256 "../${ARCHIVE_BASENAME}" > "../${ARCHIVE_NAME}.sha256"
else
sha256sum "${ARCHIVE_NAME}"* > "${ARCHIVE_NAME}.sha256"
sha256sum "../${ARCHIVE_BASENAME}" > "../${ARCHIVE_NAME}.sha256"
fi
popd >/dev/null

mv "${ARCHIVE_BASENAME}" dist/
mv "${ARCHIVE_NAME}.sha256" dist/
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checksum files are created with relative paths ../ in their content, which will show incorrect paths when the files are moved to the dist/ directory. The checksum should contain just the archive filename without the relative path prefix.

Copilot uses AI. Check for mistakes.
Comment on lines 254 to +262
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
shasum -a 256 "${ARCHIVE_NAME}"* > "${ARCHIVE_NAME}.sha256"
shasum -a 256 "../${ARCHIVE_BASENAME}" > "../${ARCHIVE_NAME}.sha256"
else
sha256sum "${ARCHIVE_NAME}"* > "${ARCHIVE_NAME}.sha256"
sha256sum "../${ARCHIVE_BASENAME}" > "../${ARCHIVE_NAME}.sha256"
fi
popd >/dev/null

mv "${ARCHIVE_BASENAME}" dist/
mv "${ARCHIVE_NAME}.sha256" dist/
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checksum files are created with relative paths ../ in their content, which will show incorrect paths when the files are moved to the dist/ directory. The checksum should contain just the archive filename without the relative path prefix.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

📊 Coverage Report

Metric Covered Total Rate
Lines 131 146 89.73%
Branches 0 0 N/A
Additional Metric Value
Complexity 0
Files Reported 1
Report Timestamp 2025-09-24T22:06:34.000Z
View detailed report
src/main.rs: 89.7%

Generated by cargo-tarpaulin

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

Successfully merging this pull request may close these issues.

2 participants