Merge pull request #172359 from 06kellyjac/opa_zhf

open-policy-agent: 0.38.1 -> 0.40.0
main
davidak 2 years ago committed by GitHub
commit faf0dd948f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      pkgs/development/tools/open-policy-agent/default.nix

@ -1,4 +1,5 @@
{ lib { lib
, stdenv
, buildGoModule , buildGoModule
, fetchFromGitHub , fetchFromGitHub
, installShellFiles , installShellFiles
@ -6,15 +7,17 @@
, enableWasmEval ? false , enableWasmEval ? false
}: }:
assert enableWasmEval && stdenv.isDarwin -> builtins.throw "building with wasm on darwin is failing in nixpkgs";
buildGoModule rec { buildGoModule rec {
pname = "open-policy-agent"; pname = "open-policy-agent";
version = "0.38.1"; version = "0.40.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "open-policy-agent"; owner = "open-policy-agent";
repo = "opa"; repo = "opa";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-x8mSlZ2X0DdkhaW5QXs5axERJkwARu8tHueQHXfamXM="; sha256 = "sha256-rLfo2SUlxL6QFc2v+nxFnbyYcfy7i3OFhGt6ZAUteHY=";
}; };
vendorSha256 = null; vendorSha256 = null;
@ -35,12 +38,13 @@ buildGoModule rec {
# Feed in all but the e2e tests for testing # Feed in all but the e2e tests for testing
# This is because subPackages above limits what is built to just what we # This is because subPackages above limits what is built to just what we
# want but also limits the tests # want but also limits the tests
# Also avoid wasm tests on darwin due to wasmtime-go build issues
getGoDirs() { getGoDirs() {
go list ./... | grep -v e2e go list ./... | grep -v -e e2e ${lib.optionalString stdenv.isDarwin "-e wasm"}
} }
'' + lib.optionalString stdenv.isDarwin ''
# Remove test case that fails on < go1.17 # resolve "too many open files" errors during the tests on darwin
rm test/cases/testdata/cryptox509parsecertificates/test-cryptox509parsecertificates-0123.yaml ulimit -n 1024
''; '';
postInstall = '' postInstall = ''
@ -66,6 +70,7 @@ buildGoModule rec {
''; '';
meta = with lib; { meta = with lib; {
mainProgram = "opa";
homepage = "https://www.openpolicyagent.org"; homepage = "https://www.openpolicyagent.org";
changelog = "https://github.com/open-policy-agent/opa/blob/v${version}/CHANGELOG.md"; changelog = "https://github.com/open-policy-agent/opa/blob/v${version}/CHANGELOG.md";
description = "General-purpose policy engine"; description = "General-purpose policy engine";

Loading…
Cancel
Save