You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build a statically compiled openshift-tests extension binary.
Static compilation is done because [1]:
> Extension binaries are extracted from container images into a
> running Pod executing openshift-tests. Contributors do not
> necessarily know which version of RHEL the openshift-tests
> binary will be running on, so, for maximum portability,
> test extension binaries should be statically compiled.
The `GO_COMPLIANCE_POLICY="exempt_all"` is set because [1]:
> For compliance reasons, when a binary is compiled by a golang
> builder image supplied by ART, a wrapper around the go compiler
> will force FIPS compliant compilation (e.g. dynamic linking).
> For this reason, extension binaries should include
> GO_COMPLIANCE_POLICY="exempt_all" in the environment when
> compiling an extension binary. This will inhibit the wrapper from
> modifying CGO_ENABLED or other compiler arguments required for
> static compilation.
Set `CGO_ENABLED=0` to disable the use of cgo to allow
the static compilation. Otherwise, the binary is dynamically linked.
As such the usage cgo is disabled by default in the binary.
Verifying whether such a binary is built statically:
```sh
$ ldd _output/linux/amd64/openshift-tests-extension
not a dynamic executable
```
Format of the github.com/openshift-eng/openshift-tests-extension variables
is based on the existing Makefile [2] in the openshift-tests-extension repository.
[1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
[2]: https://github.com/openshift-eng/openshift-tests-extension/blob/86b9979c22fd7b5022cef0e57312eda54e6e3064/Makefile
0 commit comments