You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to build SwiftPM (swift-5.1.2-RELEASE) and the CC environment variable is set to an non-absolute path (e.g. CC=clang), SwiftPM fails to build:
Additionally, the resolving of symlinks (which os.path.realpath does) is also problematic. In some cases where shims are used (e.g. Homebrew), even passing in an absolute path will fail (e.g. CC=/usr/local/Homebrew/Library/Homebrew/shims/mac/super/cc). This particular example would be resolved by the bootstrap script to /usr/local/Homebrew/Library/Homebrew/shims/super/cc which breaks relative lookups in /usr/local/Homebrew/Library/Homebrew/shims/mac/super:
$ /usr/local/Homebrew/Library/Homebrew/shims/super/ccTraceback (mostrecentcalllast):
1: from /usr/local/Homebrew/Library/Homebrew/shims/super/cc:443:in `<main>'
/usr/local/Homebrew/Library/Homebrew/shims/super/cc:443:in `exec': No such file or directory - /usr/local/Homebrew/Library/Homebrew/shims/super/xcrun (Errno::ENOENT)
The text was updated successfully, but these errors were encountered:
Environment
macOS 10.14.6 (18G1012)
Xcode 11.1
swift-5.1.2-RELEASE (source build)
Additional Detail from JIRA
md5: 5e2cf6afa79e6152ee20a28a0df6da8b
Issue Description:
When attempting to build SwiftPM (swift-5.1.2-RELEASE) and the CC environment variable is set to an non-absolute path (e.g.
CC=clang
), SwiftPM fails to build:Such build environment broke after the fix to SR-10633 (#2159) due to the use of
os.path.realpath
(https://github.com/apple/swift-package-manager/blob/swift-5.1.2-RELEASE/Utilities/bootstrap#L740), which fails to take$PATH
into account. In the example above, the bootstrap script is taking clang to be relative to the working directory, which is not correct.Additionally, the resolving of symlinks (which
os.path.realpath
does) is also problematic. In some cases where shims are used (e.g. Homebrew), even passing in an absolute path will fail (e.g.CC=/usr/local/Homebrew/Library/Homebrew/shims/mac/super/cc
). This particular example would be resolved by the bootstrap script to/usr/local/Homebrew/Library/Homebrew/shims/super/cc
which breaks relative lookups in/usr/local/Homebrew/Library/Homebrew/shims/mac/super
:The text was updated successfully, but these errors were encountered: