Repository navigation
aws-lc: allow building with prefixed symbols - #581545
Conversation
| (lib.cmakeBool "DISABLE_GO" true) | ||
| (lib.cmakeBool "DISABLE_PERL" true) | ||
| (lib.cmakeBool "GENERATE_RUST_BINDINGS" withRustBindings) | ||
| (lib.cmakeBool "ENABLE_DIST_PKG" true) |
There was a problem hiding this comment.
I'm not entirely sure if we should also default to true here for the unprefixed version.
I don't know how much explodes if we do.
ee67e04 to
95c41ae
Compare
whispersofthedawn
left a comment
There was a problem hiding this comment.
overall this seems fine, but unfortunately the handling of distribution packaging is a bit broken on macos. we've proposed what we think is a reasonable fix.
also left a few non-blocking comments about metadata and tests, but feel free to leave those for a follow-up if we just want to get this fixed quickly. we can handle cleaning those up.
Runs the full test suite. Co-authored-by: whispers <[email protected]>
af690f5 to
d57865c
Compare
Symbol prefixing avoids collisions with other libraries from the OpenSSL
family in the same process.
It can be turned off if needed using `aws-lc.override { symbolPrefix = null; }`
d57865c to
c1837a7
Compare
Needs __darwinAllowLocalNetworking, otherwise tests would fail on darwin.
c1837a7 to
f714166
Compare
fixes `newsflash` after NixOS#581545
Fixes build broken after NixOS#581545.
fixes `newsflash` after NixOS#581545
nixpkgs' cargoSetupHook now forces common C libraries to come from nixpkgs instead of being vendored (NixOS/nixpkgs#537108). The pinned nixpkgs does not carry that hook yet, so add both the inputs and the env vars the hook would export; behaviour stays as it is today, and the packages keep working once the pin moves to a revision that has the hook. 38 packages get pkg-config plus the libraries their Cargo.lock resolves to (aws-lc, oniguruma, openssl, sqlite, zstd, libgit2, libssh2, zlib, jemalloc). pkg-config is now unconditional in annot and nono, where it was Linux-only. JEMALLOC_OVERRIDE names jemalloc's shared library rather than a bare basename, because the hook's sentinel path does not exist and tikv-jemalloc-sys asserts that the path it is given exists. but and gitbutler opt out with dontCargoUseSystemLibs: they enable git2's unstable-sha256, so libgit2-sys probes a libgit2-experimental pkg-config module that nixpkgs does not ship. code and codex link both aws-lc-sys and openssl-sys. The aws-lc in this nixpkgs still ships an openssl.pc shim, so openssl-sys resolves to AWS-LC and then wants the bindgen CLI. NixOS/nixpkgs#581545 removed that shim, but it is only on master and nixos-unstable: the pinned nixpkgs-unstable branch, and the pending bump to 4fe25e12, still carry the old aws-lc, so these two stay broken until a later pin. Not worked around here on purpose. funes and jscpd deliberately get no openssl: their openssl-sys sits behind a ureq/native-tls feature that is most likely disabled. Verified without building: nix-instantiate --parse on every file, nix eval of each drvPath, and the resulting .drv files carry the new inputs and env names.
|
This broke the static build. $ nix-build -A pkgsStatic.aws-lc
these 2 derivations will be built:
/nix/store/ywfbhsynh7fbqb2nrzdnv0h0syh3m04d-aws-lc-symbols.drv
/nix/store/9k73wq0b8ra9v8dhh5mgg3zfj3rfilhs-aws-lc-static-x86_64-unknown-linux-musl-5.12.0.drv
building '/nix/store/ywfbhsynh7fbqb2nrzdnv0h0syh3m04d-aws-lc-symbols.drv'...
# command-line-arguments
loadinternal: cannot find runtime/cgo
/nix/store/3rfsjk1bck6zill4h0kpbm5434k975nv-go-1.27.3/share/go/pkg/tool/linux_amd64/link: running gcc failed: exec: "gcc": executable file not found in $PATH
gcc -m64 -s -o $WORK/b001/exe/read_symbols -rdynamic /build/go-link-3598427188/go.o
error: Cannot build '/nix/store/ywfbhsynh7fbqb2nrzdnv0h0syh3m04d-aws-lc-symbols.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/99g8s88vdn778rvj0aj3im38gjpm5bfp-aws-lc-symbols
error: Cannot build '/nix/store/9k73wq0b8ra9v8dhh5mgg3zfj3rfilhs-aws-lc-static-x86_64-unknown-linux-musl-5.12.0.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/c1w2d4ql1w6zqi66sgczyl33qrsqbclm-aws-lc-static-x86_64-unknown-linux-musl-5.12.0
/nix/store/cp984kj9sz4kzfj0sz8c3xh4sx47vx58-aws-lc-static-x86_64-unknown-linux-musl-5.12.0-dev
/nix/store/j4w5c4v43ifzvcam3mp4vhfz8pkkp3zy-aws-lc-static-x86_64-unknown-linux-musl-5.12.0-bin |
|
known, fixed on staging. unfortunately our go cross is kind of cursed and requires lots of hacks to make work nicely. |
❌
|
fixes `newsflash` after NixOS/nixpkgs#581545
With NixOS/nixpkgs#581545 in nixpkgs-unstable, aws-lc no longer ships the compat openssl.pc, so the check on aws-lc.meta.pkgConfigModules is not needed. Add openssl next to libcap; openssl-sys is only in the Linux dependency tree. On the current nixpkgs pin, where aws-lc still ships openssl.pc, codex still builds on x86_64-linux and passes versionCheckHook.
|
This PR title seems misleading. This is a major breaking change to any existing users of the I also don't understand the motivation. This support upstream is to allow installing AWS-LC in parallel with OpenSSL, but this is already possible on Nix. In fact, it was previously trivial to switch on a per-application basis using |
|
unfortunately, it's only possible-ish to install aws-lc and openssl in parallel. while it's certainly possible to have both installed on the same system, linking aws-lc and openssl into the same binary often causes symbol conflicts, where functionality from one impl silently gets swapped for another or other incorrect behaviors like that. while this would not be a concern in the ideal world, many upstreams are simply not principled with their dep trees. it's very often that rust packages will pull in native-tls from one dependency and rustls+aws-lc from another, for example. that ends up being a much more insidious failure mode in my opinion. thus, we defaulted to the often-but-not-always compatible approach, with a fallback flag to go back to the openssl-shim-like behavior. ideally this is a problem we'd not have to deal with at all, but unfortunately openssl occupies a somewhat privileged position as the "original" fork and being the libcrypto/libssl in most linux-y spaces. additionally, it's simply not the case that aws-lc is a drop-in replacement for openssl. they've stripped out old algorithms, implemented various functionality differently, are at best compatible with openssl 1.1.1, etc. i certainly don't think it makes sense to assume |
|
When will the fix finally land? This has been broken for 3 weeks now. |
|
The fix for what? |
|
You could have easily scrolled the thread to find that out, but here it is again. $ nix-build -A pkgsStatic.aws-lc
these 2 derivations will be built:
/nix/store/4wc5vmwqgx83p1dbk9n0rxvkdm8b616n-aws-lc-symbols.drv
/nix/store/bsrv9jmcgwlg3dyzb535m1xm6zhbaxnj-aws-lc-static-x86_64-unknown-linux-musl-5.12.0.drv
building '/nix/store/4wc5vmwqgx83p1dbk9n0rxvkdm8b616n-aws-lc-symbols.drv'...
# command-line-arguments
loadinternal: cannot find runtime/cgo
/nix/store/3rfsjk1bck6zill4h0kpbm5434k975nv-go-1.27.3/share/go/pkg/tool/linux_amd64/link: running gcc failed: exec: "gcc": executable file not found in $PATH
gcc -m64 -s -o $WORK/b001/exe/read_symbols -rdynamic /build/go-link-3153121103/go.o
error: Cannot build '/nix/store/4wc5vmwqgx83p1dbk9n0rxvkdm8b616n-aws-lc-symbols.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/bsv9xfwc3vsn1h62nziisj6q90n4zmzh-aws-lc-symbols
Last 5 log lines:
> # command-line-arguments
> loadinternal: cannot find runtime/cgo
> /nix/store/3rfsjk1bck6zill4h0kpbm5434k975nv-go-1.27.3/share/go/pkg/tool/linux_amd64/link: running gcc failed: exec: "gcc": executable file not found in $PATH
> gcc -m64 -s -o $WORK/b001/exe/read_symbols -rdynamic /build/go-link-3153121103/go.o
>
For full logs, run:
nix log /nix/store/4wc5vmwqgx83p1dbk9n0rxvkdm8b616n-aws-lc-symbols.drv
error: Cannot build '/nix/store/bsrv9jmcgwlg3dyzb535m1xm6zhbaxnj-aws-lc-static-x86_64-unknown-linux-musl-5.12.0.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/dmc0v5w219q3n6mk3vk16pz81rrizbma-aws-lc-static-x86_64-unknown-linux-musl-5.12.0-dev
/nix/store/lkzy7qgbs8i3fpqhhdryjsrdvgacpj82-aws-lc-static-x86_64-unknown-linux-musl-5.12.0-bin
/nix/store/mi8xf49vg7pqik2x0s90ah2c6y7xssm6-aws-lc-static-x86_64-unknown-linux-musl-5.12.0 |
|
it will likely land on master within a day or two. it's part of #588926 |
It is misleading because in the initial version of the PR, building with prefixed symbols was not the default. |
|
Today/Monday, surely. The NixOS 26.11 release process depends on that merge. |
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.