Skip to content

fix(deploy): strip-components=1 for cargo-dist archive extraction - #147

Merged
ferhimedamine merged 1 commit into
mainfrom
fix/deploy-binary-extract-path
Sep 3, 2026
Merged

fix(deploy): strip-components=1 for cargo-dist archive extraction#147
ferhimedamine merged 1 commit into
mainfrom
fix/deploy-binary-extract-path

Conversation

@ferhimedamine

Copy link
Copy Markdown
Contributor

Problem

Deploy Binary workflow fails with chmod: cannot access 'dk': No such file or directory when extracting from dk-x86_64-unknown-linux-gnu.tar.gz.

cargo-dist wraps the binary in a top-level directory (dk-x86_64-unknown-linux-gnu/dk), not at archive root. The extract step was missing --strip-components=1.

Root Cause

Broke in v0.7.1 after PR#126 renamed artifacts from dakera-cli-*.tar.xzdk-*.tar.gz. The old .tar.xz format also had a subdirectory, but this wasn't tested.

Fix

-tar -xzf dk-x86_64-unknown-linux-gnu.tar.gz
+tar -xzf dk-x86_64-unknown-linux-gnu.tar.gz --strip-components=1

Verification

Confirmed locally:

dk-x86_64-unknown-linux-gnu/
dk-x86_64-unknown-linux-gnu/README.md
dk-x86_64-unknown-linux-gnu/dk     ← binary here
dk-x86_64-unknown-linux-gnu/CHANGELOG.md

With --strip-components=1, dk lands at root and chmod +x dk succeeds.

Follow-up

After merge, manually re-run the Deploy Binary workflow on v0.7.1 release to complete the binary deployment.

cargo-dist archives dk-{target}.tar.gz with a top-level subdirectory
dk-{target}/ — the binary is at dk-{target}/dk, not at root.
Add --strip-components=1 so `chmod +x dk` finds the binary.

Broke in v0.7.1 when artifact names changed from dakera-cli-*.tar.xz
to dk-*.tar.gz (PR#126).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@ferhimedamine
ferhimedamine merged commit 1410fd3 into main Sep 3, 2026
12 checks passed
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.

1 participant