Skip to content

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

Merged
dan-zheng merged 1 commit into
swiftlang:masterfrom
dan-zheng:build-toolchain-xcode-fix
Jan 7, 2020
Merged

Make utils/build-toolchain compatible with Xcode new build system.#29025
dan-zheng merged 1 commit into
swiftlang:masterfrom
dan-zheng:build-toolchain-xcode-fix

Conversation

@dan-zheng
Copy link
Copy Markdown
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.
Comment thread utils/build-toolchain
MONTH=$(date +"%m")
DAY=$(date +"%d")
TOOLCHAIN_VERSION="swift-LOCAL-${YEAR}-${MONTH}-${DAY}-a"
TOOLCHAIN_VERSION="5.0.${YEAR}${MONTH}${DAY}"
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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