Skip to content

swiftpm: Test only running host platform architecture #79074

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,7 @@ swift-testing-macros
install-swift-testing
install-swift-testing-macros

infer-cross-compile-hosts-on-darwin
skip-test-swift

[preset: mixin_swiftpm_macos_platform]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ def is_before_build_script_impl_product(cls):
def should_build(self, host_target):
return True

def run_bootstrap_script(self, action, host_target, additional_params=[]):
def run_bootstrap_script(
self,
action,
host_target,
additional_params=[],
*,
compile_only_for_running_host_architecture=False,
):
script_path = os.path.join(
self.source_dir, 'Utilities', 'bootstrap')

Expand Down Expand Up @@ -85,7 +92,10 @@ def run_bootstrap_script(self, action, host_target, additional_params=[]):
]

# Pass Cross compile host info
if self.has_cross_compile_hosts():
if (
not compile_only_for_running_host_architecture
and self.has_cross_compile_hosts()
):
if self.is_darwin_host(host_target):
helper_cmd += ['--cross-compile-hosts']
for cross_compile_host in self.args.cross_compile_hosts:
Expand Down Expand Up @@ -114,7 +124,11 @@ def should_test(self, host_target):
return self.args.test_swiftpm

def test(self, host_target):
self.run_bootstrap_script('test', host_target)
self.run_bootstrap_script(
'test',
host_target,
compile_only_for_running_host_architecture=True,
)

def should_clean(self, host_target):
return self.args.clean_swiftpm
Expand Down