-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Utils] Fix problem preventing new build system from using custom toolchains #19509
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
[Utils] Fix problem preventing new build system from using custom toolchains #19509
Conversation
utils/build-toolchain
Outdated
@@ -97,6 +97,7 @@ YEAR=$(date +"%Y") | |||
MONTH=$(date +"%m") | |||
DAY=$(date +"%d") | |||
TOOLCHAIN_VERSION="swift-LOCAL-${YEAR}-${MONTH}-${DAY}-a" | |||
DARWIN_TOOLCHAIN_VERSION="4.2.${YEAR}${MONTH}${DAY}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about this "4.2". The master branch isn't 4.2-ish anymore, but even without that it's one more place where a version number gets hardcoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll change it to 5.0 but it’s difficult to know the alternative is other than adding another option and making the script more difficult to use. What does the new build system use this string for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want an alternative; we want it inferred from some other part of the compiler.
@aciidb0mb3r, anything you can share?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like its using the version for anything very "important". It uses it to handle conflicts between alias names. It is fine as long as you use numbers separated by dots. Maybe just use ${YEAR}.${MONTH}.${DAY}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this seems to work fine (though it has the feeling of something that might break someone's assumptions further down the line.) New amend pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do the same thing as the swift-syntax versions? 0.MAJOR_MINOR_PATCH.YEAR_MONTH_DAY
? Or maybe 0.0.YEAR_MONTH_DAY
for now, since we don't have a good way to get the version in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version number is probably not going to matter in practice unless someone starts depending on it. I like Jordan's 0.0.YEAR_MONTH_DAY
idea though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.0.YEAR_MONTH_DAY it is then, commit amended. New build system seems happy enough.
<key>Version</key>
<string>0.0.2018_09_25</string>
6924655
to
26fa25c
Compare
26fa25c
to
fd07657
Compare
@swift-ci smoke test |
@swift-ci smoke test macOS |
Bump. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! 👍
Thanks, John! |
👍 👍 |
I’ve been having problems getting the new build system to recognise custom toolchains built with the script ~swift/utils/build-toolchain.
I noticed the following error can be display when using xcodebuild:
2018-09-24 12:44:03.242 XCBBuildService[9852:6532021] /Library/Developer/Toolchains/swift-LOCAL-2018-03-24-a.xctoolchain: warning: failed to load toolchain: 'Version' parse error: Could not parse version component from: 'swift-LOCAL-2018-03-24-a’
This patch seems to resolve the problem and new/old build systems now work with custom toolchains.
Resolves rdar://43437044.