From 48f47341fc266c8b4ff80a766eae21ef031005c2 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Thu, 7 May 2026 08:01:35 -0700 Subject: [PATCH] fix(packaging): let gateway auto-detect package driver Signed-off-by: Drew Newberry --- crates/openshell-driver-vm/README.md | 8 ++++++-- deploy/deb/openshell-gateway.service | 1 - python/openshell/release_formula_test.py | 3 ++- tasks/scripts/release.py | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/openshell-driver-vm/README.md b/crates/openshell-driver-vm/README.md index bc56b5e4e..6cf982a7d 100644 --- a/crates/openshell-driver-vm/README.md +++ b/crates/openshell-driver-vm/README.md @@ -182,13 +182,17 @@ The VM guest's serial console is appended to `//console.l On Linux amd64 and arm64, `install-dev.sh` installs the Debian package from the selected `OPENSHELL_VERSION` release tag. That package includes -`openshell-gateway` and `openshell-driver-vm`. +`openshell-gateway` and `openshell-driver-vm`, but leaves +`OPENSHELL_DRIVERS` unset so the gateway uses its normal runtime +auto-detection. Set `OPENSHELL_DRIVERS=vm` to force the VM driver. On Apple Silicon macOS, `install-dev.sh` stages the generated `openshell.rb` formula from the selected release in the `nvidia/openshell` Homebrew tap. Homebrew installs `openshell`, `openshell-gateway`, and `openshell-driver-vm`, ad-hoc signs the driver with the Hypervisor entitlement -in `post_install`, and owns the `brew services` gateway lifecycle. +in `post_install`, and owns the `brew services` gateway lifecycle. The service +also leaves `OPENSHELL_DRIVERS` unset so driver choice remains automatic unless +the user explicitly overrides it. ## Relationship to `openshell-vm` diff --git a/deploy/deb/openshell-gateway.service b/deploy/deb/openshell-gateway.service index 4705b547d..26e3c07be 100644 --- a/deploy/deb/openshell-gateway.service +++ b/deploy/deb/openshell-gateway.service @@ -12,7 +12,6 @@ Environment=OPENSHELL_SERVER_PORT=17670 Environment=OPENSHELL_DISABLE_TLS=true Environment=OPENSHELL_DISABLE_GATEWAY_AUTH=true Environment=OPENSHELL_DB_URL=sqlite:%S/openshell/gateway/openshell.db -Environment=OPENSHELL_DRIVERS=vm Environment=OPENSHELL_GRPC_ENDPOINT=http://127.0.0.1:17670 Environment=OPENSHELL_SSH_GATEWAY_HOST=127.0.0.1 Environment=OPENSHELL_SSH_GATEWAY_PORT=17670 diff --git a/python/openshell/release_formula_test.py b/python/openshell/release_formula_test.py index d3f983e96..56abd7af6 100644 --- a/python/openshell/release_formula_test.py +++ b/python/openshell/release_formula_test.py @@ -8,7 +8,7 @@ from pathlib import Path -def test_generate_homebrew_formula_uses_tagged_macos_driver_asset( +def test_generate_homebrew_formula_uses_tagged_macos_driver_asset_without_default_driver( tmp_path: Path, ) -> None: release_dir = tmp_path / "release" @@ -51,6 +51,7 @@ def test_generate_homebrew_formula_uses_tagged_macos_driver_asset( "v0.0.10/openshell-driver-vm-aarch64-apple-darwin.tar.gz" ) in formula assert 'sha256 "' + "b" * 64 + '"' in formula + assert "OPENSHELL_DRIVERS" not in formula assert 'OPENSHELL_DRIVER_DIR: "#{opt_libexec}"' in formula assert "entitlements.atomic_write" in formula assert "brew services restart openshell" in formula diff --git a/tasks/scripts/release.py b/tasks/scripts/release.py index 4e839bbf0..0a6893121 100644 --- a/tasks/scripts/release.py +++ b/tasks/scripts/release.py @@ -293,7 +293,6 @@ def post_install OPENSHELL_DISABLE_TLS: "true", OPENSHELL_DISABLE_GATEWAY_AUTH: "true", OPENSHELL_DB_URL: "sqlite:#{{var}}/openshell/gateway/openshell.db", - OPENSHELL_DRIVERS: "vm", OPENSHELL_GRPC_ENDPOINT: "http://127.0.0.1:{LOCAL_GATEWAY_PORT}", OPENSHELL_SSH_GATEWAY_HOST: "127.0.0.1", OPENSHELL_SSH_GATEWAY_PORT: "{LOCAL_GATEWAY_PORT}",