Remove package sources and host only the expected SHA-256 (#3)
Some checks failed
sgraves/cpp-build-system_mac/pipeline/head There was a failure building this commit
sgraves/cpp-build-system/pipeline/head There was a failure building this commit
sgraves/cpp-build-system_msys2/pipeline/head There was a failure building this commit

Reviewed-on: #3
Co-authored-by: Scott E. Graves <scott.e.graves@protonmail.com>
Co-committed-by: Scott E. Graves <scott.e.graves@protonmail.com>
This commit was merged in pull request #3.
This commit is contained in:
2025-12-13 09:35:33 -06:00
committed by sgraves76
parent 5cf3d1661b
commit ba5f4d1625
73 changed files with 496 additions and 209 deletions

View File

@@ -27,6 +27,7 @@ cstdint
cxxflags cxxflags
cxxopts_project cxxopts_project
cxxstd cxxstd
cygpath
d_largefile64_source d_largefile64_source
d_largefile_source d_largefile_source
d_ndebug d_ndebug
@@ -160,6 +161,7 @@ msvc
msvcr120 msvcr120
msvcr90 msvcr90
mswsock mswsock
msys2
mtune mtune
mwindows mwindows
nana nana

7
.gitignore vendored
View File

@@ -11,3 +11,10 @@ scripts/cleanup.sh
support/Dockerfile support/Dockerfile
version.cpp version.cpp
version.rc version.rc
.DS_Store
*.gz
*.bz2
*.xz
*.zip
*.msi
*.exe

View File

@@ -37,6 +37,12 @@ pipeline {
} }
} }
stage('clean_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'clean_packages.sh' } } }
}
stage('grab_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'grab_packages.sh' } } }
}
stage('win32_shared') { stage('win32_shared') {
steps { script { retryWithBackoff(2, 5) { sh 'scripts/test_win32.sh shared' } } } steps { script { retryWithBackoff(2, 5) { sh 'scripts/test_win32.sh shared' } } }
} }

View File

@@ -36,6 +36,12 @@ pipeline {
} }
} }
stage('clean_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'clean_packages.sh' } } }
}
stage('grab_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'grab_packages.sh' } } }
}
stage('macos_aarch64_shared') { stage('macos_aarch64_shared') {
steps { steps {
script { retryWithBackoff(2, 5) { sh 'scripts/test_unix.sh shared' } } script { retryWithBackoff(2, 5) { sh 'scripts/test_unix.sh shared' } }

103
.jenkins_msys2 Normal file
View File

@@ -0,0 +1,103 @@
#!groovy
pipeline {
agent none
environment {
PROJECT_TEST_CONFIG_DIR = "C:\\.ci\\cpp_build_system\\test"
}
options {
disableConcurrentBuilds()
skipDefaultCheckout()
timestamps()
}
stages {
stage('msys2 x86_64') {
agent any
stages {
stage('Checkout') {
steps {
script {
int maxAttempts = 6
int baseDelay = 10
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
try {
checkout scm
break
} catch (err) {
if (attempt == maxAttempts) { throw err }
int waitSec = baseDelay * (1 << (attempt - 1))
echo "Checkout failed (attempt ${attempt}/${maxAttempts}). Waiting ${waitSec}s before retry..."
sleep time: waitSec, unit: 'SECONDS'
}
}
}
}
}
stage('clean_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'clean_packages.cmd' } } }
}
stage('grab_packages') {
steps { script { retryWithBackoff(2, 5) { sh 'grab_packages.cmd' } } }
}
stage('msys2_x86_64_shared') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared "" x86_64' } }
}
}
stage('msys2_x86_64_shared_crypto') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 1 x86_64' } }
}
}
stage('msys2_x86_64_shared_crypto_no_boost') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 7 x86_64' } }
}
}
stage('msys2_x86_64_shared_dsm') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 2 x86_64' } }
}
}
stage('msys2_x86_64_shared_sqlite') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 3 x86_64' } }
}
}
stage('msys2_x86_64_shared_errors_v1') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 4 x86_64' } }
}
}
stage('msys2_x86_64_shared_fmt') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 5 x86_64' } }
}
}
stage('msys2_x86_64_shared_libevent') {
steps {
script { retryWithBackoff(2, 5) { bat 'scripts\\test_msys2.cmd shared 6 x86_64' } }
}
}
}
}
}
}
def retryWithBackoff(int maxAttempts, int baseDelaySeconds, Closure body) {
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
try {
body()
return
} catch (err) {
if (attempt == maxAttempts) { throw err }
int waitSec = baseDelaySeconds * (1 << (attempt - 1))
echo "Step failed (attempt ${attempt}/${maxAttempts}). Waiting ${waitSec}s before retry..."
sleep time: waitSec, unit: 'SECONDS'
}
}
}

