-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Priority: MediumImportant tasks, but not urgentImportant tasks, but not urgent
Description
Description
Tests in bccsp/hybrid currently succeed on macOS only when specific CGO environment variables are manually set to link OpenSSL. This indicates that OpenSSL is not being linked automatically, even though liboqs depends on it.
At the moment, the build implicitly relies on local environment configuration, which is fragile and not portable.
Local workaround (current state)
The following environment variables are required locally to make the build and tests pass:
export CGO_ENABLED=1
export CGO_CFLAGS="-I/opt/homebrew/opt/openssl@3/include"
export CGO_LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib -lssl -lcrypto"Possible solutions
- (Recommended) Use
pkg-configin CGO directives (e.g.,// #cgo pkg-config: liboqs openssl) so that OpenSSL is linked automatically across macOS, Linux, and CI. - Add OS-specific CGO flags guarded by build tags (e.g.,
darwin) ifpkg-configcannot be assumed. - As a fallback, document the required CGO environment variables in the README (least robust option).
Notes
- Issue observed on macOS (arm64, Homebrew OpenSSL 3).
- Error manifests as undefined OpenSSL symbols during the linking stage.
- Tests pass once OpenSSL is explicitly linked via CGO flags.
Metadata
Metadata
Assignees
Labels
Priority: MediumImportant tasks, but not urgentImportant tasks, but not urgent