Repository navigation
fix(nix): the dev shell disables fortify hardening so jemalloc configures - #1614
Open
nikhilunni wants to merge 1 commit into
Open
nikhilunni wants to merge 1 commit into
nikhilunni wants to merge 1 commit into
Conversation
…ures The cc-wrapper's fortify hardening adds -D_FORTIFY_SOURCE to every C compile. Debug builds compile C at -O0, so glibc emits "_FORTIFY_SOURCE requires compiling with optimization". jemalloc's configure probes use -Werror, so each probe fails and configure stops with "cannot determine return type of strerror_r". A native Linux `cargo build` of engram-host-agent inside `nix develop` failed every time. musl does not emit the warning, so the musl cross targets were not affected. The dev shell only makes development builds; CI and the images do not build inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UHxL6gj4o8EvxYpgtwEWaM
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A native Linux build of
engram-host-agentinsidenix developfails every time in the jemalloc build script:config.logshows the cause:The Nix cc-wrapper's fortify hardening adds
-D_FORTIFY_SOURCEto every C compile. Debug builds compile C at-O0. jemalloc's configure probes compile with-Werror, so the glibc warning fails each probe. musl does not emit this warning, so the musl cross targets were not affected.Fix
hardeningDisable = [ "fortify" ]on the dev shell. The shell only makes development builds; CI and the image builds do not run inside it.Validation
nix develop:cargo build -p tikv-jemalloc-sysfails with the error above.cargo test --no-run -p engram-host-agentbuilds every test binary.nix develop, fresh target dir:cargo build --target aarch64-unknown-linux-musl -p tikv-jemalloc-sysbuilds.🤖 Generated with Claude Code
https://claude.ai/code/session_01UHxL6gj4o8EvxYpgtwEWaM