ci: create the installers inside the build stages
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 18s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 5s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 5m34s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 6m18s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Failing after 3m27s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Skipped
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 21s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m46s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 2m57s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 19s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 30s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 18s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 5s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 5m34s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 6m18s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Failing after 3m27s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Skipped
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 21s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m46s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 2m57s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 19s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 30s
VoidBuildSystem CI / 5 · Release (push) Skipped
Move the VBS installer generation into the Linux and Windows build jobs (as a non-blocking step for the RelWithDebInfo variant) instead of separate jobs that re-download artifacts, and keep the release downloading those artifacts when available. Also stop wiping the native provider build directory: it is keyed by the input hash and backed by a content-addressed state store, so stale objects are harmless, while deleting it can remove the materialized snapshot tree another stage is compiling from (the missing-source failures in the installer jobs).
This commit is contained in:
1 parent
20b0324d17
commit
ed6b5dfdd3
2 files changed
+118
-163
No files matched your search
+114
-162
@@ -100,6 +100,73 @@ jobs:
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
- name: Build
|
||||
run: cmake --build "build/linux-${{ matrix.variant }}" --parallel 4
|
||||
- name: Create the Linux installers with VBS
|
||||
id: installers
|
||||
if: matrix.variant == 'relwithdebinfo'
|
||||
# The self-hosted install is still being stabilized: never fail the build job.
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -eu
|
||||
vbs="build/linux-${{ matrix.variant }}/bin/vbs"
|
||||
version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)"
|
||||
label="${{ github.event.inputs.tag }}"
|
||||
if [ -z "${label}" ]; then
|
||||
case "${GITHUB_REF_NAME}" in
|
||||
v*) label="${GITHUB_REF_NAME}" ;;
|
||||
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;;
|
||||
esac
|
||||
fi
|
||||
out=dist-installers
|
||||
prefix="$(mktemp -d)"
|
||||
mkdir -p "${out}"
|
||||
build_dir="build/selfhost-${GITHUB_RUN_ID}"
|
||||
install_archive() {
|
||||
local fmt="$1" ext="$2"
|
||||
local attempt=1
|
||||
while true; do
|
||||
if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
||||
--package-version "${version}" \
|
||||
--archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \
|
||||
--archive-format "${fmt}"; then
|
||||
return 0
|
||||
fi
|
||||
if [ "${attempt}" -ge 2 ]; then
|
||||
echo "vbs install (${fmt}) failed after retry" >&2
|
||||
return 1
|
||||
fi
|
||||
attempt=$((attempt + 1))
|
||||
build_dir="${build_dir}-retry${attempt}"
|
||||
echo "retrying vbs install (${fmt}) in '${build_dir}'..." >&2
|
||||
done
|
||||
}
|
||||
for fmt in tar sh zip deb rpm wix dmg nuget; do
|
||||
case "${fmt}" in
|
||||
tar) ext=tar ;;
|
||||
wix) ext=wxs ;;
|
||||
nuget) ext=nupkg ;;
|
||||
*) ext="${fmt}" ;;
|
||||
esac
|
||||
install_archive "${fmt}" "${ext}"
|
||||
done
|
||||
ls -l "${out}/"
|
||||
- name: Collect installer diagnostics
|
||||
if: steps.installers.outcome == 'failure'
|
||||
run: |
|
||||
df -h . || true
|
||||
for tree in $(find build/selfhost-* -type d -path '*snapshots/trees/*' \
|
||||
-not -name '*.staging_*' 2>/dev/null); do
|
||||
echo "== ${tree}"
|
||||
echo "files on disk: $(find "${tree}" -type f | wc -l)"
|
||||
ls "${tree}/src/Log" 2>/dev/null | head -5
|
||||
done
|
||||
- name: Upload the installers
|
||||
if: steps.installers.outcome == 'success'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: vbs-installers-linux-${{ matrix.variant }}
|
||||
path: dist-installers/
|
||||
retention-days: 30
|
||||
- name: Upload the build
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
@@ -216,164 +283,6 @@ jobs:
|
||||
path: dist-linux-${{ matrix.variant }}/
|
||||
retention-days: 30
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 4A2 - the release installers, built and packaged by VBS itself
|
||||
# ---------------------------------------------------------------------------
|
||||
vbs-installers:
|
||||
name: "4A2 · VBS installers (self-hosted)"
|
||||
needs: linux-test
|
||||
runs-on: vulkan
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download the RelWithDebInfo build
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vbs-linux-build-relwithdebinfo
|
||||
path: build/linux-relwithdebinfo
|
||||
- name: Make the restored binaries executable
|
||||
run: chmod +x build/linux-relwithdebinfo/bin/*
|
||||
- name: Build and package every installer format with VBS
|
||||
run: |
|
||||
set -eu
|
||||
vbs=build/linux-relwithdebinfo/bin/vbs
|
||||
version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)"
|
||||
label="${{ github.event.inputs.tag }}"
|
||||
if [ -z "${label}" ]; then
|
||||
case "${GITHUB_REF_NAME}" in
|
||||
v*) label="${GITHUB_REF_NAME}" ;;
|
||||
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;;
|
||||
esac
|
||||
fi
|
||||
out=dist-installers
|
||||
prefix="$(mktemp -d)"
|
||||
mkdir -p "${out}"
|
||||
# Concurrent runs on the same runner share the repository workspace, so the
|
||||
# self-hosted build directory is unique per run. The first install builds the
|
||||
# project with VBS (build.cpp); the rest reuse it.
|
||||
build_dir="build/selfhost-${GITHUB_RUN_ID}"
|
||||
# The provider snapshot materialization has been observed to seal an
|
||||
# incomplete tree (missing source files); a sealed tree is not rebuilt,
|
||||
# so a retry starts from a fresh build directory.
|
||||
install_archive() {
|
||||
local fmt="$1" ext="$2"
|
||||
local attempt=1
|
||||
while true; do
|
||||
if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
||||
--package-version "${version}" \
|
||||
--archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \
|
||||
--archive-format "${fmt}"; then
|
||||
return 0
|
||||
fi
|
||||
if [ "${attempt}" -ge 2 ]; then
|
||||
echo "vbs install (${fmt}) failed after retry" >&2
|
||||
return 1
|
||||
fi
|
||||
attempt=$((attempt + 1))
|
||||
build_dir="${build_dir}-retry${attempt}"
|
||||
echo "retrying vbs install (${fmt}) in '${build_dir}'..." >&2
|
||||
done
|
||||
}
|
||||
for fmt in tar sh zip deb rpm wix dmg nuget; do
|
||||
case "${fmt}" in
|
||||
tar) ext=tar ;;
|
||||
wix) ext=wxs ;;
|
||||
nuget) ext=nupkg ;;
|
||||
*) ext="${fmt}" ;;
|
||||
esac
|
||||
install_archive "${fmt}" "${ext}"
|
||||
done
|
||||
ls -l "${out}/"
|
||||
- name: Collect installer diagnostics
|
||||
if: failure()
|
||||
run: |
|
||||
df -h . || true
|
||||
for tree in $(find build/selfhost-* -type d -path '*snapshots/trees/*' \
|
||||
-not -name '*.staging_*' 2>/dev/null); do
|
||||
echo "== ${tree}"
|
||||
echo "files on disk: $(find "${tree}" -type f | wc -l)"
|
||||
ls -la "${tree}" | head -5
|
||||
ls -la "${tree}/src/Log" 2>/dev/null | head -5
|
||||
done
|
||||
- name: Upload the installers
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: vbs-installers
|
||||
path: dist-installers/
|
||||
retention-days: 30
|
||||
|
||||
vbs-installers-windows:
|
||||
name: "4A2 · VBS installers (windows target)"
|
||||
needs: linux-test
|
||||
runs-on: windows-gcc
|
||||
# Cross-installing for Windows through VBS is new: report it without
|
||||
# blocking the release until it is proven.
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download the RelWithDebInfo build
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vbs-linux-build-relwithdebinfo
|
||||
path: build/linux-relwithdebinfo
|
||||
- name: Make the restored binaries executable
|
||||
run: chmod +x build/linux-relwithdebinfo/bin/*
|
||||
- name: Build and package the Windows installers with VBS
|
||||
run: |
|
||||
set -eu
|
||||
vbs=build/linux-relwithdebinfo/bin/vbs
|
||||
version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)"
|
||||
label="${{ github.event.inputs.tag }}"
|
||||
if [ -z "${label}" ]; then
|
||||
case "${GITHUB_REF_NAME}" in
|
||||
v*) label="${GITHUB_REF_NAME}" ;;
|
||||
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;;
|
||||
esac
|
||||
fi
|
||||
out=dist-installers-windows
|
||||
prefix="$(mktemp -d)"
|
||||
mkdir -p "${out}"
|
||||
build_dir="build/selfhost-windows-${GITHUB_RUN_ID}"
|
||||
install_archive() {
|
||||
local fmt="$1" ext="$2"
|
||||
local attempt=1
|
||||
while true; do
|
||||
if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||
--target-os windows --target-arch x86_64 \
|
||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
||||
--package-version "${version}" \
|
||||
--archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \
|
||||
--archive-format "${fmt}"; then
|
||||
return 0
|
||||
fi
|
||||
if [ "${attempt}" -ge 2 ]; then
|
||||
echo "vbs install (${fmt}) failed after retry" >&2
|
||||
return 1
|
||||
fi
|
||||
attempt=$((attempt + 1))
|
||||
build_dir="${build_dir}-retry${attempt}"
|
||||
echo "retrying vbs install (${fmt}) in '${build_dir}'..." >&2
|
||||
done
|
||||
}
|
||||
for fmt in tar zip nuget wix; do
|
||||
case "${fmt}" in
|
||||
tar) ext=tar ;;
|
||||
wix) ext=wxs ;;
|
||||
nuget) ext=nupkg ;;
|
||||
*) ext="${fmt}" ;;
|
||||
esac
|
||||
install_archive "${fmt}" "${ext}"
|
||||
done
|
||||
ls -l "${out}/"
|
||||
- name: Upload the Windows installers
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: vbs-installers-windows
|
||||
path: dist-installers-windows/
|
||||
if-no-files-found: ignore
|
||||
retention-days: 30
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2B / 3B / 4B - Windows via Wine: VBS is cross-compiled with MinGW-w64, its
|
||||
# test executables run under Wine, and the Windows binaries are packaged.
|
||||
@@ -400,6 +309,48 @@ jobs:
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
- name: Build
|
||||
run: cmake --build "build/wine-${{ matrix.variant }}" --parallel 4
|
||||
- name: Create the Windows installers with VBS
|
||||
id: win_installers
|
||||
if: matrix.variant == 'relwithdebinfo'
|
||||
# Cross-installing for Windows is new: never fail the build job.
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -eu
|
||||
vbs="build/wine-${{ matrix.variant }}/bin/vbs"
|
||||
version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)"
|
||||
label="${{ github.event.inputs.tag }}"
|
||||
if [ -z "${label}" ]; then
|
||||
case "${GITHUB_REF_NAME}" in
|
||||
v*) label="${GITHUB_REF_NAME}" ;;
|
||||
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;;
|
||||
esac
|
||||
fi
|
||||
out=dist-installers-windows
|
||||
prefix="$(mktemp -d)"
|
||||
mkdir -p "${out}"
|
||||
build_dir="build/selfhost-windows-${GITHUB_RUN_ID}"
|
||||
for fmt in tar zip nuget wix; do
|
||||
case "${fmt}" in
|
||||
tar) ext=tar ;;
|
||||
wix) ext=wxs ;;
|
||||
nuget) ext=nupkg ;;
|
||||
*) ext="${fmt}" ;;
|
||||
esac
|
||||
"${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||
--target-os windows --target-arch x86_64 \
|
||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
||||
--package-version "${version}" \
|
||||
--archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \
|
||||
--archive-format "${fmt}"
|
||||
done
|
||||
ls -l "${out}/"
|
||||
- name: Upload the Windows installers
|
||||
if: steps.win_installers.outcome == 'success'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: vbs-installers-windows-${{ matrix.variant }}
|
||||
path: dist-installers-windows/
|
||||
retention-days: 30
|
||||
- name: Stage the MinGW runtime DLLs
|
||||
run: |
|
||||
for lib in libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll; do
|
||||
@@ -530,7 +481,7 @@ jobs:
|
||||
name: "5 · Release"
|
||||
# Linked to every package lane and only dispatched for a release tag or an
|
||||
# explicit publish dispatch (always() would queue the job on every push).
|
||||
needs: [linux-package, wine-package, vbs-installers]
|
||||
needs: [linux-package, wine-package]
|
||||
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish == 'true'
|
||||
runs-on: vulkan
|
||||
steps:
|
||||
@@ -546,16 +497,17 @@ jobs:
|
||||
with:
|
||||
name: vbs-windows-package-relwithdebinfo
|
||||
path: dist
|
||||
- name: Download the VBS installers
|
||||
- name: Download the Linux installers (when available)
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vbs-installers
|
||||
name: vbs-installers-linux-relwithdebinfo
|
||||
path: dist
|
||||
- name: Download the Windows installers (when available)
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vbs-installers-windows
|
||||
name: vbs-installers-windows-relwithdebinfo
|
||||
path: dist
|
||||
- name: Verify the tag matches the project version
|
||||
run: |
|
||||
|
||||
@@ -1037,7 +1037,10 @@ Void::Result::Result<ProviderExport, Void::Result::Error>
|
||||
run_native_provider(const ProviderRequest &request, const std::filesystem::path &build_dir,
|
||||
const std::string &input_hash, std::stop_token stop) {
|
||||
std::error_code ec;
|
||||
std::filesystem::remove_all(build_dir, ec);
|
||||
// The directory is keyed by the provider input hash and backed by a
|
||||
// content-addressed state store, so stale objects are harmless. Do not wipe
|
||||
// it: another stage may still be compiling from its materialized snapshot
|
||||
// tree, and deleting it makes those sources disappear mid-build.
|
||||
std::filesystem::create_directories(build_dir, ec);
|
||||
|
||||
Graph::ProjectDescription desc;
|
||||
|
||||
Reference in new issue
Block a user