fix: set CXXFLAGS/SDKROOT so boring-sys compiles on macOS 26 (Tahoe) (#138)

macOS 26 moved libc++ headers inside the SDK, breaking Apple clang 17's
default header search. The boring-sys cmake step fails with
'fatal error: memory file not found' when building --features stealth.

Adding CXXFLAGS and SDKROOT to .cargo/config.toml [env] propagates them
to all build scripts (Cargo's documented mechanism), so cmake picks up the
SDK's C++ include path without any manual env-var ceremony.

force=false preserves CI overrides and Xcode users who already have
SDKROOT set. Non-macOS platforms ignore SDKROOT; clang silently skips
-isystem paths that do not exist on disk.

Fixes #136
This commit is contained in:
chebee7i authored and GitHub committed 2026-05-13 22:29:01 +02:00
1 parent c6f6ce2cc2
commit 1c295f5b32
1 file changed
+10
+10
View File
@@ -1,2 +1,12 @@
[env] [env]
RUST_TEST_THREADS = "1" RUST_TEST_THREADS = "1"
# macOS 26 (Tahoe) moved libc++ headers inside the SDK; Apple clang 17 no longer
# finds them at the old search path. This causes boring-sys's cmake step to fail
# when building with --features stealth. Setting CXXFLAGS and SDKROOT here makes
# them visible to all build scripts (including boring-sys's) so cmake can locate
# the headers. force=false lets CI or developers override via their shell env.
# Non-macOS platforms ignore SDKROOT; the -isystem path is silently skipped if
# it doesn't exist. See: https://github.com/h4ckf0r0day/obscura/issues/136
CXXFLAGS = { value = "-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1", force = false }
SDKROOT = { value = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", force = false }