Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Uses buildah tag for tagging
  • Loading branch information
jkachmar committed Oct 4, 2021
commit b8d5b50989de961335bcc1b5bce6c4ca6b3dc2ed
18 changes: 9 additions & 9 deletions ghc/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cd "$( git rev-parse --show-toplevel )"
alpine_ver="3.14"
container="ghc"
image="ghc"
ghc_ver="8.10.7"
ghc_version="8.10.7"

# NOTE: The logic associated with this will have to change for GHC 9.x and up to
# support the changes introduced with the switch to `ghc-bignum`.
Expand All @@ -33,7 +33,7 @@ usage="USAGE: $0
-c CONTAINER override the default container name
default: ${container}
-g GHC_VER override the numeric library GHC is built against; either 'gmp' or 'simple'
default: ${ghc_ver}
default: ${ghc_version}
-i IMAGE override the default image base name
default: ${image}
-n NUMERIC override the numeric library GHC is built against; either 'gmp' or 'simple'
Expand All @@ -48,7 +48,7 @@ while getopts "a:c:g:i:n:h" opt; do
container="${OPTARG}"
};;
g ) {
ghc_ver="${OPTARG}"
ghc_version="${OPTARG}"
};;
i ) {
image="${OPTARG}"
Expand Down Expand Up @@ -79,7 +79,7 @@ if [ "$#" -ne 0 ]; then
fi

# Add the GHC version and numeric library to container and image names.
container="${container}-${numeric}-${ghc_ver}"
container="${container}-${numeric}-${ghc_version}"
image="${image}-${numeric}"

################################################################################
Expand Down Expand Up @@ -163,7 +163,7 @@ buildah copy --chmod 111 "${container}" \

# Compile GHC.
buildah run "${container}" \
./tmp/compile_ghc.sh "${ghc_ver}"
./tmp/compile_ghc.sh "${ghc_version}"

# Uninstall the bootstrapping compiler.
buildah run "${container}" \
Expand Down Expand Up @@ -197,8 +197,8 @@ buildah config \
#
# e.g. Uncomment the following:
#
# mkdir -p ./tmp
# TMPDIR=./tmp \
buildah \
mkdir -p ./tmp
TMPDIR=./tmp \
buildah \
--signature-policy=./policy.json \
commit "${container}" "${image}:${ghc_ver}"
commit --rm "${container}" "${image}:${ghc_version}"
9 changes: 7 additions & 2 deletions ghcup/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ buildah config \
# Generate the final image.
################################################################################

# NOTE: Tagging the image with the `ghcup_version` for convenience.
buildah \
--signature-policy=./policy.json \
commit "${container}" "${image}:${ghcup_version}"
commit --rm "${container}" "${image}:${ghcup_version}"

# NOTE: Tagging the image with the `ghcup_version` for convenience.
#
# This is going to produce an image with the newest `ghcup` most of the time
# anyway.
buildah tag "${image}:${ghcup_version}" "${image}:latest"