fix(release): use rust target (not glibc-versioned) for binary copy path
The aarch64 deepseek build in release.yml run 25329602631 succeeded in
4m 53s but the rename step failed:
cp: cannot stat 'target/aarch64-unknown-linux-gnu.2.28/release/deepseek'
cargo zigbuild parses `aarch64-unknown-linux-gnu.2.28` by passing
`aarch64-unknown-linux-gnu` to cargo and the `.2.28` glibc minimum to
zig's CC. The cargo target output dir is therefore
`target/aarch64-unknown-linux-gnu/release/`, never the
glibc-versioned form.
v0.8.9 release.yml hard-coded the rust triple in the rename step and
worked. v0.8.10 added `target_zig: <triple>.<glibc>` to the matrix and
switched the rename step to `${{ matrix.target_zig || matrix.target }}`,
which silently became wrong for every zigbuild matrix leg.
This commit:
- Always uses `matrix.target` (rust triple) for the copy source path.
- Adds a defensive `find target -name "${binary}"` debug listing if
the expected binary isn't at the rust-target path, so future
cargo-zigbuild output-dir changes are visible in the build log
rather than just "No such file".
This commit is contained in:
@@ -130,8 +130,16 @@ jobs:
|
||||
- name: Rename binary
|
||||
shell: bash
|
||||
run: |
|
||||
TARGET_DIR="${{ matrix.target_zig || matrix.target }}"
|
||||
cp "target/${TARGET_DIR}/release/${{ matrix.binary }}" ${{ matrix.artifact_name }}
|
||||
# cargo zigbuild writes binaries to target/<rust-target>/release/ —
|
||||
# the .glibc suffix in matrix.target_zig is consumed by zig as a CC
|
||||
# flag, not by cargo as a target dir. Always use the rust target.
|
||||
BIN_PATH="target/${{ matrix.target }}/release/${{ matrix.binary }}"
|
||||
if [ ! -f "${BIN_PATH}" ]; then
|
||||
echo "Binary not at ${BIN_PATH}; searching target/ for ${{ matrix.binary }}:"
|
||||
find target -name "${{ matrix.binary }}" -type f
|
||||
exit 1
|
||||
fi
|
||||
cp "${BIN_PATH}" "${{ matrix.artifact_name }}"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
|
||||
Reference in New Issue
Block a user