From 59dd45742590ba664737d61e5bffeae37d8d9a4e Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Fri, 11 Jul 2025 14:53:45 -0400 Subject: [PATCH] tmc-cli: fix tests with Darwin sandbox --- pkgs/by-name/tm/tmc-cli/package.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/by-name/tm/tmc-cli/package.nix b/pkgs/by-name/tm/tmc-cli/package.nix index 03ec3a00e500..21d407b6729a 100644 --- a/pkgs/by-name/tm/tmc-cli/package.nix +++ b/pkgs/by-name/tm/tmc-cli/package.nix @@ -1,5 +1,6 @@ { lib, + stdenv, fetchFromGitHub, rustPlatform, writableTmpDirAsHomeHook, @@ -23,6 +24,16 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; + checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [ + # When sandboxing, "Attempted to create a NULL object." + # https://github.com/mullvad/system-configuration-rs/pull/59 may fix. + "--skip=commands::courses::tests::list_courses_with_client_test" + # Same + "--skip=all_integration_tests" + # When sandboxing, "Lazy instance has previously been poisoned." + "--skip=commands::exercises::tests::list_exercises_with_client_test" + ]; + nativeInstallCheckInputs = [ versionCheckHook ]; @@ -30,6 +41,8 @@ rustPlatform.buildRustPackage (finalAttrs: { versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}"; versionCheckProgramArg = "--version"; + __darwinAllowLocalNetworking = true; + meta = { description = "CLI for using the TestMyCode programming assignment evaluator"; homepage = "https://github.com/rage/tmc-cli-rust";