Skip to content

Commit

Permalink
v7.3.2 (#113)
Browse files Browse the repository at this point in the history
* Work-around for Node/GLIBC version issue.
* FIX: The default value for a string input should not be boolean false.
* Exclude centos:7 and comment out CentOS 7 specific behaviour as CentOS 7 is EoL and the package mirror is no longer available.
* Also exclude centos:7 from building, not just from testing.
* FIX: Process the correct Bash variable value.
  • Loading branch information
ximon18 authored Jul 25, 2024
1 parent 9f5d559 commit eb704d8
Showing 1 changed file with 71 additions and 41 deletions.
112 changes: 71 additions & 41 deletions .github/workflows/pkg-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ on:
docker_repo:
required: false
type: string
default: false
default: ''
docker_context_path:
description: "Relative path to use as the Docker build context. Defaults to the root of the git clone, i.e. '.'."
required: false
Expand Down Expand Up @@ -298,6 +298,8 @@ defaults:

env:
DEBIAN_FRONTEND: noninteractive
# See: https://github.com/actions/checkout/issues/1809
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
# -------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -346,10 +348,10 @@ jobs:
DOCKER_BUILD_RULES_RAW_JSON=$(echo "${DOCKER_BUILD_RULES}" | yq -I=0 -p=yaml -o=json)
fi
# Convert string values to array of single string values (as GitHub matrix values must be arrays)
# Convert string values to array of single string values (as GitHub matrix values must be arrays).
DOCKER_BUILD_RULES_PROCESSED_JSON=$(echo ${DOCKER_BUILD_RULES_RAW_JSON} | jq 'with_entries(if .value | type == "string" then .value |= [.] elif .value | type != "array" then error("rule values must be strings or arrays") else . end)')
# Rename "crosstarget" keys to "target" (we support "crosstarget" for backward compatibility)
# Rename "crosstarget" keys to "target" (we support "crosstarget" for backward compatibility).
DOCKER_BUILD_RULES_PROCESSED_JSON=$(echo ${DOCKER_BUILD_RULES_PROCESSED_JSON} | jq '(.. | select(has("crosstarget")?)) |= with_entries(if .key == "crosstarget" then .key = "target" else . end)')
echo "docker_build_rules<<END_OF_DOCKER_BUILD_RULES" >> $GITHUB_OUTPUT
Expand All @@ -366,7 +368,7 @@ jobs:
PACKAGE_BUILD_RULES_RAW_JSON=$(echo "${PACKAGE_BUILD_RULES}" | yq -I=0 -p=yaml -o=json)
fi
# Convert string values to array of single string values (as GitHub matrix values must be arrays)
# Convert string values to array of single string values (as GitHub matrix values must be arrays).
PACKAGE_BUILD_RULES_ARRAYS_JSON=$(echo ${PACKAGE_BUILD_RULES_RAW_JSON} | jq 'with_entries(if .value | type == "string" then .value |= [.] elif .value | type != "array" then error("rule values must be strings or arrays") else . end)')
# Don't permute the build job over variables intended only for use by the pkg-test job but which were supplied
Expand All @@ -380,6 +382,23 @@ jobs:
# And now also for the older names for backward compatibility.
PACKAGE_BUILD_RULES_PROCESSED_JSON=$(echo ${PACKAGE_BUILD_RULES_PROCESSED_JSON} | jq -c 'del(.mode) | del(.include[]?.mode)')
# Exclude centos:7 from building because the CentOS package mirror is no longer available.
# Specifically:
# $ yum update -y
# Loaded plugins: fastestmirror, ovl
# Determining fastest mirrors
# Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
# 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
if [[ "${PACKAGE_BUILD_RULES_PROCESSED_JSON}" != "{}" ]]; then
CONTROL_JSON=$(echo ${PACKAGE_BUILD_RULES_PROCESSED_JSON} | jq -c)
MODIFIED_JSON=$(echo ${PACKAGE_BUILD_RULES_PROCESSED_JSON} | jq -c 'del(.image[]? | select(. == "centos:7")) | del(.include[]? | select(.image == "centos:7"))')
MODIFIED_JSON=$(echo ${MODIFIED_JSON} | jq -c 'del(.include[]? | select(.os == "debian:centos7"))')
if [[ "${CONTROL_JSON}" != "${MODIFIED_JSON}" ]]; then
echo "::warning::Removed centos:7 image from package_build_rules because mirrorlist.centos.org is no longer available"
PACKAGE_BUILD_RULES_PROCESSED_JSON="${MODIFIED_JSON}"
fi
fi
echo "package_build_rules<<END_OF_PACKAGE_BUILD_RULES" >> $GITHUB_OUTPUT
echo ${PACKAGE_BUILD_RULES_PROCESSED_JSON} | jq >> $GITHUB_OUTPUT
echo 'END_OF_PACKAGE_BUILD_RULES' >> $GITHUB_OUTPUT
Expand All @@ -398,21 +417,32 @@ jobs:
PACKAGE_TEST_RULES_RAW_JSON=$(echo "${PACKAGE_TEST_RULES}" | yq -I=0 -p=yaml -o=json)
fi
# Convert string values to array of single string values (as GitHub matrix values must be arrays)
# Convert string values to array of single string values (as GitHub matrix values must be arrays).
PACKAGE_TEST_RULES_PROCESSED_JSON=$(echo ${PACKAGE_TEST_RULES_RAW_JSON} | jq 'with_entries(if .value | type == "string" then .value |= [.] elif .value | type != "array" then error("rule values must be strings or arrays") else . end)')
# Exclude debian:stretch because the LXC image is no longer available
if [[ "${PACKAGE_TEST_RULES_RAW_JSON}" != "{}" ]]; then
CONTROL_JSON=$(echo ${PACKAGE_TEST_RULES_RAW_JSON} | jq -c)
MODIFIED_JSON=$(echo ${PACKAGE_TEST_RULES_RAW_JSON} | jq -c 'del(.image[]? | select(. == "debian:stretch")) | del(.include[]? | select(.image == "debian:stretch"))')
# Exclude debian:stretch because the LXC image is no longer available.
if [[ "${PACKAGE_TEST_RULES_PROCESSED_JSON}" != "{}" ]]; then
CONTROL_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c)
MODIFIED_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c 'del(.image[]? | select(. == "debian:stretch")) | del(.include[]? | select(.image == "debian:stretch"))')
MODIFIED_JSON=$(echo ${MODIFIED_JSON} | jq -c 'del(.include[]? | select(.os == "debian:stretch"))')
if [[ "${CONTROL_JSON}" != "${MODIFIED_JSON}" ]]; then
echo "::warning::Removed debian:stretch image from package_test_rules because the LXC image no longer exists"
PACKAGE_TEST_RULES_PROCESSED_JSON="${MODIFIED_JSON}"
fi
fi
# Exclude non-x86_64 targets as we only run the tests on x86-64 GitHub runners
# Exclude centos:7 because we excluded it from building above.
if [[ "${PACKAGE_TEST_RULES_PROCESSED_JSON}" != "{}" ]]; then
CONTROL_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c)
MODIFIED_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c 'del(.image[]? | select(. == "centos:7")) | del(.include[]? | select(.image == "centos:7"))')
MODIFIED_JSON=$(echo ${MODIFIED_JSON} | jq -c 'del(.include[]? | select(.os == "centos:7"))')
if [[ "${CONTROL_JSON}" != "${MODIFIED_JSON}" ]]; then
echo "::warning::Removed centos:7 image from package_test_rules because Ploutos no longer supports building for CentOS 7"
PACKAGE_TEST_RULES_PROCESSED_JSON="${MODIFIED_JSON}"
fi
fi
# Exclude non-x86_64 targets as we only run the tests on x86-64 GitHub runners.
if [[ "${PACKAGE_TEST_RULES_PROCESSED_JSON}" != "{}" ]]; then
CONTROL_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c)
MODIFIED_JSON=$(echo ${PACKAGE_TEST_RULES_PROCESSED_JSON} | jq -c 'del(.target[]? | select(. != "x86_64")) | del(.include[]? | select(.target != "x86_64" and .target != null))')
Expand Down Expand Up @@ -1243,18 +1273,18 @@ jobs:
# line argument which might enable us to work the same way as we do for cargo deb above.
# See: https://github.com/cat-in-136/cargo-generate-rpm/issues/18
# Determine any additional arguments that need to be passed to cargo generate-rpm
case "${OS_NAME}:${OS_REL}" in
centos:7)
# yum install fails on older CentOS with the default LZMA compression used by cargo generate-rpm since v0.5.0
# see: https://github.com/cat-in-136/cargo-generate-rpm/issues/30
EXTRA_CARGO_GENERATE_RPM_ARGS="--payload-compress gzip"
;;
*)
# assume we are only invoked with something newer than CentOS 7, e.g. not CentOS 6 ;-)
EXTRA_CARGO_GENERATE_RPM_ARGS=""
;;
esac
## Determine any additional arguments that need to be passed to cargo generate-rpm
#case "${OS_NAME}:${OS_REL}" in
# centos:7)
# # yum install fails on older CentOS with the default LZMA compression used by cargo generate-rpm since v0.5.0
# # see: https://github.com/cat-in-136/cargo-generate-rpm/issues/30
# EXTRA_CARGO_GENERATE_RPM_ARGS="--payload-compress gzip"
# ;;
# *)
# # assume we are only invoked with something newer than CentOS 7, e.g. not CentOS 6 ;-)
# EXTRA_CARGO_GENERATE_RPM_ARGS=""
# ;;
#esac
# Hack to use a different service file without having to duplicate almost the entire
# [package.metadata.generate-rpm.assets] setting with only one entry changed. We don't need this with
Expand Down Expand Up @@ -1503,23 +1533,23 @@ jobs:
EXTRA_RPMLINT_ARGS=
LINTER_CONFIG_PATH="$HOME/.config/rpmlint"
case ${OS_REL} in
7)
# On CentOS 7 we only have the older rpmlint 1.x available, which has a known issue with the
# `missing-call-to-chdir-with-chroot` check causing false positives, therefore we filter this error
# out. The false positive issue was fixed in rpmlint 2.x.
#
# See: https://github.com/rpm-software-management/rpmlint/issues/84
mkdir $HOME/.config
cat <<'EOF' >${LINTER_CONFIG_PATH}
from Config import *
addFilter(".: no-buildhost-tag")
addFilter(".: no-changelogname-tag")
addFilter(".: missing-call-to-chdir-with-chroot")
EOF
;;
*)
#case ${OS_REL} in
# 7)
# # On CentOS 7 we only have the older rpmlint 1.x available, which has a known issue with the
# # `missing-call-to-chdir-with-chroot` check causing false positives, therefore we filter this error
# # out. The false positive issue was fixed in rpmlint 2.x.
# #
# # See: https://github.com/rpm-software-management/rpmlint/issues/84
# mkdir $HOME/.config
# cat <<'EOF' >${LINTER_CONFIG_PATH}
# from Config import *
# addFilter(".: no-buildhost-tag")
# addFilter(".: no-changelogname-tag")
# addFilter(".: missing-call-to-chdir-with-chroot")
# EOF
# ;;
# *)
# Assume we are only invoked with something newer than CentOS 7, e.g. not CentOS 6 ;-)
if [[ "${{ inputs.strict_mode }}" == "true" ]]; then
EXTRA_RPMLINT_ARGS="${EXTRA_RPMLINT_ARGS} --strict"
Expand All @@ -1545,8 +1575,8 @@ jobs:
curl --proto '=https' --tlsv1.2 --fail --output ${LICENSES_CONF_PATH} ${LICENSES_CONF_URL}
EXTRA_RPMLINT_ARGS="${EXTRA_RPMLINT_ARGS} --rpmlintrc ${LINTER_CONFIG_PATH} --config ${LICENSES_CONF_PATH}"
;;
esac
# ;;
#esac
for CHECK_NAME in ${{ matrix.rpm_rpmlint_check_filters }}; do
echo 'addFilter(".: '${CHECK_NAME}'")' >> ${LINTER_CONFIG_PATH}
Expand Down

0 comments on commit eb704d8

Please sign in to comment.