Skip to content

Commit 67aee7e

Browse files
CI: mcpp built from MCPP_SOURCE_REF builds itself with the release its .xlings.json pins
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 5ed7154 commit 67aee7e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/actions/setup-mcpp/action.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ runs:
5858
sleep 30
5959
done
6060
mcpp toolchain default "llvm@$LLVM_VERSION"
61-
# MCPP_SOURCE_REF: mcpp built from that ref by the release installed above, before the ref is
62-
# released; the program is kept per commit and system, and put first on PATH.
61+
# MCPP_SOURCE_REF: mcpp built from that ref, before the ref is released; the program is kept per
62+
# commit and system, and put first on PATH.
6363
- name: Resolve MCPP_SOURCE_REF
6464
id: source
6565
if: env.MCPP_SOURCE_REF != ''
@@ -93,7 +93,13 @@ runs:
9393
git init -q "$src"
9494
git -C "$src" fetch -q --depth 1 https://github.com/mcpp-community/mcpp.git "$SHA"
9595
git -C "$src" checkout -q FETCH_HEAD
96-
(cd "$src" && mcpp build)
96+
# mcpp builds itself with the release its .xlings.json pins (xlings sets the project up).
97+
for attempt in 1 2 3; do
98+
if (cd "$src" && xlings install -y); then break; fi
99+
[ "$attempt" = 3 ] && { echo "::error::the mcpp $MCPP_SOURCE_REF pins could not be installed"; exit 1; }
100+
sleep 30
101+
done
102+
(cd "$src" && mcpp --version && mcpp build)
97103
built="$(find "$src/target" -type f -name "$exe" -path '*/bin/*' ! -path '*/dist/*' | head -1)"
98104
[ -n "$built" ] || { echo "::error::building mcpp at $MCPP_SOURCE_REF left no $exe"; exit 1; }
99105
mkdir -p "$bin"

0 commit comments

Comments
 (0)