-
Notifications
You must be signed in to change notification settings - Fork 94
Fix Darwin builds for non-standard environments (e.g. Nix) #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #941 +/- ##
==========================================
- Coverage 95.80% 92.56% -3.24%
==========================================
Files 61 74 +13
Lines 8143 9893 +1750
Branches 0 9893 +9893
==========================================
+ Hits 7801 9157 +1356
- Misses 342 455 +113
- Partials 0 281 +281 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4311944 to
8b5ae80
Compare
8b5ae80 to
f745e7d
Compare
|
@martinjlowm -- Sorry, I've not had time to follow up with adding a test. I did push an update to this PR to conditionally set the define in a couple of places. Can you confirm whether this latest change fixes the problem for you? |
Hey! crate2nix doesn't support Cargo patches through prefetching, so I'd have to assume the minimal reproducible environment is sufficient for considering this change enough for fixing the problem. That being said, it builds by referencing a85d004 ✌️ |
Issues:
Not reported.
Description of changes:
aws-ls-sysfails to build via Nix (crate2nix) due to missing typedefs, presumably because the Clang used from the Nix sandbox doesn't set-D_DARWIN_C_SOURCE.The content of interest is https://github.com/alexey-lysiuk/macos-sdk/blob/main/MacOSX26.1.sdk/usr/include/sys/types.h#L83-L96 which doesn't evaluate unless
_DARWIN_C_SOURCEis set. The first POSIX branch is set because__STDC_ALLOC_LIB__isn't: https://github.com/aws/aws-lc/blob/main/crypto/err/err.c#L113C8-L117I suppose
_POSIX_C_SOURCEwas set for a reason and I can't figure out why a normal Cargo build would work - I cannot find any trace of__STDC_ALLOC_LIB__- apart from a comment in #610.The absence of
_DARWIN_C_SOURCEcauses the CC builder to throw:Call-outs:
This is unfamiliar territory for me. I don't know if configuring
_POSIX_C_SOURCEappropriately is the better option.Testing:
N/A
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.