fix: stop packaging tarball inside dist#138
Conversation
There was a problem hiding this comment.
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_BASENAMEvariable - 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.
|
|
||
| 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/ |
There was a problem hiding this comment.
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.
| 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/ |
There was a problem hiding this comment.
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.
📊 Coverage Report
View detailed reportGenerated by cargo-tarpaulin |
Summary
dist/staging directory to avoid tar re-reading its own outputdist/after creation while preserving Windows/macOS branchingTesting