Skip to content

[Test] Add %host_triple and %host_sdk substitutions #64796

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
Mar 31, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 30, 2023

Macro tests need to build host libraries/tools. We can't use %target-* substitutions for that.

rdar://107398734

@rintaro
Copy link
Member Author

rintaro commented Mar 30, 2023

@swift Please smoke test

@rintaro rintaro changed the title [Test] Add %host_triple and %host_sdkroot substitutions [Test] Add %host_triple and %host_sdk substitutions Mar 30, 2023
Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Thanks Rintaro!

// RUN: %target-build-swift -swift-version 5 -I %swift-host-lib-dir -L %swift-host-lib-dir -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
// RUN: %swiftc_driver -sdk %host_sdk -target %host_triple -swift-version 5 -I %swift-host-lib-dir -L %swift-host-lib-dir -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have a host-build-swift to match target-build-swift?

test/lit.cfg Outdated
@@ -963,7 +963,7 @@ def use_interpreter_for_simple_runs():
result += (
'env SWIFT_INTERPRETER=%r %s %r %s -module-name main %s %s %s '
% (config.swift, xcrun_prefix, config.swift, target_options,
config.swift_test_options,
onfig.swift_test_options,
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops!

@rintaro rintaro force-pushed the test-hosttriple-rdar107398734 branch 2 times, most recently from 4f9e6f4 to 1828fc6 Compare March 31, 2023 06:00
@rintaro
Copy link
Member Author

rintaro commented Mar 31, 2023

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Mar 31, 2023

@swift-ci Please smoke test macOS

@rintaro
Copy link
Member Author

rintaro commented Mar 31, 2023

@swift-ci Please smoke test

Macro tests need to build host libraries/tools. We can't use %target-*
substitutions for that.

rdar://107398734
@rintaro rintaro force-pushed the test-hosttriple-rdar107398734 branch from 1828fc6 to 1d2fd42 Compare March 31, 2023 14:42
@rintaro
Copy link
Member Author

rintaro commented Mar 31, 2023

@swift-ci Please smoke test

@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -swift-version 5 -I %swift-host-lib-dir -L %swift-host-lib-dir -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
// RUN: %host-build-swift -swift-version 5 -I %swift-host-lib-dir -L %swift-host-lib-dir -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
Copy link
Contributor

@bnbarham bnbarham Mar 31, 2023

Choose a reason for hiding this comment

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

Any thoughts on including -I %swift-host-lib-dir -L %swift-host-lib-dir by default for host-build-swift? Or we could have %host-tool-build-swift or something 😅. What you have now is fine though, I can do that when I go through and fix up all the REQUIRES if we can think of a nice name for it.

@rintaro rintaro merged commit 9dc7ee8 into swiftlang:main Mar 31, 2023
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