-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
22209: Update Amalgam Build to use GLIBC2_28 container (#306)
- presets for build: amd64-debug-linux-228, amd64-release-linux-228 - presets for test: amd64-debug-linux-228, amd64-release-linux-228 - add glibc version output - add build/build.sh convenience script for running build locally within a build container. - add smoke test and add to changelog --------- Co-authored-by: Will Goddin <[email protected]> Co-authored-by: Andrew Bassett <[email protected]>
- Loading branch information
1 parent
9a83aaf
commit f8ef31b
Showing
5 changed files
with
243 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/bin/bash | ||
# | ||
# Build functions for the repository - predominantly used by build pipelines, | ||
# to keep specific build logic output of pipeline yml files allowing control | ||
# of build functions, outside of the generic build templates. | ||
# | ||
# usage: ./build/build.sh <build-function> {params} | ||
# | ||
##### | ||
|
||
# set -x | ||
set -eu # fail on error, and undefined var usage | ||
|
||
cmake_preset() { | ||
PRESET=${1:-} | ||
if [[ -z "$PRESET" ]]; then | ||
echo "PRESET is required input" | ||
cmake --list-presets | ||
return | ||
fi | ||
echo "Building preset: $PRESET" | ||
ldd --version | ||
cmake --preset $PRESET # configure/generate (./out/build) | ||
} | ||
|
||
cmake_build() { | ||
PRESET=${1:-} | ||
if [[ -z "$PRESET" ]]; then | ||
echo "PRESET is required input" | ||
cmake --list-presets | ||
return | ||
fi | ||
cmake_preset $PRESET | ||
cmake --build --preset $PRESET # build | ||
} | ||
|
||
cmake_build_target() { | ||
PRESET=${1:-} | ||
TARGET=${2:-} | ||
if [[ -z "$PRESET" ]]; then | ||
echo "PRESET is required input" | ||
cmake --list-presets | ||
return | ||
fi | ||
cmake --build --preset $PRESET --target $TARGET | ||
} | ||
|
||
cmake_test() { | ||
PRESET=${1:-} | ||
cmake_build $PRESET | ||
cmake_build_target $PRESET test | ||
} | ||
|
||
cmake_install() { | ||
PRESET=${1:-} | ||
cmake_build $PRESET | ||
cmake_build_target $PRESET install | ||
} | ||
|
||
cmake_package() { | ||
PRESET=${1:-} | ||
cmake_build $PRESET | ||
cmake_build_target $PRESET package | ||
} | ||
|
||
docker_run_linux_228_build_container() { | ||
src_local="." | ||
src="/home/src/amalgam" | ||
ct_name="ghcr.io/howsoai/amalgam-build-container-linux-228" | ||
ct_tag="latest" | ||
echo "docker run -it -w $src -v $src_local:$src $ct_name:$ct_tag" | ||
docker run -it -w $src -v "$src_local:$src" "$ct_name:$ct_tag" | ||
} | ||
|
||
# Show usage, and print functions | ||
help() { | ||
echo "usage: ./bin/build.sh <build-function> {params}" | ||
echo " where <build-function> one of :-" | ||
IFS=$'\n' | ||
for f in $(declare -F); do | ||
echo " ${f:11}" | ||
done | ||
} | ||
|
||
# Takes the cli params, and runs them, defaulting to 'help()' | ||
if [ ! ${1:-} ]; then | ||
help | ||
else | ||
"$@" | ||
fi |
This file contains 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