Skip to content

Fix value of platform_module_dir in lit.cfg #21913

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 17, 2019
Merged

Fix value of platform_module_dir in lit.cfg #21913

merged 1 commit into from
Jan 17, 2019

Conversation

gwynne
Copy link
Contributor

@gwynne gwynne commented Jan 16, 2019

In lit.cfg, the platform_module_dir variable's value is constructed based on the %target-sdk-name substitution. However, substitutions are not applied at this point in lit.cfg's logic, so the resulting value was always the actual string %target-sdk-name. Instead, use the actual value of target_sdk_name, making platform_module_dir correctly reflect the target SDK.

…. This appears to have been harmless, but was still wrong.
@gwynne gwynne requested a review from gottesmm January 16, 2019 10:29
@jrose-apple
Copy link
Contributor

I don't think this matters as long as it's only used in other substitutions. Did you want to use it somewhere else?

@gwynne
Copy link
Contributor Author

gwynne commented Jan 17, 2019

@jrose-apple There were at least two cases where I saw the literal value actually used as the name of a directory on disk as part of the build - that was what originally brought my attention to the bug. It ultimately forms part of the value of %platform_sdk_overlay_dir, which is a substitution, but substitutions aren't recursive and one ends up with the literal string on disk unless a test_sdk_overlay_dir was set.

@jrose-apple
Copy link
Contributor

Huh. That seems…very strange, since we have tests that use %platform_sdk_overlay_dir. But if you were able to cause a failure, then sure, let's take this. (Or reorder the substitutions.)

@gwynne
Copy link
Contributor Author

gwynne commented Jan 17, 2019

The failure to make the replacement doesn't prevent anything from working that I could find, it just looks quite odd in the build output and filesystem. But since making it work properly doesn't break anything, my take is that it makes more sense to have it right in the event something does eventually depend on it.

@gwynne
Copy link
Contributor Author

gwynne commented Jan 17, 2019

@swift-ci please smoke test

@gwynne gwynne merged commit 611b0c9 into swiftlang:master Jan 17, 2019
@gwynne gwynne deleted the gwynne/fix-platform_module_dir branch January 17, 2019 21:17
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