21
CHANGELOG.md Normal file
View File

@@ -0,0 +1,21 @@
# Changelog
## v1.0.1-release
### Issues
- \#1 Add Windows MSYS2 Jenkins build and testing support
### Changes from v1.0.0-release
- Remove stray "_libevent_" inserted mid-name on macOS x86_64 Jenkins test builds
- Properly handle `alpha.x`, `beta.x` and `rc.x` releases in `deliver.sh`
- Use `cygpath` to format Windows paths for use in MSYS2
---
## v1.0.0-release
- Initial Release
---

View File

@@ -36,13 +36,26 @@ All builds are orchestrated through project scripts — **direct CMake invocatio
## 🚀 Getting Started ## 🚀 Getting Started
### 1⃣ Clone the Build System ### 1⃣ Clone the Build System and Grab Packages
```bash ```bash
git clone https://git.fifthgrid.com/sgraves/cpp-build-system.git git clone https://git.fifthgrid.com/sgraves/cpp-build-system.git
git clone https://github.com/sgraves76/cpp-build-system.git git clone https://github.com/sgraves76/cpp-build-system.git
cd cpp-build-system cd cpp-build-system
``` ```
Run the root-level `grab_packages.sh`/`grab_packages.cmd`
Example:
```bash
./grab_packages.sh
```
```cmd
grab_packages.cmd
```
This will download and validate all packages currently supported by `cpp-build-system`. They will be placed within the `support/3rd_party/` folder.
--- ---
### 2⃣ Create a New Project ### 2⃣ Create a New Project
@@ -52,11 +65,11 @@ Run the root-level `create_project.sh` with:
Example: Example:
```bash ```bash
./create_project.sh MyApp ~/dev ./create_project.sh MyApp ~/src
``` ```
This creates: This creates:
``` ```
~/dev/MyApp/ ~/src/MyApp/
``` ```
The new directory contains: The new directory contains:
@@ -70,7 +83,7 @@ The new directory contains:
### 3⃣ Configure the Project ### 3⃣ Configure the Project
In your new project directory (`~/dev/MyApp/`), edit these two files before your first build: In your new project directory (`~/src/MyApp/`), edit these two files before your first build:
> ⚠️ **Important Notice:** > ⚠️ **Important Notice:**
> Do **not modify** the root `CMakeLists.txt` file in your project. > Do **not modify** the root `CMakeLists.txt` file in your project.
@@ -155,7 +168,7 @@ Use the provided build wrappers — they take two arguments:
If you later want to **add back packages** you previously turned off (and which `cleanup.sh` removed), run the **templates** update script from the `cpp-build-system` repository root, pointing it at your project path: If you later want to **add back packages** you previously turned off (and which `cleanup.sh` removed), run the **templates** update script from the `cpp-build-system` repository root, pointing it at your project path:
```bash ```bash
# from the cpp-build-system repo root # from the cpp-build-system repo root
./update_project.sh ~/dev/MyApp ./update_project.sh ~/src/MyApp
``` ```
This will **restore all template-managed packages and scripts** (including `cleanup.sh`) into your project so you can re-enable dependencies via `config.sh` and rebuild. This will **restore all template-managed packages and scripts** (including `cleanup.sh`) into your project so you can re-enable dependencies via `config.sh` and rebuild.

11
clean_packages.cmd Normal file
View File

@@ -0,0 +1,11 @@
@echo off
setlocal
pushd "%~dp0"
call src\scripts\setup_msys2.cmd
call mingw64 -no-start ./clean_packages.sh
popd
endlocal

