Skip to content

[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

Merged

Conversation

johnno1962
Copy link
Contributor

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.

@jrose-apple jrose-apple requested a review from zisko September 24, 2018 22:34
@@ -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}"
Copy link
Contributor

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.

Copy link
Contributor Author

@johnno1962 johnno1962 Sep 24, 2018

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?

Copy link
Contributor

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?

Copy link
Contributor

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}?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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>

@johnno1962 johnno1962 force-pushed the toolchain-new-build-system branch 3 times, most recently from 6924655 to 26fa25c Compare September 25, 2018 19:13
@johnno1962 johnno1962 force-pushed the toolchain-new-build-system branch from 26fa25c to fd07657 Compare September 25, 2018 21:39
@aciidgh
Copy link
Contributor

aciidgh commented Sep 26, 2018

@swift-ci smoke test

@aciidgh
Copy link
Contributor

aciidgh commented Sep 28, 2018

@swift-ci smoke test macOS

@johnno1962
Copy link
Contributor Author

Bump.

@jrose-apple jrose-apple requested a review from Rostepher October 2, 2018 23:00
Copy link
Contributor

@Rostepher Rostepher left a 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! 👍

@jrose-apple jrose-apple merged commit d5deefa into swiftlang:master Oct 4, 2018
@jrose-apple
Copy link
Contributor

Thanks, John!

@johnno1962
Copy link
Contributor Author

👍 👍

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.

4 participants