microsoft / regorus

Regorus - A fast, lightweight Rego (OPA policy language) interpreter written in Rust.
MIT License
106 stars 27 forks source link

Avoid build dependency on git if opa.runtime feature is not enabled #193

Closed anakrish closed 3 months ago

anakrish commented 3 months ago

opa.runtime builtin function requires the GIT_HASH value of the latest commit and hence requires git.

Sometimes, the docker containers used for building may not have git installed. E.g.: https://github.com/confidential-containers/trustee/pull/357#issuecomment-2033183370 This causes a build error.

To solve this, If opa.runtime feature is not enabled, don't require a dependency on git. We could also try parsing git-hash ourselves, but it doesn't seem worth the trouble now.