Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging build failures on Arch, Fedora and Tumbleweed #2018

Merged
merged 14 commits into from
Sep 20, 2024
Merged
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,6 @@ jobs:
instances: '["latest", "default"]'


opensuse-tumbleweed:
name: Opensuse Tumbleweed
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: opensuse-tumbleweed
display-name: Opensuse Tumbleweed
timeout: 20
instances: '["git-master", "latest", "default"]'


oraclelinux-8:
name: Oracle Linux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
Expand Down Expand Up @@ -510,7 +496,6 @@ jobs:
- gentoo
- gentoo-systemd
- opensuse-15
- opensuse-tumbleweed
- oraclelinux-8
- oraclelinux-9
- photon-4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/templates/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
os.chdir(os.path.abspath(os.path.dirname(__file__)))

## "amazon-2023",
## "opensuse-tumbleweed",
LINUX_DISTROS = [
"almalinux-8",
"almalinux-9",
Expand All @@ -20,7 +21,6 @@
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-8",
"oraclelinux-9",
"photon-4",
Expand All @@ -43,6 +43,7 @@


## "amazon-2023",
## "opensuse-tumbleweed",
STABLE_DISTROS = [
"almalinux-8",
"almalinux-9",
Expand All @@ -54,7 +55,6 @@
"fedora-39",
"fedora-40",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-8",
"oraclelinux-9",
"photon-4",
Expand Down Expand Up @@ -99,29 +99,30 @@
"ubuntu-2404",
]

## "opensuse-tumbleweed",
BLACKLIST_3006 = [
"arch",
"debian-12",
"fedora-40",
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"ubuntu-2404",
]

## "opensuse-tumbleweed",
BLACKLIST_3007 = [
"arch",
"fedora-39",
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"photon-4",
"photon-5",
]

## "amazon-2023",
## "opensuse-tumbleweed",
BLACKLIST_GIT_3006 = [
"almalinux-9",
"amazon-2",
Expand All @@ -133,7 +134,6 @@
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-9",
"photon-4",
"photon-5",
Expand All @@ -144,6 +144,7 @@
]

## "amazon-2023",
## "opensuse-tumbleweed",
BLACKLIST_GIT_3007 = [
"almalinux-9",
"amazon-2",
Expand All @@ -156,7 +157,6 @@
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-9",
"photon-4",
"photon-5",
Expand Down Expand Up @@ -240,6 +240,7 @@
]

## "amazon-2023": "Amazon 2023",
## "opensuse-tumbleweed": "Opensuse Tumbleweed",
DISTRO_DISPLAY_NAMES = {
"almalinux-8": "AlmaLinux 8",
"almalinux-9": "AlmaLinux 9",
Expand All @@ -253,7 +254,6 @@
"gentoo": "Gentoo",
"gentoo-systemd": "Gentoo (systemd)",
"opensuse-15": "Opensuse 15",
"opensuse-tumbleweed": "Opensuse Tumbleweed",
"oraclelinux-8": "Oracle Linux 8",
"oraclelinux-9": "Oracle Linux 9",
"photon-4": "Photon OS 4",
Expand Down
39 changes: 32 additions & 7 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ _ONEDIR_DIR="salt"
_ONEDIR_NIGHTLY_DIR="salt-dev/${_ONEDIR_DIR}"
_PY_EXE="python3"
_MINIMUM_PIP_VERSION="9.0.1"
_MINIMUM_SETUPTOOLS_VERSION="9.1"
_MINIMUM_SETUPTOOLS_VERSION="65.6.3"
_MAXIMUM_SETUPTOOLS_VERSION="69.0"
_PIP_INSTALL_ARGS="--prefix=/usr"
_PIP_DOWNLOAD_ARGS=""
_QUICK_START="$BS_FALSE"
Expand Down Expand Up @@ -1853,7 +1854,7 @@ if [ "$ITYPE" = "git" ]; then
echowarn "git based installations will always install salt"
echowarn "and its dependencies using pip which will be upgraded to"
echowarn "at least v${_MINIMUM_PIP_VERSION}, and, in case the setuptools version is also"
echowarn "too old, it will be upgraded to at least v${_MINIMUM_SETUPTOOLS_VERSION}"
echowarn "too old, it will be upgraded to at least v${_MINIMUM_SETUPTOOLS_VERSION} and less than v${_MAXIMUM_SETUPTOOLS_VERSION}"
echo
echowarn "You have 10 seconds to cancel and stop the bootstrap process..."
echo
Expand Down Expand Up @@ -2102,10 +2103,15 @@ __git_clone_and_checkout() {
if [ "$(git clone 2>&1 | grep 'single-branch')" != "" ]; then
# The "--single-branch" option is supported, attempt shallow cloning
echoinfo "Attempting to shallow clone $GIT_REV from Salt's repository ${_SALT_REPO_URL}"
if git clone --depth 1 --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
## Shallow cloning is resulting in the wrong version of Salt, even with a depth of 5
## getting 3007.0+0na.246d066 when it should be 3007.1+410.g246d066457, disabling for now
## if git clone --depth 1 --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
echodebug "git command, git clone --branch $GIT_REV $_SALT_REPO_URL $__SALT_CHECKOUT_REPONAME"
if git clone --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
# shellcheck disable=SC2164
cd "${_SALT_GIT_CHECKOUT_DIR}"
__SHALLOW_CLONE=$BS_TRUE
echoinfo "shallow path (disabled shallow) git cloned $GIT_REV, version $(python3 salt/version.py)"
else
# Shallow clone above failed(missing upstream tags???), let's resume the old behaviour.
echowarn "Failed to shallow clone."
Expand All @@ -2119,10 +2125,13 @@ __git_clone_and_checkout() {
fi

if [ "$__SHALLOW_CLONE" -eq $BS_FALSE ]; then
echodebug "shallow clone false, BS_FALSE $BS_FALSE, git clone $_SALT_REPO_URL $__SALT_CHECKOUT_REPONAME"
git clone "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME" || return 1
# shellcheck disable=SC2164
cd "${_SALT_GIT_CHECKOUT_DIR}"

echoinfo "git cloned $GIT_REV, version $(python3 salt/version.py)"

if ! echo "$_SALT_REPO_URL" | grep -q -F -w "${_SALTSTACK_REPO_URL#*://}"; then
# We need to add the saltstack repository as a remote and fetch tags for proper versioning
echoinfo "Adding SaltStack's Salt repository as a remote"
Expand Down Expand Up @@ -2678,7 +2687,7 @@ EOM
echodebug "Installed pip version: $(${_pip_cmd} --version)"
fi

_setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}"
_setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION},<${_MAXIMUM_SETUPTOOLS_VERSION}"
if [ "$_PY_MAJOR_VERSION" -ne 3 ]; then
echoerror "Python version is no longer supported, only Python 3"
return 1
Expand All @@ -2695,10 +2704,12 @@ EOM
echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_PIP_INSTALL_ARGS} wheel ${_setuptools_dep}"
${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade ${_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}"

echoinfo "Installing salt using ${_py_exe}"
echoinfo "Installing salt using ${_py_exe}, $(${_py_exe} --version)"
cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1

mkdir /tmp/git/deps
mkdir -p /tmp/git/deps
echodebug "Created directory /tmp/git/deps"
echodebug "Installing Salt dependencies for Salt version $(python3 salt/version.py)"

if [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -eq 22 ]; then
echodebug "Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', upgrading from default pip works"
Expand Down Expand Up @@ -2729,8 +2740,18 @@ EOM

echoinfo "Installing Built Salt Wheel"
${_pip_cmd} uninstall --yes ${_USE_BREAK_SYSTEM_PACKAGES} salt 2>/dev/null || true

# Hack for getting current Arch working with git-master
if [ "${DISTRO_NAME}" = "Arch Linux" ]; then
_arch_dep="cryptography==42.0.7" # debug matching current Arch version of python-cryptography
echodebug "Running '${_pip_cmd} install --force-reinstall --break-system-packages ${_arch_dep}'"
${_pip_cmd} install --force-reinstall --break-system-packages "${_arch_dep}"
fi

echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall ${_PIP_INSTALL_ARGS} /tmp/git/deps/salt*.whl'"

echodebug "Running ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall ${_PIP_INSTALL_ARGS} --global-option=--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS} /tmp/git/deps/salt*.whl"

${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --no-deps --force-reinstall \
${_PIP_INSTALL_ARGS} \
--global-option="--salt-config-dir=$_SALT_ETC_DIR --salt-cache-dir=${_SALT_CACHE_DIR} ${SETUP_PY_INSTALL_ARGS}" \
Expand Down Expand Up @@ -3832,6 +3853,10 @@ install_fedora_git_deps() {
CONFIG_SALT_FUNC="config_salt"
fi

_fedora_dep="contextvars"
echodebug "Running '${_PY_EXE} -m pip install --upgrade ${_fedora_dep}'"
${_PY_EXE} -m pip install --upgrade "${_fedora_dep}"

return 0
}

Expand Down Expand Up @@ -6024,7 +6049,7 @@ install_photon_git_deps() {

if [ "${DISTRO_MAJOR_VERSION}" -gt 3 ]; then
# Need newer version of setuptools on Photon
_setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}"
_setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION},<${_MAXIMUM_SETUPTOOLS_VERSION}"
echodebug "Running '${_PY_EXE} -m pip install --upgrade ${_setuptools_dep}'"
${_PY_EXE} -m pip install --upgrade "${_setuptools_dep}"
fi
Expand Down
17 changes: 9 additions & 8 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ provisioner:
## - yum -y install --allowerasing procps-ng curl
## - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config

## - name: opensuse-tumbleweed
## driver:
## image: opensuse/tumbleweed:latest
## provision_command:
## - *opensuse_provision_command_01
## - *opensuse_provision_command_02
## - *opensuse_provision_command_03
## - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config

platforms:
- name: almalinux-9
driver:
Expand Down Expand Up @@ -104,14 +113,6 @@ platforms:
- &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1
- &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd
- &opensuse_provision_command_03 systemctl enable sshd.service
- name: opensuse-tumbleweed
driver:
image: opensuse/tumbleweed:latest
provision_command:
- *opensuse_provision_command_01
- *opensuse_provision_command_02
- *opensuse_provision_command_03
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: rockylinux-9
driver:
platform: centosstream
Expand Down
Loading