21
clean_packages.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
CURRENT_DIR=$(realpath "$0")
CURRENT_DIR=$(dirname "${CURRENT_DIR}")
pushd "${CURRENT_DIR}"
mapfile -t FILE_LIST < <(find support/3rd_party/ -type f \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' -o -name '*.msi' -o -name '*.zip' \))
for NAME in "${FILE_LIST[@]}"; do
echo "Removing ${NAME}"
rm -f "${NAME}"
done
mapfile -t FILE_LIST < <(find support/3rd_party/mingw64/ -type f \( -name '*.exe' \))
for NAME in "${FILE_LIST[@]}"; do
echo "Removing ${NAME}"
rm -f "${NAME}"
done
popd

View File

@@ -2,7 +2,11 @@
setlocal setlocal
pushd "%~dp0%" pushd "%~dp0"
call src\scripts\setup_msys2.cmd call src\scripts\setup_msys2.cmd
call mingw64 -no-start ./create_project.sh "%1" "%2"
for /f "usebackq tokens=*" %%i in (`cygpath "%~2"`) do set ARG1=%%i
call mingw64 -no-start ./create_project.sh "%~1" "%ARG1%"
popd popd
endlocal

View File

@@ -18,6 +18,7 @@ create_versions_cmake
process_file .jenkins_builds process_file .jenkins_builds
process_file .jenkins_macos process_file .jenkins_macos
process_file .jenkins_msys2
process_file .nvimrc process_file .nvimrc
process_file CMakeLists.txt process_file CMakeLists.txt
process_file config.sh process_file config.sh

11
grab_packages.cmd Normal file
View File

@@ -0,0 +1,11 @@
@echo off
setlocal
pushd "%~dp0"
call src\scripts\setup_msys2.cmd
call mingw64 -no-start ./grab_packages.sh
popd
endlocal

View File

@@ -6,66 +6,34 @@ CURRENT_DIR=$(dirname "${CURRENT_DIR}")
. "${CURRENT_DIR}/src/scripts/versions.sh" . "${CURRENT_DIR}/src/scripts/versions.sh"
. "${CURRENT_DIR}/src/scripts/libraries.sh" . "${CURRENT_DIR}/src/scripts/libraries.sh"
function check_should_update() { function download_package() {
local NAME=$1 local NAME=$1
local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ }) local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ })
if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ] || if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ]; then
[ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256" ]; then
return 0
fi
return 1
}
function download_and_update_hash() {
local NAME=$1
local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ })
if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ] ||
[ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256" ]; then
local CLEANUP_LIST=(${PROJECT_CLEANUP[${NAME}]//:/ })
if [ "${NAME}" == "GTEST" ]; then
CLEANUP_LIST=(${PROJECT_CLEANUP["TESTING"]//:/ })
fi
if [ "${NAME}" != "BOOST" ] && [ "${NAME}" != "BOOST2" ] && [ "${CLEANUP_LIST[0]}" != "" ]; then
rm -r ${CURRENT_DIR}/support/${CLEANUP_LIST[0]}
fi
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256"
if ! wget ${ITEM_LIST[0]} -O "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"; then if ! wget ${ITEM_LIST[0]} -O "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"; then
echo "failed $NAME" echo "failed $NAME"
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
exit 1 exit 1
fi fi
pushd "${CURRENT_DIR}/support/${ITEM_LIST[2]}"
sha256sum ${ITEM_LIST[1]} >${ITEM_LIST[1]}.sha256 pushd "${CURRENT_DIR}/support/${ITEM_LIST[2]}/"
if ! sha256sum -c "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256"; then
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
echo "failed sha256 validation: $NAME"
exit 1
fi
popd popd
fi fi
local HASH=$(cat support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256 | awk '{print $1}')
HASH_LIST+=("set(${NAME}_HASH ${HASH})")
} }
function create_hashes_cmake() { function download_packages() {
for NAME in "${!PROJECT_DOWNLOADS[@]}"; do for NAME in "${!PROJECT_DOWNLOADS[@]}"; do
if [ "${NAME}" != "BOOST" ] && [ "${NAME}" != "BOOST2" ]; then download_package $NAME
download_and_update_hash $NAME
fi
done done
} }
pushd "${CURRENT_DIR}" pushd "${CURRENT_DIR}"
HASH_LIST=() download_packages
create_hashes_cmake
if check_should_update BOOST || check_should_update BOOST2; then
rm -f support/3rd_party/boost_*
fi
download_and_update_hash BOOST
download_and_update_hash BOOST2
(printf "%s\n" "${HASH_LIST[@]}" | sort) >${CURRENT_DIR}/cmake/hashes.cmake
popd popd

View File

@@ -52,7 +52,7 @@ elif [ "${WITH_TYPE}" == "7" ]; then
fi fi
if [ "${BUILD_ARCH}" != "" ]; then if [ "${BUILD_ARCH}" != "" ]; then
NAME=${NAME}_libevent_${BUILD_ARCH} NAME=${NAME}_${BUILD_ARCH}
fi fi
rm -rf "${TEST_DIR}/${NAME}" rm -rf "${TEST_DIR}/${NAME}"

74
scripts/create_packages.sh Executable file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
SCRIPTS_DIR=$(dirname "$0")
SCRIPTS_DIR=$(realpath ${SCRIPTS_DIR})
CURRENT_DIR=${SCRIPTS_DIR}/..
CURRENT_DIR=$(realpath "${CURRENT_DIR}")
. "${CURRENT_DIR}/src/scripts/versions.sh"
. "${CURRENT_DIR}/src/scripts/libraries.sh"
function check_should_update() {
local NAME=$1
local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ })
if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ] ||
[ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256" ]; then
return 0
fi
return 1
}
function download_and_update_hash() {
local NAME=$1
local ITEM_LIST=(${PROJECT_DOWNLOADS[${NAME}]//;/ })
if [ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}" ] ||
[ ! -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256" ]; then
local CLEANUP_LIST=(${PROJECT_CLEANUP[${NAME}]//:/ })
if [ "${NAME}" == "GTEST" ]; then
CLEANUP_LIST=(${PROJECT_CLEANUP["TESTING"]//:/ })
fi
if [ "${NAME}" != "BOOST" ] && [ "${NAME}" != "BOOST2" ] && [ "${CLEANUP_LIST[0]}" != "" ]; then
rm -r ${CURRENT_DIR}/support/${CLEANUP_LIST[0]}
fi
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256"
if ! wget ${ITEM_LIST[0]} -O "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"; then
echo "failed $NAME"
rm -f "${CURRENT_DIR}/support/${ITEM_LIST[2]}/${ITEM_LIST[1]}"
exit 1
fi
pushd "${CURRENT_DIR}/support/${ITEM_LIST[2]}"
sha256sum ${ITEM_LIST[1]} >${ITEM_LIST[1]}.sha256
popd
fi
local HASH=$(cat support/${ITEM_LIST[2]}/${ITEM_LIST[1]}.sha256 | awk '{print $1}')
HASH_LIST+=("set(${NAME}_HASH ${HASH})")
}
function create_hashes_cmake() {
for NAME in "${!PROJECT_DOWNLOADS[@]}"; do
if [ "${NAME}" != "BOOST" ] && [ "${NAME}" != "BOOST2" ]; then
download_and_update_hash $NAME
fi
done
}
pushd "${CURRENT_DIR}"
HASH_LIST=()
create_hashes_cmake
if check_should_update BOOST || check_should_update BOOST2; then
rm -f support/3rd_party/boost_*
fi
download_and_update_hash BOOST
download_and_update_hash BOOST2
(printf "%s\n" "${HASH_LIST[@]}" | sort) >${CURRENT_DIR}/cmake/hashes.cmake
popd

82
scripts/test_msys2.cmd Executable file
View File

@@ -0,0 +1,82 @@
@echo off
setlocal EnableExtensions
set "SED=sed"
set "SCRIPTS_DIR=%~dp0"
pushd "%SCRIPTS_DIR%"
set "SCRIPTS_DIR=%CD%"
popd
set "SOURCE_DIR=%~dp0.."
pushd "%SOURCE_DIR%"
set "SOURCE_DIR=%CD%"
popd
set "TEST_DIR=%SOURCE_DIR%\build"
set "PLATFORM=msys2"
set "BUILD_TYPE=%1"
set "WITH_TYPE=%2"
if /I not "%BUILD_TYPE%"=="shared" if /I not "%BUILD_TYPE%"=="static" (
call :ERROR_EXIT "Must specify 'shared' or 'static'." 1
)
if not defined TEST_DIR (
call :ERROR_EXIT "TEST_DIR is not set." 1
)
if not exist "%TEST_DIR%" mkdir "%TEST_DIR%"
set "NAME=%BUILD_TYPE%"
if "%WITH_TYPE%"=="1" set "NAME=%NAME%_crypto"
if "%WITH_TYPE%"=="2" set "NAME=%NAME%_dsm"
if "%WITH_TYPE%"=="3" set "NAME=%NAME%_sqlite"
if "%WITH_TYPE%"=="4" set "NAME=%NAME%_errors_v1"
if "%WITH_TYPE%"=="5" set "NAME=%NAME%_fmt"
if "%WITH_TYPE%"=="6" set "NAME=%NAME%_libevent"
if "%WITH_TYPE%"=="7" set "NAME=%NAME%_crypto_no_boost"
if exist "%TEST_DIR%\%NAME%\" rd /s /q "%TEST_DIR%\%NAME%"
pushd "%SOURCE_DIR%"
call ".\create_project.cmd" "%NAME%" "%TEST_DIR%" || (
call :ERROR_EXIT "Failed to create %PLATFORM% project." 2
)
popd
pushd "%TEST_DIR%\%NAME%"
if "%WITH_TYPE%"=="1" (
%SED% -i "s/PROJECT_ENABLE_LIBSODIUM=OFF/PROJECT_ENABLE_LIBSODIUM=ON/g" ".\config.sh"
%SED% -i "s/PROJECT_ENABLE_BOOST=OFF/PROJECT_ENABLE_BOOST=ON/g" ".\config.sh"
%SED% -i "s/PROJECT_ENABLE_JSON=OFF/PROJECT_ENABLE_JSON=ON/g" ".\config.sh"
)
if "%WITH_TYPE%"=="2" %SED% -i "s/PROJECT_ENABLE_LIBDSM=OFF/PROJECT_ENABLE_LIBDSM=ON/g" ".\config.sh"
if "%WITH_TYPE%"=="3" %SED% -i "s/PROJECT_ENABLE_SQLITE=OFF/PROJECT_ENABLE_SQLITE=ON/g" ".\config.sh"
if "%WITH_TYPE%"=="4" %SED% -i "s/PROJECT_ENABLE_V2_ERRORS=ON/PROJECT_ENABLE_V2_ERRORS=OFF/g" ".\config.sh"
if "%WITH_TYPE%"=="5" %SED% -i "s/PROJECT_ENABLE_FMT=OFF/PROJECT_ENABLE_FMT=ON/g" ".\config.sh"
if "%WITH_TYPE%"=="6" %SED% -i "s/PROJECT_ENABLE_LIBEVENT=OFF/PROJECT_ENABLE_LIBEVENT=ON/g" ".\config.sh"
if "%WITH_TYPE%"=="7" %SED% -i "s/PROJECT_ENABLE_LIBSODIUM=OFF/PROJECT_ENABLE_LIBSODIUM=ON/g" ".\config.sh"
if /I "%BUILD_TYPE%"=="shared" (
%SED% -i "s/PROJECT_STATIC_LINK=ON/PROJECT_STATIC_LINK=OFF/g" ".\config.sh"
)
call .\scripts\make_win32.cmd || (
call :ERROR_EXIT "build %PLATFORM% failed." 3
)
call .\scripts\run_tests.cmd || (
call :ERROR_EXIT "testing %PLATFORM% failed." 3
)
popd
if exist "%TEST_DIR%\%NAME%\" rd /s /q "%TEST_DIR%\%NAME%"
exit 0
:ERROR_EXIT
echo %1
exit %2

77
src/.jenkins_msys2 Normal file
View File

@@ -0,0 +1,77 @@
#!groovy
pipeline {
agent none
environment {
PROJECT_TEST_CONFIG_DIR = "c:\\.ci\\%PROJECT_NAME%\\test"
}
options {
disableConcurrentBuilds()
skipDefaultCheckout()
timestamps()
}
stages {
// stage('Build • Test • Deliver')
stage('Build • Test') {
agent any
stages {
stage('Checkout') {
steps {
script {
int maxAttempts = 6
int baseDelay = 10
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
try {
checkout scm
break
} catch (err) {
if (attempt == maxAttempts) { throw err }
int waitSec = baseDelay * (1 << (attempt - 1))
echo "Checkout failed (attempt ${attempt}/${maxAttempts}). Waiting ${waitSec}s before retry..."
sleep time: waitSec, unit: 'SECONDS'
}
}
}
}
}
stage('msys2_x86_64') {
steps { script { retryWithBackoff(2, 5) { bat 'scripts\\make_win32.cmd x86_64' } } }
}
stage('test') {
steps {
script {
retryWithBackoff(2, 5) { bat 'scripts\\run_tests.cmd x86_64' }
}
}
}
// stage('deliver') {
// steps {
// script {
// retryWithBackoff(3, 10) { bat 'scripts\\deliver.cmd C:\\deliver\\%PROJECT_NAME% "" x86_64' }
// }
// }
// }
}
}
}
}
def retryWithBackoff(int maxAttempts, int baseDelaySeconds, Closure body) {
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
try {
body()
return
} catch (err) {
if (attempt == maxAttempts) { throw err }
int waitSec = baseDelaySeconds * (1 << (attempt - 1))
echo "Step failed (attempt ${attempt}/${maxAttempts}). Waiting ${waitSec}s before retry..."
sleep time: waitSec, unit: 'SECONDS'
}
}
}

View File

@@ -6,6 +6,6 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./cleanup.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call mingw64 -no-start ./cleanup.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0
popd popd

View File

@@ -8,6 +8,6 @@ set ARG1=%~3
set ARG2=%~4 set ARG2=%~4
set ARG3=%~5 set ARG3=%~5
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./deliver.sh "%DEST%" "%DIST%" "%ARG1%" "%ARG2%" "%ARG3%" 1 0 || exit 1 call mingw64 -no-start ./deliver.sh "%DEST%" "%DIST%" "%ARG1%" "%ARG2%" "%ARG3%" 1 0 || exit 1
popd popd

View File

@@ -7,6 +7,11 @@ PROJECT_SCRIPTS_DIR=$(realpath "$0")
PROJECT_SCRIPTS_DIR=$(dirname "${PROJECT_SCRIPTS_DIR}") PROJECT_SCRIPTS_DIR=$(dirname "${PROJECT_SCRIPTS_DIR}")
. "${PROJECT_SCRIPTS_DIR}/env.sh" "$3" "$4" "$5" "$6" "$7" . "${PROJECT_SCRIPTS_DIR}/env.sh" "$3" "$4" "$5" "$6" "$7"
COPY_OPS=-f
if [ "${PROJECT_IS_DARWIN}" == "1" ]; then
COPY_OPS="${COPY_OPS} -X"
fi
function error_exit() { function error_exit() {
echo $1 echo $1
exit $2 exit $2
@@ -38,13 +43,16 @@ BRANCH=$(git branch --show-current)
RELEASE=$(grep PROJECT_RELEASE_ITER= ./config.sh | ${SED} s/PROJECT_RELEASE_ITER=//g) RELEASE=$(grep PROJECT_RELEASE_ITER= ./config.sh | ${SED} s/PROJECT_RELEASE_ITER=//g)
popd popd
if [ "${BRANCH}" == "master" ] || [ "${BRANCH}" == "alpha" ] || if [[ "${BRANCH}" =~ ^(master|main|release)$ ]] ||
[ "${BRANCH}" == "main" ] || [ "${BRANCH}" == "release" ] || [[ "${BRANCH}" =~ ^(alpha|beta|rc)(\.[0-9]+)?$ ]]; then
[ "${BRANCH}" == "beta" ] || [ "${BRANCH}" == "rc" ]; then DEST_DIR="${DEST_DIR}/$([[ "${BRANCH}" =~ ^(master|main|release)$ ]] &&
DEST_DIR=${DEST_DIR}/${RELEASE} printf '%s' "${RELEASE}" ||
elif [[ ${BRANCH} = *'-alpha-'* ]] || [[ ${BRANCH} = *'-beta-'* ]] || printf '%s' "${BRANCH%%.*}")"
[[ ${BRANCH} = *'-rc-'* ]] || [[ ${BRANCH} = *'-release-'* ]]; then elif [[ "${BRANCH}" == *"-alpha-"* ]] || [[ "${BRANCH}" == *"-beta-"* ]] ||
DEST_DIR=${DEST_DIR}/nightly [[ "${BRANCH}" == *"-rc-"* ]] || [[ "${BRANCH}" == *"-release-"* ]] ||
[[ "${BRANCH}" == *"-alpha."* ]] || [[ "${BRANCH}" == *"-beta."* ]] ||
[[ "${BRANCH}" == *"-rc."* ]]; then
DEST_DIR="${DEST_DIR}/nightly"
else else
error_exit "skipping ${PROJECT_FILE_PART}" 0 error_exit "skipping ${PROJECT_FILE_PART}" 0
fi fi
@@ -62,39 +70,39 @@ if [ "${PROJECT_PRIVATE_KEY}" != "" ] && [ ! -f "./${PROJECT_OUT_FILE}.sig" ]; t
error_exit "failed to find file: ${PROJECT_OUT_FILE}.sig" 1 error_exit "failed to find file: ${PROJECT_OUT_FILE}.sig" 1
fi fi
cp -f ./${PROJECT_OUT_FILE} ${DEST_DIR} || cp ${COPY_OPS} ./${PROJECT_OUT_FILE} ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}" 1 error_exit "failed to deliver file: ${PROJECT_OUT_FILE}" 1
cp -f ./${PROJECT_OUT_FILE}.sha256 ${DEST_DIR} || cp ${COPY_OPS} ./${PROJECT_OUT_FILE}.sha256 ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sha256" 1 error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sha256" 1
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
cp -f ./${PROJECT_OUT_FILE}.sig ${DEST_DIR} || cp ${COPY_OPS} ./${PROJECT_OUT_FILE}.sig ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sig" 1 error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sig" 1
fi fi
if [ "${PROJECT_IS_MINGW}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ]; then if [ "${PROJECT_IS_MINGW}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ]; then
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}" 1
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sha256" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sha256" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sha256" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sha256" 1
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sig" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sig" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sig" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sig" 1
fi fi
fi fi
if [ "${PROJECT_IS_DARWIN}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" ]; then if [ "${PROJECT_IS_DARWIN}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" ]; then
cp -f -X "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg" 1
cp -f -X "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sha256" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sha256" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sha256" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sha256" 1
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
cp -f -X "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sig" ${DEST_DIR} || cp ${COPY_OPS} "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sig" ${DEST_DIR} ||
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sig" 1 error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.dmg.sig" 1
fi fi
fi fi

View File

@@ -6,7 +6,7 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./info.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call mingw64 -no-start ./info.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0
popd popd

View File

@@ -6,6 +6,6 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./make_package.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 || exit 1 call mingw64 -no-start ./make_package.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 || exit 1
popd popd

View File

@@ -6,7 +6,7 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call setup_msys2.cmd "%ARG1%" "%ARG2%" "%ARG3%" call setup_msys2.cmd "%ARG1%" "%ARG2%" "%ARG3%"
if exist "cleanup.cmd" ( if exist "cleanup.cmd" (
call cleanup.cmd "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call cleanup.cmd "%ARG1%" "%ARG2%" "%ARG3%" 1 0

View File

@@ -6,7 +6,7 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./run_tests.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call mingw64 -no-start ./run_tests.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0
popd popd

View File

@@ -6,7 +6,7 @@ set ARG1=%~1
set ARG2=%~2 set ARG2=%~2
set ARG3=%~3 set ARG3=%~3
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./setup_msys2.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call mingw64 -no-start ./setup_msys2.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0
call mingw64 -no-start ./setup_msys2.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0 call mingw64 -no-start ./setup_msys2.sh "%ARG1%" "%ARG2%" "%ARG3%" 1 0
popd popd

View File

@@ -14,6 +14,7 @@ PROJECT_MSYS2_PACKAGE_LIST+=(
mingw64/mingw-w64-x86_64-diffutils mingw64/mingw-w64-x86_64-diffutils
mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-gcc
mingw64/mingw-w64-x86_64-gdb mingw64/mingw-w64-x86_64-gdb
mingw64/mingw-w64-x86_64-git-lfs
mingw64/mingw-w64-x86_64-icu mingw64/mingw-w64-x86_64-icu
mingw64/mingw-w64-x86_64-make mingw64/mingw-w64-x86_64-make
mingw64/mingw-w64-x86_64-mesa mingw64/mingw-w64-x86_64-mesa

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,6 +2,9 @@
setlocal setlocal
pushd "%~dp0%" pushd "%~dp0"
call mingw64 -no-start ./update_project.sh "%1" "%2" for /f "usebackq tokens=*" %%i in (`cygpath "%~2"`) do set ARG1=%%i
call mingw64 -no-start ./update_project.sh "%~1" "%ARG1%"
popd popd
endlocal