From 67991564200f037f562e3a0163c4153595904720 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Tue, 24 Feb 2026 12:48:17 +0000 Subject: [PATCH 1/2] Ensure pre-commit can be found via $PATH there were more and more cases popping up, where pre-commit was not in $PATH. Instead of applying the same fix again and again, fix it centrally. --- .../.devcontainer/s-core-local/enable_pre_commit_hooks.sh | 2 +- .../.devcontainer/s-core-local/install.sh | 5 +++++ .../.devcontainer/s-core-local/tests/test_default.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/enable_pre_commit_hooks.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/enable_pre_commit_hooks.sh index 33300c5..ee2f6d3 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/enable_pre_commit_hooks.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/enable_pre_commit_hooks.sh @@ -19,7 +19,7 @@ PRE_COMMIT_CONFIG_FILE=".pre-commit-config.yaml" if [[ -f "${PRE_COMMIT_CONFIG_FILE}" ]] then echo "Pre-commit configuration found (${PRE_COMMIT_CONFIG_FILE})" - "${PIPX_BIN_DIR}/pre-commit" install + pre-commit install else echo "No pre-commit configuration found (${PRE_COMMIT_CONFIG_FILE})" echo "Skipping pre-commit hook's installation" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index c9d593f..9941134 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -84,6 +84,11 @@ download_and_extract_from_github() { rm "${temp_file}" } +# always add PIPX_BIN_DIR to path +PIPX_BIN_DIR_EXPORT="$(grep "export PIPX_BIN_DIR" /etc/bash.bashrc)" +eval "${PIPX_BIN_DIR_EXPORT}" +echo -e "PATH=\"${PIPX_BIN_DIR}:\$PATH\"\nexport PATH" >> /etc/profile.d/pipx_bin_dir.sh + apt-get update # Unminimize the image to include standard packages like man pages diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh index 54a1cef..a2c4d08 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh @@ -23,7 +23,7 @@ KERNEL=$(uname -s) . /devcontainer/features/s-core-local/versions.sh /devcontainer/features/s-core-local/versions.yaml # pre-commit, it is available via $PATH in login shells, but not in non-login shells -check "validate pre-commit is working and has the correct version" bash -c "${PIPX_BIN_DIR}/pre-commit --version | grep '4.5.1'" +check "validate pre-commit is working and has the correct version" bash -c "pre-commit --version | grep '4.5.1'" # Common tooling check "validate shellcheck is working and has the correct version" bash -c "shellcheck --version | grep '${shellcheck_version}'" From 4c1dc6cd5fa3a26e9a3a221ded97aba34892fcca Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Tue, 24 Feb 2026 13:21:51 +0000 Subject: [PATCH 2/2] Test CODEQL_HOME exists --- .../.devcontainer/s-core-local/tests/test_default.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh index a2c4d08..842efd4 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh @@ -75,6 +75,7 @@ check "validate gh is working and has the correct version" bash -c "gh --version check "validate valgrind is working and has the correct version" bash -c "valgrind --version | grep '${valgrind_version}'" if [ "${ARCHITECTURE}" = "amd64" ] || { [ "${ARCHITECTURE}" = "arm64" ] && [ "${KERNEL}" = "Darwin" ]; }; then check "validate codeql is working and has the correct version" bash -c "codeql --version | grep '${codeql_version}'" + check "validate CODEQL_HOME is set correctly" bash -c "echo ${CODEQL_HOME} | grep \"/usr/local/codeql\"" fi # Qemu target-related tools