Skip to content

Make utils/build-toolchain compatible with Xcode new build system. #29025

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

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

dan-zheng
Copy link
Contributor

Xcode's new build system requires the Version entry in Info.plist to have a
particular date-based format.

Toolchains built using utils/build-toolchain now work with Xcode's new build
system.


Cherry-picks #28945 from tensorflow branch, with minor gardening.

Resolves this issue when opening Xcode:

2019-12-24 15:47:16.618 XCBBuildService[75398:12495542] /Library/Developer/Toolchains/swift-LOCAL-2020-01-06-a.xctoolchain: warning: failed to load toolchain: 'Version' parse error: Could not parse version component from: 'swift-LOCAL-2020-01-06-a'

See tensorflow/swift#350 for more info about the issue.


Someone discovered this issue in utils/build-toolchain on the forums but didn't submit a fix.

Xcode's new build system requires the Version entry in Info.plist to have a
particular date-based format.

Toolchains built using utils/build-toolchain now work with Xcode's new build
system.
@@ -98,15 +98,15 @@ set -x
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
TOOLCHAIN_VERSION="swift-LOCAL-${YEAR}-${MONTH}-${DAY}-a"
TOOLCHAIN_VERSION="5.0.${YEAR}${MONTH}${DAY}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the toolchain version format was copied from Info.plist from macOS toolchains from https://swift.org/download.

The leading 5.0 component appears to refer to the current Swift version (which incidentally is no longer 5.0 for master HEAD).

I'm not sure how to make it programmatically refer to the current Swift version. Hardcoding it to 5.0 seems fine for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could generate this file from CMake. There is no way to do this currently. I think that this is reasonable.

@dan-zheng dan-zheng requested a review from compnerd January 6, 2020 19:44
@dan-zheng
Copy link
Contributor Author

util/build-toolchain is not tested by CI, AFAIK.
@swift-ci Please smoke test

@dan-zheng dan-zheng merged commit 2e7e81e into swiftlang:master Jan 7, 2020
@dan-zheng dan-zheng deleted the build-toolchain-xcode-fix branch January 7, 2020 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants