From bcf4558cfc80bba49cdfb390afb1a1c83392a193 Mon Sep 17 00:00:00 2001 From: krishicks Date: Fri, 11 Sep 2026 20:38:01 +0000 Subject: [PATCH 1/3] fix(mise): run mise lock --platform linux-x64 (#3291) Signed-off-by: Kris Hicks --- mise.lock | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mise.lock b/mise.lock index 522084b559..6e0d6d4efc 100644 --- a/mise.lock +++ b/mise.lock @@ -134,6 +134,18 @@ checksum = "sha256:b8514ed7552e148b0a032114f745118dcb801791adafafeaf9935e4bfb0ed url = "https://github.com/mozilla/sccache/releases/download/v0.16.0/sccache-v0.16.0-x86_64-pc-windows-msvc.zip" url_api = "https://api.github.com/repos/mozilla/sccache/releases/assets/452060720" +[[tools."github:mozilla/sccache"]] +version = "0.16.0" +backend = "github:mozilla/sccache" + +[tools."github:mozilla/sccache".options] +asset_pattern = "sccache-v*x86_64*linux*.tar.gz" + +[tools."github:mozilla/sccache"."platforms.linux-x64"] +checksum = "sha256:aec995a83ad3dff3d14b6314e08858b7b73d35ca85a5bcf3d3a9ec07dee35588" +url = "https://github.com/mozilla/sccache/releases/download/v0.16.0/sccache-v0.16.0-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/mozilla/sccache/releases/assets/452060682" + [[tools."github:nextest-rs/nextest"]] version = "cargo-nextest-0.9.143" backend = "github:nextest-rs/nextest" From 5b57f0d1549677c7547862d26ff9491285ea0fbc Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Fri, 11 Sep 2026 21:40:08 +0000 Subject: [PATCH 2/3] fix(ci): restore Windows test portability (#3288) * fix(ci): restore Windows test portability Signed-off-by: Piotr Mlocek * fix(tasks): skip Unix lockfile check on Windows Signed-off-by: Piotr Mlocek * fix(tasks): use buf shim on Windows Signed-off-by: Piotr Mlocek --------- Signed-off-by: Piotr Mlocek --- crates/openshell-core/src/driver_utils.rs | 1 + crates/openshell-ocsf/tests/event_identity.rs | 7 ++++++- tasks/rust.toml | 1 + tasks/typescript.toml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/openshell-core/src/driver_utils.rs b/crates/openshell-core/src/driver_utils.rs index f4da644d9b..a0c46729c4 100644 --- a/crates/openshell-core/src/driver_utils.rs +++ b/crates/openshell-core/src/driver_utils.rs @@ -1248,6 +1248,7 @@ mod tests { assert!(validate_guest_spiffe_tcp_endpoint("unix:/run/spire/agent.sock", true).is_err()); } + #[cfg(unix)] #[test] fn credential_file_rejects_fifo_without_hanging() { // A FIFO with no writer would block a blocking open() forever. The diff --git a/crates/openshell-ocsf/tests/event_identity.rs b/crates/openshell-ocsf/tests/event_identity.rs index 9fa51cc8bd..34a3868ca2 100644 --- a/crates/openshell-ocsf/tests/event_identity.rs +++ b/crates/openshell-ocsf/tests/event_identity.rs @@ -68,7 +68,12 @@ fn device_identifies_the_sandbox_environment() { assert_eq!(json["device"]["type_id"], 99); assert_eq!(json["device"]["type"], "Sandbox"); - assert_eq!(json["device"]["os"]["name"], "Linux"); + let expected_os = if cfg!(target_os = "windows") { + "Windows" + } else { + "Linux" + }; + assert_eq!(json["device"]["os"]["name"], expected_os); } #[test] diff --git a/tasks/rust.toml b/tasks/rust.toml index e8c45fd54c..548e302f12 100644 --- a/tasks/rust.toml +++ b/tasks/rust.toml @@ -13,6 +13,7 @@ hide = true ["rust:lockfiles:check"] description = "Verify all tracked Cargo lockfiles are current" run = "tasks/scripts/check-cargo-lockfiles.sh" +run_windows = "echo Skipping rust:lockfiles:check: Cargo lockfile validation uses a Unix shell helper." hide = true ["rust:lint"] diff --git a/tasks/typescript.toml b/tasks/typescript.toml index 823a881359..06f6e8c4f1 100644 --- a/tasks/typescript.toml +++ b/tasks/typescript.toml @@ -25,6 +25,7 @@ run = "npm run gen" description = "Lint proto/ with buf (repo-level buf.yaml)" depends = ["sdk:ts:install"] run = "./sdk/typescript/node_modules/.bin/buf lint" +run_windows = "sdk\\typescript\\node_modules\\.bin\\buf.cmd lint" ["sdk:ts:typecheck"] description = "Type-check the TypeScript SDK" From 5b9daab9351b1e053f9a5e0ce4c899f5d3f674b0 Mon Sep 17 00:00:00 2001 From: krishicks Date: Sat, 12 Sep 2026 00:17:15 +0000 Subject: [PATCH 3/3] fix(ci): restore mise run ci on macOS (#3294) - Replace BSD-incompatible in-place sed calls with portable temp-file rewrites. - Remove test-only shell interception and capture generated gateway config directly. - Allow parity tests to use supplied supervisor binaries without resolving a Linux target. - Normalize temporary-directory paths and use portable RPM config installation. - Set a valid setuptools-scm version for Python protobuf generation in Jujutsu checkouts. Signed-off-by: Kris Hicks --- deploy/rpm/migrate-gateway-config.sh | 4 +++- e2e/parity/run.sh | 8 +++++--- e2e/parity/test.sh | 4 +++- e2e/support/podman-gateway-config.sh | 7 +++++-- tasks/python.toml | 1 + tasks/scripts/stage-prebuilt-binaries.sh | 4 +++- tasks/scripts/test-gateway-config.sh | 7 +++---- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/deploy/rpm/migrate-gateway-config.sh b/deploy/rpm/migrate-gateway-config.sh index 4794ffa454..54e421a069 100755 --- a/deploy/rpm/migrate-gateway-config.sh +++ b/deploy/rpm/migrate-gateway-config.sh @@ -27,7 +27,9 @@ if [ -L "$destination" ] || { [ -e "$destination" ] && [ ! -f "$destination" ]; fi if [ ! -e "$destination" ]; then - install -Dm 0644 "$current_default" "$destination" + destination_dir=$(dirname "$destination") + mkdir -p "$destination_dir" + install -m 0644 "$current_default" "$destination" exit 0 fi diff --git a/e2e/parity/run.sh b/e2e/parity/run.sh index 6cf3f51448..2ebbbe468e 100755 --- a/e2e/parity/run.sh +++ b/e2e/parity/run.sh @@ -290,11 +290,13 @@ supervisor_target_triple() { build_supervisor() { local variant=$1 source_root=$2 target_dir=$3 override=$4 output_var=$5 local binary target jobs=() - target="$(supervisor_target_triple)" target_dir="${target_dir:-${ROOT}/target/parity/${variant}}" case "${target_dir}" in /*) ;; *) target_dir="${ROOT}/${target_dir}" ;; esac - binary="${override:-${target_dir}/${target}/release/openshell-sandbox}" - if [ -z "${override}" ]; then + if [ -n "${override}" ]; then + binary="${override}" + else + target="$(supervisor_target_triple)" + binary="${target_dir}/${target}/release/openshell-sandbox" require_clean_source "${variant}" "${source_root}" if [ -n "${CARGO_BUILD_JOBS:-}" ]; then jobs=(-j "${CARGO_BUILD_JOBS}"); fi echo "Building ${variant} supervisor in ${target_dir}..." diff --git a/e2e/parity/test.sh b/e2e/parity/test.sh index 2b8124ccd6..93137a9860 100755 --- a/e2e/parity/test.sh +++ b/e2e/parity/test.sh @@ -8,7 +8,9 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/openshell-parity-test.XXXXXX")" +TMP_ROOT="${TMPDIR:-/tmp}" +TMP_ROOT="${TMP_ROOT%/}" +WORKDIR="$(mktemp -d "${TMP_ROOT}/openshell-parity-test.XXXXXX")" trap 'rm -rf "${WORKDIR}"' EXIT fail() { echo "FAIL: $*" >&2; exit 1; } diff --git a/e2e/support/podman-gateway-config.sh b/e2e/support/podman-gateway-config.sh index dcf52d09c6..1f604ebcf7 100755 --- a/e2e/support/podman-gateway-config.sh +++ b/e2e/support/podman-gateway-config.sh @@ -128,9 +128,12 @@ e2e_write_podman_gateway_config() { # A remote UDS driver owns all runtime options. Keep the selected # gateway table transport-only so no in-tree setting can be mistaken # for executed external-driver configuration. - sed -i '/^health_check_interval_secs = /d' "${output}" + sed '/^health_check_interval_secs = /d' "${output}" >"${output}.updated" + mv "${output}.updated" "${output}" elif [ "${option_profile}" = "podman-options" ]; then - sed -i 's/^health_check_interval_secs = .*/health_check_interval_secs = 7/' "${output}" + sed 's/^health_check_interval_secs = .*/health_check_interval_secs = 7/' \ + "${output}" >"${output}.updated" + mv "${output}.updated" "${output}" fi # The v2 template opens the Podman table. Insert gateway-owned TLS # before it rather than reopening [openshell.gateway] later. diff --git a/tasks/python.toml b/tasks/python.toml index 9623bb226b..aacb005c0c 100644 --- a/tasks/python.toml +++ b/tasks/python.toml @@ -60,5 +60,6 @@ hide = true ["python:proto"] description = "Generate Python protobuf stubs from .proto files" +env = { SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL = "0.0.0" } run = "uv run --frozen python tasks/scripts/generate_python_proto.py" hide = true diff --git a/tasks/scripts/stage-prebuilt-binaries.sh b/tasks/scripts/stage-prebuilt-binaries.sh index 8f40788ffa..9687e24fd5 100755 --- a/tasks/scripts/stage-prebuilt-binaries.sh +++ b/tasks/scripts/stage-prebuilt-binaries.sh @@ -149,7 +149,9 @@ patch_workspace_version() { cargo_toml_backup="$(mktemp)" cp "$cargo_toml" "$cargo_toml_backup" restore_cargo_toml=1 - sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${OPENSHELL_CARGO_VERSION}"'"/}' "$cargo_toml" + sed -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${OPENSHELL_CARGO_VERSION}"'"/}' \ + "$cargo_toml" >"${cargo_toml}.updated" + mv "${cargo_toml}.updated" "$cargo_toml" } restore_workspace_version() { diff --git a/tasks/scripts/test-gateway-config.sh b/tasks/scripts/test-gateway-config.sh index 850cccc0bb..9541aa68fc 100755 --- a/tasks/scripts/test-gateway-config.sh +++ b/tasks/scripts/test-gateway-config.sh @@ -23,12 +23,11 @@ printf '%s\n' 'import sys, tomllib' 'from pathlib import Path' 'assert tomllib.l mkdir -p "${WORK}/bin" ln -s /usr/bin/true "${WORK}/bin/mise" ln -s /usr/bin/false "${WORK}/bin/lsof" -ln -s /bin/bash "${WORK}/bin/gateway" - -printf '%s\n' 'exec() {' ' config=""' ' while [ "$#" -gt 0 ]; do' ' if [ "$1" = "--config" ]; then config="$2"; shift 2; else shift; fi' ' done' ' cp "${config}" "${CAPTURED_CONFIG}"' ' builtin exit 0' '}' > "${WORK}/fake-gateway-env" +printf '%s\n' '#!/usr/bin/env bash' 'config=""' 'while [ "$#" -gt 0 ]; do' ' if [ "$1" = "--config" ]; then config="$2"; shift 2; else shift; fi' 'done' 'if [ -n "${config}" ]; then cp "${config}" "${CAPTURED_CONFIG}"; fi' > "${WORK}/bin/gateway" +chmod +x "${WORK}/bin/gateway" CAPTURED_CONFIG="${WORK}/generated.toml" -BASH_ENV="${WORK}/fake-gateway-env" CAPTURED_CONFIG="${CAPTURED_CONFIG}" PATH="${WORK}/bin:${PATH}" KUBERNETES_SERVICE_HOST=fixture OPENSHELL_GATEWAY_BIN=/bin/true OPENSHELL_GATEWAY_STATE_DIR="${WORK}/state" OPENSHELL_SANDBOX_IMAGE_PULL_POLICY=IfNotPresent OPENSHELL_GRPC_ENDPOINT=https://callback.example.test:9443 bash "${ROOT}/tasks/scripts/gateway.sh" +CAPTURED_CONFIG="${WORK}/generated.toml" PATH="${WORK}/bin:${PATH}" KUBERNETES_SERVICE_HOST=fixture OPENSHELL_GATEWAY_BIN="${WORK}/bin/gateway" OPENSHELL_GATEWAY_STATE_DIR="${WORK}/state" OPENSHELL_SANDBOX_IMAGE_PULL_POLICY=IfNotPresent OPENSHELL_GRPC_ENDPOINT=https://callback.example.test:9443 bash "${ROOT}/tasks/scripts/gateway.sh" printf '%s\n' 'import sys, tomllib' 'from pathlib import Path' 'config = tomllib.loads(Path(sys.argv[1]).read_text())' 'gateway = config["openshell"]["gateway"]' 'driver = config["openshell"]["drivers"]["kubernetes"]' 'assert config["openshell"]["version"] == 2' 'assert gateway["compute_driver"] == "kubernetes"' 'assert "compute_drivers" not in gateway' 'assert driver["image_pull_policy"] == "if_not_present"' 'assert driver["grpc_endpoint"] == "https://callback.example.test:9443"' > "${WORK}/check_generated.py" "${UV}" run --no-project python "${WORK}/check_generated.py" "${CAPTURED_CONFIG}"