Skip to content

aws-lc: allow building with prefixed symbols - #581545

Merged
K900 merged 6 commits into
NixOS:staging-nextfrom
NyCodeGHG:push-ktskstvtlyur
Nov 1, 2026
Merged

K900 merged 6 commits into
NixOS:staging-nextfrom
NyCodeGHG:push-ktskstvtlyur

Conversation

@NyCodeGHG

Copy link
Copy Markdown
Member

Things done

(lib.cmakeBool "DISABLE_GO" true)
(lib.cmakeBool "DISABLE_PERL" true)
(lib.cmakeBool "GENERATE_RUST_BINDINGS" withRustBindings)
(lib.cmakeBool "ENABLE_DIST_PKG" true)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. labels Oct 31, 2026

@RossSmyth RossSmyth left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • built unprefix
  • tested unprefixed
  • built an npins with unprefixed
  • ldd shows awslc
  • npins works
  • built a prefixed aws-lc
  • prefixed tests pass
  • built trusttunnel-endpoint
  • ldd shows awslc
  • built exe prints version - doesn't explore

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 31, 2026

@whispersofthedawn whispersofthedawn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkgs/by-name/aw/aws-lc/package.nix Resolved
Comment thread pkgs/by-name/aw/aws-lc/package.nix Resolved
Comment thread pkgs/by-name/aw/aws-lc/package.nix Resolved
Comment thread pkgs/by-name/aw/aws-lc/package.nix Resolved
Comment thread pkgs/by-name/aw/aws-lc/package.nix Resolved
@NyCodeGHG
NyCodeGHG force-pushed the push-ktskstvtlyur branch 3 times, most recently from af690f5 to d57865c Compare November 1, 2026 12:38
@nixpkgs-ci
nixpkgs-ci Bot requested a review from vifino November 1, 2026 12:47
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; }`
Needs __darwinAllowLocalNetworking, otherwise tests would fail on darwin.
@K900
K900 added this pull request to the merge queue Nov 1, 2026
Merged via the queue into NixOS:staging-next with commit a857a8e Nov 1, 2026
28 checks passed
@NyCodeGHG
NyCodeGHG deleted the push-ktskstvtlyur branch November 1, 2026 16:19
@magneticflux- magneticflux- mentioned this pull request Nov 7, 2026
4 of 13 tasks
nixos-cuda-channel-updater Bot pushed a commit to nixos-cuda/nixpkgs that referenced this pull request Nov 8, 2026
@poli0iq poli0iq mentioned this pull request Nov 8, 2026
4 of 13 tasks
nixos-cuda-channel-updater Bot pushed a commit to nixos-cuda/nixpkgs that referenced this pull request Nov 8, 2026
liff pushed a commit to liff/nixpkgs that referenced this pull request Nov 8, 2026
XYenon added a commit to XYenon/llm-agents.nix that referenced this pull request Nov 9, 2026
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.
@whispersofthedawn whispersofthedawn mentioned this pull request Nov 9, 2026
7 of 13 tasks
@hmenke

hmenke commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

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

@whispersofthedawn

whispersofthedawn commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

known, fixed on staging. unfortunately our go cross is kind of cursed and requires lots of hacks to make work nicely.

@nixpkgs-review-gha

Copy link
Copy Markdown

❌ nixpkgs-review result

Generated using nixpkgs-review-gha (272fbe1)

Command: nixpkgs-review pr 581545 --pkgs=pkgsStatic --package=aws-lc
Commit: f714166ba2e671d98ad910b42427460b5330cd3b (subsequent changes)
Merge: a857a8e2b51d4df246b567ac8da5c84f747a4474

Triggered by @hmenke (1903556)
Logs: https://github.com/hmenke/nixpkgs-review-gha/actions/runs/43234482074/attempts/1


x86_64-linux

❌ 1 package failed to build:
  • pkgsStatic.aws-lc

aarch64-linux

❌ 1 package failed to build:
  • pkgsStatic.aws-lc

kira-bruneau pushed a commit to kira-bruneau/nur-packages that referenced this pull request Nov 16, 2026
garbas added a commit to garbas/llm-agents.nix that referenced this pull request Nov 17, 2026
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.
@leo60228

Copy link
Copy Markdown
Member

This PR title seems misleading. This is a major breaking change to any existing users of the aws-lc package.

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 package.override { openssl = aws-lc; }, which is no longer possible.

@whispersofthedawn

whispersofthedawn commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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 .override { openssl = aws-lc; } makes sense in the general case. however, for programs which do expect a standard libcrypto/libssl interface, and aws-lc works well enough, i think it'd be reasonable for us to expose an aws-lc-compat or aws-lc-shim package that is equal to aws-lc.override { withOpenSSLShim = true; symbolPrefix = null; }, or something like that. if that'd be useful to you, feel free to open a pr for that.

@hmenke

hmenke commented Nov 22, 2026

Copy link
Copy Markdown
Member

When will the fix finally land? This has been broken for 3 weeks now.

@K900

K900 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

The fix for what?

@hmenke

hmenke commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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

@whispersofthedawn

Copy link
Copy Markdown
Contributor

it will likely land on master within a day or two. it's part of #588926

@NyCodeGHG

Copy link
Copy Markdown
Member Author

This PR title seems misleading

It is misleading because in the initial version of the PR, building with prefixed symbols was not the default.
After discussions in the Staging matrix room we decided to do prefixing by default, I just forgot to update the PR title.

@vcunat

vcunat commented Nov 23, 2026

Copy link
Copy Markdown
Member

Today/Monday, surely. The NixOS 26.11 release process depends on that merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants