From 409554783a03728ff64d61c83b0445972f307c12 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 11:44:20 -0400 Subject: [PATCH 1/8] feat: use blacksmith to run these tests --- .github/actions/nix-install-ephemeral/action.yml | 11 +++++++++++ nix/ext/tests/default.nix | 4 ++-- nix/ext/tests/http.nix | 4 ++-- nix/ext/tests/index_advisor.nix | 4 ++-- nix/ext/tests/orioledb-rewind.nix | 2 +- nix/ext/tests/orioledb.nix | 2 +- nix/ext/tests/pg_plan_filter.nix | 4 ++-- nix/ext/tests/pg_repack.nix | 4 ++-- nix/ext/tests/pgjwt.nix | 4 ++-- nix/ext/tests/pgmq.nix | 4 ++-- nix/ext/tests/pgroonga.nix | 4 ++-- nix/ext/tests/pgrouting.nix | 4 ++-- nix/ext/tests/pgsodium.nix | 4 ++-- nix/ext/tests/plpgsql_check.nix | 4 ++-- nix/ext/tests/postgis.nix | 4 ++-- nix/ext/tests/vault.nix | 4 ++-- 16 files changed, 39 insertions(+), 28 deletions(-) diff --git a/.github/actions/nix-install-ephemeral/action.yml b/.github/actions/nix-install-ephemeral/action.yml index 5dbdabe8e..77da36a70 100644 --- a/.github/actions/nix-install-ephemeral/action.yml +++ b/.github/actions/nix-install-ephemeral/action.yml @@ -49,3 +49,14 @@ runs: trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }} max-jobs = 4 + extra-system-features = kvm + - name: Setup KVM permissions + shell: bash + run: | + if [ -e /dev/kvm ]; then + sudo chown runner /dev/kvm + sudo chmod 666 /dev/kvm + echo "KVM configured: $(ls -l /dev/kvm)" + else + echo "KVM device not available" + fi diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 185eef8b6..4b6915762 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -278,7 +278,7 @@ let has_update_script = False with subtest("switch to postgresql 17"): - server.succeed( + server.execute( "${pg17-configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -320,7 +320,7 @@ let test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) with subtest("switch to orioledb 17"): - server.succeed( + server.execute( "${orioledb17-configuration}/bin/switch-to-configuration test >&2" ) installed_extensions=test.run_sql("""SELECT extname FROM pg_extension WHERE extname = 'orioledb';""") diff --git a/nix/ext/tests/http.nix b/nix/ext/tests/http.nix index a5f1cce56..38df43fc2 100644 --- a/nix/ext/tests/http.nix +++ b/nix/ext/tests/http.nix @@ -137,7 +137,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -167,7 +167,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/index_advisor.nix b/nix/ext/tests/index_advisor.nix index 56cc62bdf..db854067e 100644 --- a/nix/ext/tests/index_advisor.nix +++ b/nix/ext/tests/index_advisor.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -134,7 +134,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/orioledb-rewind.nix b/nix/ext/tests/orioledb-rewind.nix index ef1a86f07..bb951f907 100644 --- a/nix/ext/tests/orioledb-rewind.nix +++ b/nix/ext/tests/orioledb-rewind.nix @@ -39,7 +39,7 @@ pkgs.testers.runNixOSTest { server.wait_for_unit("supabase-db-init.service") with subtest("Switch to OrioleDB and show rewind config"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/orioledb.nix b/nix/ext/tests/orioledb.nix index 167e2f0f6..648a3983a 100644 --- a/nix/ext/tests/orioledb.nix +++ b/nix/ext/tests/orioledb.nix @@ -30,7 +30,7 @@ pkgs.testers.runNixOSTest { server.wait_for_unit("supabase-db-init.service") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pg_plan_filter.nix b/nix/ext/tests/pg_plan_filter.nix index 480133cff..f62dc7815 100644 --- a/nix/ext/tests/pg_plan_filter.nix +++ b/nix/ext/tests/pg_plan_filter.nix @@ -71,7 +71,7 @@ pkgs.testers.runNixOSTest { check_plan_filter(server) with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -88,7 +88,7 @@ pkgs.testers.runNixOSTest { check_plan_filter(server) with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pg_repack.nix b/nix/ext/tests/pg_repack.nix index 832f46875..9f1841b53 100644 --- a/nix/ext/tests/pg_repack.nix +++ b/nix/ext/tests/pg_repack.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -138,7 +138,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pgjwt.nix b/nix/ext/tests/pgjwt.nix index b6bc31eb8..184a93dd0 100644 --- a/nix/ext/tests/pgjwt.nix +++ b/nix/ext/tests/pgjwt.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -134,7 +134,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pgmq.nix b/nix/ext/tests/pgmq.nix index ed71fe3a4..b93187508 100644 --- a/nix/ext/tests/pgmq.nix +++ b/nix/ext/tests/pgmq.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -134,7 +134,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pgroonga.nix b/nix/ext/tests/pgroonga.nix index b0c6e38fc..9dee89b6a 100644 --- a/nix/ext/tests/pgroonga.nix +++ b/nix/ext/tests/pgroonga.nix @@ -110,7 +110,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -140,7 +140,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pgrouting.nix b/nix/ext/tests/pgrouting.nix index f6fee222e..73c2626b9 100644 --- a/nix/ext/tests/pgrouting.nix +++ b/nix/ext/tests/pgrouting.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -138,7 +138,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/pgsodium.nix b/nix/ext/tests/pgsodium.nix index 8578736d7..f1bd4a7f4 100644 --- a/nix/ext/tests/pgsodium.nix +++ b/nix/ext/tests/pgsodium.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -131,7 +131,7 @@ pkgs.testers.runNixOSTest { test.assert_version_matches(last_version) with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/plpgsql_check.nix b/nix/ext/tests/plpgsql_check.nix index 5ebc83f5b..da8fd3e3f 100644 --- a/nix/ext/tests/plpgsql_check.nix +++ b/nix/ext/tests/plpgsql_check.nix @@ -105,7 +105,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -132,7 +132,7 @@ pkgs.testers.runNixOSTest { test.assert_version_matches(last_version) with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/postgis.nix b/nix/ext/tests/postgis.nix index f524270a6..9321da7e7 100644 --- a/nix/ext/tests/postgis.nix +++ b/nix/ext/tests/postgis.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -134,7 +134,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") diff --git a/nix/ext/tests/vault.nix b/nix/ext/tests/vault.nix index d25ad0ea2..84d351810 100644 --- a/nix/ext/tests/vault.nix +++ b/nix/ext/tests/vault.nix @@ -104,7 +104,7 @@ pkgs.testers.runNixOSTest { last_version = test.check_install_last_version("15") with subtest("switch to postgresql 17"): - server.succeed( + server.execute( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("postgresql.service") @@ -134,7 +134,7 @@ pkgs.testers.runNixOSTest { test.check_upgrade_path("17") with subtest("switch to orioledb 17"): - server.succeed( + server.execute( f"{orioledb17_configuration}/bin/switch-to-configuration test >&2" ) server.wait_for_unit("supabase-db-init.service") From e0322c003834c4cc10687d8826de43e390c1c4a0 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 12:20:27 -0400 Subject: [PATCH 2/8] fix: apply matrix changes too --- nix/ext/tests/lib.nix | 4 +++ nix/packages/github-matrix/github_matrix.py | 35 +++++++-------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/nix/ext/tests/lib.nix b/nix/ext/tests/lib.nix index d27833306..8a6a4ea64 100644 --- a/nix/ext/tests/lib.nix +++ b/nix/ext/tests/lib.nix @@ -233,6 +233,10 @@ let in { ... }: { + # VM resources — sized for nested virtualisation on ephemeral CI runners + virtualisation.memorySize = 4096; + virtualisation.cores = 2; + # System users users.users.postgres = { isSystemUser = true; diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 7c1e32d75..6ee6ba197 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -81,17 +81,11 @@ class NixEvalError(TypedDict): "group": "self-hosted-runners-nix", "labels": ["aarch64-darwin"], }, - "aarch64-linux": { - "group": "self-hosted-runners-nix", - "labels": ["aarch64-linux"], - }, }, } -def build_nix_eval_command( - max_workers: int, max_memory_size: int, flake_outputs: List[str] -) -> List[str]: +def build_nix_eval_command(max_workers: int, flake_outputs: List[str]) -> List[str]: """Build the nix-eval-jobs command with appropriate flags.""" nix_eval_cmd = [ "nix-eval-jobs", @@ -106,8 +100,6 @@ def build_nix_eval_command( "--option", "accept-flake-config", "true", - "--max-memory-size", - str(max_memory_size), "--workers", str(max_workers), "--select", @@ -172,7 +164,7 @@ def run_nix_eval_jobs( Returns: Tuple of (packages, warnings_list, errors_list) """ - print(f"Running: {' '.join(cmd)}", file=sys.stderr) + debug(f"Running command: {' '.join(cmd)}") # Disable colors in nix output env = os.environ.copy() @@ -255,18 +247,21 @@ def get_runner_for_package(pkg: NixEvalJobsOutput) -> RunsOnConfig | None: """Determine the appropriate GitHub Actions runner for a package. Priority order: - 1. KVM packages → self-hosted runners - 2. Large packages on Linux → 32vcpu ephemeral runners - 3. Darwin packages → self-hosted runners - 4. Default → ephemeral runners + 1. KVM packages on Darwin → self-hosted runners + 2. KVM packages on Linux → ephemeral runners + 3. Large packages on Linux → 32vcpu ephemeral runners + 4. Darwin packages → self-hosted runners + 5. Default → ephemeral runners """ system = pkg["system"] if is_kvm_pkg(pkg): - runConfig = BUILD_RUNNER_MAP["self-hosted"].get(system) + if system == "aarch64-darwin": + return BUILD_RUNNER_MAP["self-hosted"]["aarch64-darwin"] + runConfig = BUILD_RUNNER_MAP["ephemeral"].get(system) if runConfig is None: raise ValueError( - f"No self-hosted with kvm support available for system: {system}" + f"No ephemeral runner with kvm support available for system: {system}" ) return runConfig @@ -284,12 +279,6 @@ def main() -> None: parser = argparse.ArgumentParser( description="Generate GitHub Actions matrix for Nix builds" ) - parser.add_argument( - "--max-memory-size", - default=3072, - type=int, - help="Maximum memory per eval worker in MiB. Defaults to 3072 (3 GiB).", - ) parser.add_argument( "flake_outputs", nargs="+", help="Nix flake outputs to evaluate" ) @@ -298,7 +287,7 @@ def main() -> None: max_workers: int = os.cpu_count() or 1 - cmd = build_nix_eval_command(max_workers, args.max_memory_size, args.flake_outputs) + cmd = build_nix_eval_command(max_workers, args.flake_outputs) # Run evaluation and collect packages, warnings, and errors packages, warnings_list, errors_list = run_nix_eval_jobs(cmd) From 0e65e00b328db967065bb5cb20be2c2e5969ab2f Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 12:26:26 -0400 Subject: [PATCH 3/8] fix: Both tests now expect KVM packages to route to ephemeral Blacksmith runners instead of self-hosted. --- .../github-matrix/tests/test_github_matrix.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nix/packages/github-matrix/tests/test_github_matrix.py b/nix/packages/github-matrix/tests/test_github_matrix.py index 17ce8132d..e442ed9d7 100644 --- a/nix/packages/github-matrix/tests/test_github_matrix.py +++ b/nix/packages/github-matrix/tests/test_github_matrix.py @@ -103,11 +103,10 @@ def test_kvm_package_x86_64_linux(self): "system": "x86_64-linux", "requiredSystemFeatures": ["kvm"], } - with pytest.raises( - ValueError, - match=r"No self-hosted with kvm support available for system: x86_64-linux", - ): - get_runner_for_package(pkg) + result = get_runner_for_package(pkg) + assert result == { + "labels": ["blacksmith-8vcpu-ubuntu-2404"], + } def test_kvm_package_aarch64_linux(self): pkg: NixEvalJobsOutput = { @@ -121,8 +120,7 @@ def test_kvm_package_aarch64_linux(self): } result = get_runner_for_package(pkg) assert result == { - "group": "self-hosted-runners-nix", - "labels": ["aarch64-linux"], + "labels": ["blacksmith-8vcpu-ubuntu-2404-arm"], } def test_large_package_x86_64_linux(self): From 403b637ea22fcbc1be35b53dd3ad416af300c8e2 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 14:11:47 -0400 Subject: [PATCH 4/8] fix: memory and runner size --- nix/ext/tests/default.nix | 4 ++++ nix/packages/github-matrix/github_matrix.py | 2 +- nix/packages/github-matrix/tests/test_github_matrix.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 4b6915762..79415c20f 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -71,6 +71,10 @@ let nodes.server = { config, ... }: { + # VM resources — sized for nested virtualisation on ephemeral CI runners + virtualisation.memorySize = 4096; + virtualisation.cores = 2; + services.openssh = { enable = true; }; diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 6ee6ba197..892eed62a 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -70,7 +70,7 @@ class NixEvalError(TypedDict): BUILD_RUNNER_MAP: Dict[RunnerType, Dict[System, RunsOnConfig]] = { "ephemeral": { "aarch64-linux": { - "labels": ["blacksmith-8vcpu-ubuntu-2404-arm"], + "labels": ["blacksmith-16vcpu-ubuntu-2404-arm"], }, "x86_64-linux": { "labels": ["blacksmith-8vcpu-ubuntu-2404"], diff --git a/nix/packages/github-matrix/tests/test_github_matrix.py b/nix/packages/github-matrix/tests/test_github_matrix.py index e442ed9d7..d2496cbfa 100644 --- a/nix/packages/github-matrix/tests/test_github_matrix.py +++ b/nix/packages/github-matrix/tests/test_github_matrix.py @@ -120,7 +120,7 @@ def test_kvm_package_aarch64_linux(self): } result = get_runner_for_package(pkg) assert result == { - "labels": ["blacksmith-8vcpu-ubuntu-2404-arm"], + "labels": ["blacksmith-16vcpu-ubuntu-2404-arm"], } def test_large_package_x86_64_linux(self): @@ -210,7 +210,7 @@ def test_default_aarch64_linux(self): "system": "aarch64-linux", } result = get_runner_for_package(pkg) - assert result == {"labels": ["blacksmith-8vcpu-ubuntu-2404-arm"]} + assert result == {"labels": ["blacksmith-16vcpu-ubuntu-2404-arm"]} class TestSortPkgsByClosures: From 8bd9367926c960cd4100435e8bbe0fcfe39f3c05 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 14:17:09 -0400 Subject: [PATCH 5/8] fix: try to avoid runner OOM --- nix/packages/github-matrix/github_matrix.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 892eed62a..288ee0ee3 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -85,7 +85,9 @@ class NixEvalError(TypedDict): } -def build_nix_eval_command(max_workers: int, flake_outputs: List[str]) -> List[str]: +def build_nix_eval_command( + max_workers: int, max_memory_size: int, flake_outputs: List[str] +) -> List[str]: """Build the nix-eval-jobs command with appropriate flags.""" nix_eval_cmd = [ "nix-eval-jobs", @@ -100,6 +102,8 @@ def build_nix_eval_command(max_workers: int, flake_outputs: List[str]) -> List[s "--option", "accept-flake-config", "true", + "--max-memory-size", + str(max_memory_size), "--workers", str(max_workers), "--select", @@ -164,7 +168,7 @@ def run_nix_eval_jobs( Returns: Tuple of (packages, warnings_list, errors_list) """ - debug(f"Running command: {' '.join(cmd)}") + print(f"Running: {' '.join(cmd)}", file=sys.stderr) # Disable colors in nix output env = os.environ.copy() @@ -279,6 +283,12 @@ def main() -> None: parser = argparse.ArgumentParser( description="Generate GitHub Actions matrix for Nix builds" ) + parser.add_argument( + "--max-memory-size", + default=3072, + type=int, + help="Maximum memory per eval worker in MiB. Defaults to 3072 (3 GiB).", + ) parser.add_argument( "flake_outputs", nargs="+", help="Nix flake outputs to evaluate" ) @@ -287,7 +297,7 @@ def main() -> None: max_workers: int = os.cpu_count() or 1 - cmd = build_nix_eval_command(max_workers, args.flake_outputs) + cmd = build_nix_eval_command(max_workers, args.max_memory_size, args.flake_outputs) # Run evaluation and collect packages, warnings, and errors packages, warnings_list, errors_list = run_nix_eval_jobs(cmd) From 217f38b563e0568c7c6a407a3c714123421c84a2 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 18:45:33 -0400 Subject: [PATCH 6/8] fix: if not kvm 8vcpu --- nix/packages/github-matrix/github_matrix.py | 4 +++- nix/packages/github-matrix/tests/test_github_matrix.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 288ee0ee3..e5c39ae6b 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -70,7 +70,7 @@ class NixEvalError(TypedDict): BUILD_RUNNER_MAP: Dict[RunnerType, Dict[System, RunsOnConfig]] = { "ephemeral": { "aarch64-linux": { - "labels": ["blacksmith-16vcpu-ubuntu-2404-arm"], + "labels": ["blacksmith-8vcpu-ubuntu-2404-arm"], }, "x86_64-linux": { "labels": ["blacksmith-8vcpu-ubuntu-2404"], @@ -262,6 +262,8 @@ def get_runner_for_package(pkg: NixEvalJobsOutput) -> RunsOnConfig | None: if is_kvm_pkg(pkg): if system == "aarch64-darwin": return BUILD_RUNNER_MAP["self-hosted"]["aarch64-darwin"] + if system == "aarch64-linux": + return {"labels": ["blacksmith-16vcpu-ubuntu-2404-arm"]} runConfig = BUILD_RUNNER_MAP["ephemeral"].get(system) if runConfig is None: raise ValueError( diff --git a/nix/packages/github-matrix/tests/test_github_matrix.py b/nix/packages/github-matrix/tests/test_github_matrix.py index d2496cbfa..7db3b3c63 100644 --- a/nix/packages/github-matrix/tests/test_github_matrix.py +++ b/nix/packages/github-matrix/tests/test_github_matrix.py @@ -210,7 +210,7 @@ def test_default_aarch64_linux(self): "system": "aarch64-linux", } result = get_runner_for_package(pkg) - assert result == {"labels": ["blacksmith-16vcpu-ubuntu-2404-arm"]} + assert result == {"labels": ["blacksmith-8vcpu-ubuntu-2404-arm"]} class TestSortPkgsByClosures: From 9d67c91b0be06f374ce2d304012a9e2db798263a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 19:28:00 -0400 Subject: [PATCH 7/8] tests: tmp var to trigger rebuild will revert --- nix/ext/tests/lib.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/ext/tests/lib.nix b/nix/ext/tests/lib.nix index 8a6a4ea64..9c268f35f 100644 --- a/nix/ext/tests/lib.nix +++ b/nix/ext/tests/lib.nix @@ -285,6 +285,7 @@ let environment = { GRN_PLUGINS_DIR = "${groongaPackage}/lib/groonga/plugins"; LANG = "en_US.UTF-8"; + BLACKSMITH_MIGRATION = "1"; }; }; From c96342ee37153e9287d357676747244ab2109cf7 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sat, 14 Mar 2026 19:53:51 -0400 Subject: [PATCH 8/8] fix: allow vm tests locally for macos but not in ci --- nix/packages/github-matrix/github_matrix.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index e5c39ae6b..e258b61bf 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -148,10 +148,9 @@ def parse_nix_eval_line( return Err({"attr": data["attr"], "error": error_msg}) if data["drvPath"] in drv_paths: return Ok(None) - if ( - "nixos-test" in data.get("requiredSystemFeatures", []) - and data["system"] == "x86_64-linux" - ): + if "nixos-test" in data.get("requiredSystemFeatures", []) and data[ + "system" + ] in ("x86_64-linux", "aarch64-darwin"): return Ok(None) drv_paths.add(data["drvPath"]) return Ok(data)