NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.27k stars 14.25k forks source link

open-policy-agent: build wasm file from source #243822

Open folliehiyuki opened 1 year ago

folliehiyuki commented 1 year ago

Issue description

Upstream repo includes a pre-built opa.wasm file (and a corresponding generated opa.go file). They will be added to the binary upon using opa_wasm tag.

Solution

We should build that wasm file from source, if possible. The source code and Makefile for it is under wasm/ directory. I'm having a hard time making it built on AlpineLinux though. My attempt can be viewed at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/45318/diffs.

Side note: there is a variable github.com/open-policy-agent/opa/internal/report.ExternalServiceURL which controls where the binary will send background version checks. I'd love to see it being disabled (https://www.openpolicyagent.org/docs/latest/privacy/#external-service).

tomodachi94 commented 1 month ago

Pinging maintainers @nlewo and @06kellyjac.

06kellyjac commented 1 month ago

Thanks for the ping. I had no idea this ticket was raised.

All sounds good to me. I'll put it on my backlog for improving at some point.