diff options
Diffstat (limited to 'pkgs/development/tools/open-policy-agent/default.nix')
-rw-r--r-- | pkgs/development/tools/open-policy-agent/default.nix | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/development/tools/open-policy-agent/default.nix b/pkgs/development/tools/open-policy-agent/default.nix index 06161d95c4b2c..4b11dd7576ddf 100644 --- a/pkgs/development/tools/open-policy-agent/default.nix +++ b/pkgs/development/tools/open-policy-agent/default.nix @@ -2,12 +2,13 @@ , stdenv , buildGoModule , fetchFromGitHub +, fetchpatch , installShellFiles , enableWasmEval ? false }: -assert enableWasmEval && stdenv.isDarwin -> builtins.throw "building with wasm on darwin is failing in nixpkgs"; +assert enableWasmEval && stdenv.hostPlatform.isDarwin -> builtins.throw "building with wasm on darwin is failing in nixpkgs"; buildGoModule rec { pname = "open-policy-agent"; @@ -20,6 +21,15 @@ buildGoModule rec { hash = "sha256-fx7k6KvL0uy2NXLDLpCnN1ux9MGEO1CbX6TdLweVzag="; }; + patches = [ + # fix tests in 1.22.5 + # https://github.com/open-policy-agent/opa/pull/6845 + (fetchpatch { + url = "https://github.com/open-policy-agent/opa/commit/956358516c23b1f33f6667961e20aca65b91355b.patch"; + hash = "sha256-1nfMwJwbYfdLg9j4ppP1IWdDeFq6vhXcDKr6uprP53U="; + }) + ]; + vendorHash = null; nativeBuildInputs = [ installShellFiles ]; @@ -45,9 +55,9 @@ buildGoModule rec { # want but also limits the tests # Also avoid wasm tests on darwin due to wasmtime-go build issues getGoDirs() { - go list ./... | grep -v -e e2e ${lib.optionalString stdenv.isDarwin "-e wasm"} + go list ./... | grep -v -e e2e ${lib.optionalString stdenv.hostPlatform.isDarwin "-e wasm"} } - '' + lib.optionalString stdenv.isDarwin '' + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' # remove tests that have "too many open files"/"no space left on device" issues on darwin in hydra rm server/server_test.go ''; |