[bugfix] iOS: wordexp/wordfree unavailable and missing env() implementation#561
Open
uilianries wants to merge 2 commits into
Open
[bugfix] iOS: wordexp/wordfree unavailable and missing env() implementation#561uilianries wants to merge 2 commits into
uilianries wants to merge 2 commits into
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
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.
Greetings! 👋
When building Boost 1.91.0 on Mac M1 (aarch64) for iOS with Apple clang, it fails to build Boost.Process with two independent errors:
1. The functions
wordexpandwordfreeare unavailable on iOSApple iOS/tvOS/watchOS SDKs ship
<wordexp.h>(inherited from the shared Apple SDK headers), but explicitly markwordexp()/wordfree()as unavailable there:The full build error can be seen here: boost-1.91.0-ios-shared-process-wordexp.log
The
shell.cppalready guards against__OpenBSD__and__ANDROID__https://github.com/boostorg/process/blob/boost-1.91.0/src/shell.cpp#L22
Similar to #440, it's just missing the same guard for Apple's non-macOS targets like
iphone.The commit ecca6b2 extends that rule to include Apple platforms that are not
darwin. We need to includeTargetConditionals.hto makeTARGET_OS_OSXavailable.Reference: https://developer.apple.com/documentation/xcode/running-code-on-a-specific-version#Compile-code-for-a-specific-platform
2. Function
ext::envis never defined for iOSOnce the commit ecca6b2 is applied, the previously mentioned error no longer occurs, but a new error shows later during the linkage stage:
You can see the build log with this error here: boost-1.91.0-ios-shared-process-env.log
The
env.cppalready correctly excludes iOS with#elif (defined(__APPLE__) && defined(__MACH__)) && !TARGET_OS_IOS, but no replacement forext::envwas added for the iOS case, so on iOS execution falls through every#elifwith none matching, the symbols result as undefined.The commit beec496 adds an iOS-specific implementation of
ext::envthat returnsENOTSUP, mirroring OpenBSD/Android.Both changes only affect Apple non-macOS targets; for b2, they are
iphoneandappletv. I validated both thesharedandstaticlink variants build on iOS 26.5 / Apple clang 21.0.0 with this patch applied to Boost 1.91.0. You can check my build logs with this patch:Steps to Reproduce
My
user-config.jamlooks like:Environment
This PR is related to #401.
Feel free to ask for more information about this case if needed. Regards!