Skip to content

[swift-stage2] Point the API migrator at the correct directory when building/testing against a host toolchain. #38846

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

gottesmm
Copy link
Contributor

This involved adding a new substitution called %api_diff_data_dir that when
building against a host toolchain, looks in the host toolchain (next to swiftc)
rather than in the resource dir. The reason why I need to do this is this allows
me to perform a stdlib stage2 build without needing to build swift itself.

The only interesting changes here are that I had to add %api_diff_data_dir to
a bunch of normal/expected tests and also add %api_diff_data_dir's length to the
offsets in rdar31892850.swift.

@gottesmm gottesmm requested a review from benlangmuir August 11, 2021 20:53
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

test/lit.cfg Outdated
api_diff_data_dir_flag = ''
if config.testing_against_host_compiler:
migrator_dir = os.path.join(os.path.dirname(config.swiftc),
'..', 'lib', 'swift', 'migrator')
Copy link
Contributor

@benlangmuir benlangmuir Aug 11, 2021

Choose a reason for hiding this comment

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

I was going to suggest:

os.path.join(config.swift_lib_dir, 'swift', 'migrator')

But I'm not actually sure if that's correct when testing against the host toolchain 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The swift lib dir is going to be where the newly built stdlib is I think. We want to be 100% sure it is the toolchain and swiftc is always going to be in the toolchain so I think it is reasonable.

@gottesmm gottesmm force-pushed the pr-36215dc624bd0eff08ab502b119618f819699467 branch from b6cd0e9 to 302dc9f Compare August 12, 2021 18:48
…uilding/testing against a host toolchain.

This involved adding a new substitution called %api_diff_data_dir that when
building against a host toolchain, looks in the host toolchain (next to swiftc)
rather than in the resource dir. The reason why I need to do this is this allows
me to perform a stdlib stage2 build without needing to build swift itself.

The only interesting changes here are that I had to add %api_diff_data_dir to
a bunch of normal/expected tests and also add %api_diff_data_dir's length to the
offsets in rdar31892850.swift.
@gottesmm gottesmm force-pushed the pr-36215dc624bd0eff08ab502b119618f819699467 branch from 302dc9f to af25b67 Compare August 12, 2021 18:50
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci test windows platform

@gottesmm gottesmm merged commit 86c7245 into swiftlang:main Aug 13, 2021
@gottesmm gottesmm deleted the pr-36215dc624bd0eff08ab502b119618f819699467 branch August 13, 2021 01:28
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