debug(do-not-merge): instrument the ninja invocation and the Windows … #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: debug-win (do not merge) | |
| # Publishes a Windows-only, instrumented mcpp under a throwaway prerelease tag | |
| # so mcpp-index's probe PR can pin it and reproduce the exit-127 failure of the | |
| # ffmpeg member with full tracing. Deliberately narrow: one platform, no | |
| # mirroring, no ecosystem steps, no smoke matrix. | |
| # | |
| # Delete this workflow and its branch once mcpp#... is understood. | |
| on: | |
| push: | |
| branches: [ 'debug/win127-instrumentation' ] | |
| workflow_dispatch: | |
| env: | |
| DBG_VERSION: 0.0.107-dbg | |
| DBG_TAG: v0.0.107-dbg | |
| jobs: | |
| windows: | |
| name: build instrumented mcpp (Windows / x86_64) | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 45 | |
| env: | |
| MCPP_HOME: C:\Users\runneradmin\.mcpp | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache mcpp sandbox | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~\.mcpp | |
| key: mcpp-sandbox-${{ runner.os }}-debugwin-${{ hashFiles('mcpp.toml', '.xlings.json') }} | |
| restore-keys: | | |
| mcpp-sandbox-${{ runner.os }}-debugwin- | |
| - name: Cache xlings | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~\.xlings | |
| key: xlings-${{ runner.os }}-debugwin-${{ hashFiles('.xlings.json') }} | |
| restore-keys: | | |
| xlings-${{ runner.os }}-debugwin- | |
| - name: Bootstrap mcpp via xlings | |
| shell: bash | |
| env: | |
| XLINGS_NON_INTERACTIVE: '1' | |
| XLINGS_VERSION: '0.4.69' | |
| run: | | |
| WORK=$(mktemp -d) | |
| zipfile="xlings-${XLINGS_VERSION}-windows-x86_64.zip" | |
| curl -fsSL -o "${WORK}/${zipfile}" \ | |
| "https://github.com/openxlings/xlings/releases/download/v${XLINGS_VERSION}/${zipfile}" | |
| cd "${WORK}" | |
| unzip -q "${zipfile}" | |
| "$WORK/xlings-${XLINGS_VERSION}-windows-x86_64/subos/default/bin/xlings.exe" self install | |
| export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH" | |
| echo "$USERPROFILE/.xlings/subos/default/bin" >> "$GITHUB_PATH" | |
| xlings.exe install mcpp -y | |
| MCPP=$(find "$USERPROFILE/.xlings" -name "mcpp.exe" -path "*/bin/*" 2>/dev/null | head -1) | |
| test -n "$MCPP" || { echo "FAIL: mcpp not found after xlings install"; exit 1; } | |
| "$MCPP" --version | |
| echo "MCPP=$MCPP" >> "$GITHUB_ENV" | |
| echo "XLINGS_BIN=$(cygpath -w "$USERPROFILE/.xlings/subos/default/bin/xlings.exe")" >> "$GITHUB_ENV" | |
| echo "XLINGS_BIN_UNIX=$USERPROFILE/.xlings/subos/default/bin/xlings.exe" >> "$GITHUB_ENV" | |
| - name: Build instrumented mcpp from source | |
| shell: bash | |
| run: | | |
| export MCPP_VENDORED_XLINGS="$XLINGS_BIN" | |
| "$MCPP" build | |
| # Newest by mtime — target/ comes back from cache with one directory | |
| # per fingerprint, and `find | head -1` has already shipped the wrong | |
| # binary once (a 0.0.106 build running the 0.0.105 exe). | |
| MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \ | |
| | sort -rn | head -1 | cut -d" " -f2-) | |
| test -n "$MCPP_BIN" || { echo "FAIL: no mcpp.exe in target/"; exit 1; } | |
| MCPP_BIN=$(cd "$(dirname "$MCPP_BIN")" && pwd)/$(basename "$MCPP_BIN") | |
| "$MCPP_BIN" --version | |
| echo "MCPP_BIN=$MCPP_BIN" >> "$GITHUB_ENV" | |
| - name: Package as the release layout mcpp-index expects | |
| shell: bash | |
| run: | | |
| WRAPPER="mcpp-${DBG_VERSION}-windows-x86_64" | |
| STAGING=$(mktemp -d) | |
| mkdir -p "$STAGING/$WRAPPER/bin" "$STAGING/$WRAPPER/registry/bin" | |
| cp "$MCPP_BIN" "$STAGING/$WRAPPER/bin/mcpp.exe" | |
| printf '@echo off\r\n"%%~dp0bin\\mcpp.exe" %%*\r\n' > "$STAGING/$WRAPPER/mcpp.bat" | |
| cp "$XLINGS_BIN_UNIX" "$STAGING/$WRAPPER/registry/bin/xlings.exe" | |
| mkdir -p dist | |
| (cd "$STAGING" && 7z a -tzip "${WRAPPER}.zip" "$WRAPPER") | |
| cp "$STAGING/${WRAPPER}.zip" "dist/${WRAPPER}.zip" | |
| (cd dist && sha256sum "${WRAPPER}.zip" > "${WRAPPER}.zip.sha256") | |
| ls -la dist/ | |
| - name: Publish to the throwaway prerelease tag | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.DBG_TAG }} | |
| name: ${{ env.DBG_TAG }} (debug build — do not use) | |
| prerelease: true | |
| body: | | |
| Instrumented Windows build for diagnosing the mcpp-index exit-127 | |
| failure on the ffmpeg member. Not a real release; delete when done. | |
| files: | | |
| dist/mcpp-${{ env.DBG_VERSION }}-windows-x86_64.zip | |
| dist/mcpp-${{ env.DBG_VERSION }}-windows-x86_64.zip.sha256 |