-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Tests all cases of infer-cross-compile-hosts-on-darwin
at once
#60824
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
Tests all cases of infer-cross-compile-hosts-on-darwin
at once
#60824
Conversation
@swift-ci please python lint |
@swift-ci please test |
@swift-ci please build toolchain |
d7d5c72
to
e011c0c
Compare
@swift-ci please python lint |
@swift-ci please test |
@swift-ci please build toolchain |
# This is meant to test --infer-cross-compile-hosts-on-darwin | ||
# in dry-run mode, so we don't want to advertise this to most users | ||
option('--dry-run-assume-host-arch-is', store, | ||
help=argparse.SUPPRESS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we don't want to make this generally available and that it is specifically for a singular test ATM, what do you think of honoring an environment variable (e.g. ARCH
) instead of having a dedicated option that we then have to explicitly suppress? The changes to build-script
are also then simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense, I had in mind the hidden options we have on the frontend and did not think about the big picture.
I took this feedback in e039574 -- I am still ensuring to sense the variable in dry run and print when such sensing occurring in a effort to reduce the likelihood of using this code path in normal usage.
utils/build-script
Outdated
def _infer_cross_compile_hosts_on_darwin(args): | ||
if args.dry_run and args.dry_run_assume_host_arch_is: | ||
# This is primarily meant to support testing | ||
# BuildSystem/infer-cross-compile-hosts-on-darwin-macosx.test | ||
# and it's not meant for the general audience | ||
print("DRY RUN: assume build-script is being run on a " | ||
f"{args.dry_run_assume_host_arch_is} machine") | ||
sys.stdout.flush() | ||
|
||
arch_we_are_running_on = args.dry_run_assume_host_arch_is | ||
else: | ||
arch_we_are_running_on = platform.machine() | ||
|
||
if arch_we_are_running_on == "x86_64": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _infer_cross_compile_hosts_on_darwin(args): | |
if args.dry_run and args.dry_run_assume_host_arch_is: | |
# This is primarily meant to support testing | |
# BuildSystem/infer-cross-compile-hosts-on-darwin-macosx.test | |
# and it's not meant for the general audience | |
print("DRY RUN: assume build-script is being run on a " | |
f"{args.dry_run_assume_host_arch_is} machine") | |
sys.stdout.flush() | |
arch_we_are_running_on = args.dry_run_assume_host_arch_is | |
else: | |
arch_we_are_running_on = platform.machine() | |
if arch_we_are_running_on == "x86_64": | |
os.environ.get('ARCH', platform.machine()) == 'x86_64': |
e011c0c
to
2dc756d
Compare
The current implementation currently requires to have physical machine for each architecture supported by macOS, which is not desirable. To allow all cases to be tested on a random Mac machine, allow to inject an arbitratry current architecture into the inference of the cross compile hosts by means of an environment variable. Addresses rdar://99096874
2dc756d
to
e039574
Compare
@swift-ci please python lint |
@swift-ci please test |
@swift-ci please build toolchain |
The current implementation currently requires to have physical machine
for each architecture supported by macOS, which is not desirable.
To allow all cases to be tested on a random Mac machine, allow
to inject an arbitratry current architecture into the inference
of the cross compile hosts by means of an environment variable.
Addresses rdar://99096874