-
Notifications
You must be signed in to change notification settings - Fork 157
Multiple tags on HEAD cause Deploy step failure #1623
Description
I suspect I've encountered a minor, hard-to-evoke bug in the Deploy step of the upload pipeline in this repo.
This line retrieves tag names pointing to the HEAD, and two lines later uses what it got, unquoted.
export EXT_VERSION=`git tag --points-at HEAD`
export EXT_VERSION=${EXT_VERSION:=`git log -1 --format=%h`}
${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}My repo, and that may be a me issue, had two tags pointing to the HEAD when I submitted my extension (v0.1.0-rc2 and v0.1.0).
That led to it failing with this cryptic error.
./duckdb/scripts/extension-upload-single.sh: line 34: false/nsv.duckdb_extension.append: No such file or directory
After looking into it, I'm mostly sure it's due to the two tags shifting the remaining arguments and invoking the deploy script with something absurd.
I've changed my PR to use ref pointing to a commit with no tags, so hopefully the fallback on line 146 would kick in (can't be sure until rerun happens).
The specific error message I've got seems to be from the extension-upload-single.sh picking up eighth argument, if present.
if [ -z "$8" ]; then
BASE_EXT_DIR="/tmp/extension"
else
BASE_EXT_DIR="$8"
fi
if [[ $4 == wasm* ]]; then
ext="$BASE_EXT_DIR/$1.duckdb_extension.wasm"
else
ext="$BASE_EXT_DIR/$1.duckdb_extension"
fi
script_dir="$(dirname "$(readlink -f "$0")")"
# calculate SHA256 hash of extension binary
cat $ext > $ext.appendThat, in my case, resolved to false, the 7th argument, shifted by one.