Skip to content

[build-script] Move HostSpecificConfiguration out of main script. #23988

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

Conversation

drodriguez
Copy link
Contributor

This will allow using HostSpecificConfiguration from other parts that
are not the main script in the future. This is interesting because the
information is mostly useful when building Swift. The rest of products
are not really interested in the results of these calculations.

Includes a suite of tests that check the implementation correctly
calculates the right targets to build under diverse circumstances.

This is probably the part of #23982 that failed to work and had to be reverted in #23861. If there's any way I can help to integrate this (modifying the code, if necessary), we can work this out.

This was part of #23257. I’m trying to split the PR in smaller ones to make the reviews easier. Other PRs in this group are #23303, #23803, #23810, #23822, #23865, #23915, #23917, #23918, and #23982.

@drodriguez drodriguez force-pushed the build-script-host-specific-configuration-take-3 branch from 56a575e to cb924f9 Compare April 29, 2019 19:09
@drodriguez
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

AIUI, this is just moving the code, the only difference is the addition of the test and the converting the exit_rejecting_arguments to a raise ArgumentError?

@drodriguez
Copy link
Contributor Author

Yes, your understanding is right. However, I think someone that can see the internal Apple modifications might want to pitch in. This is probably what build their internal builds in the past.

@drodriguez drodriguez force-pushed the build-script-host-specific-configuration-take-3 branch from cb924f9 to 38bc491 Compare May 29, 2019 20:24
@drodriguez
Copy link
Contributor Author

Rebased on top of master to adapt to the changes in build-script in the mean time.

@swift-ci please smoke test

@gottesmm
Copy link
Contributor

Question. Beyond the tests, is this just moving code?

@drodriguez
Copy link
Contributor Author

Yes, this is just moving code. The only exception are the calls to exit_rejecting_arguments (a local function of build-script) which have been changed to raising an exception that build-script captures.

This is the diff between the two pieces of text:

--- pre.txt	2019-05-29 13:36:46.000000000 -0700
+++ post.txt	2019-05-29 13:36:20.000000000 -0700
@@ -187,22 +187,25 @@
         if not args.test_ios_host:
             platforms_to_skip_test.add(StdlibDeploymentTarget.iOS)
         else:
-            exit_rejecting_arguments("error: iOS device tests are not " +
-                                     "supported in open-source Swift.")
+            raise ArgumentError(None,
+                                "error: iOS device tests are not " +
+                                "supported in open-source Swift.")
         if not args.test_ios_simulator:
             platforms_to_skip_test.add(StdlibDeploymentTarget.iOSSimulator)
         if not args.test_tvos_host:
             platforms_to_skip_test.add(StdlibDeploymentTarget.AppleTV)
         else:
-            exit_rejecting_arguments("error: tvOS device tests are not " +
-                                     "supported in open-source Swift.")
+            raise ArgumentError(None,
+                                "error: tvOS device tests are not " +
+                                "supported in open-source Swift.")
         if not args.test_tvos_simulator:
             platforms_to_skip_test.add(StdlibDeploymentTarget.AppleTVSimulator)
         if not args.test_watchos_host:
             platforms_to_skip_test.add(StdlibDeploymentTarget.AppleWatch)
         else:
-            exit_rejecting_arguments("error: watchOS device tests are not " +
-                                     "supported in open-source Swift.")
+            raise ArgumentError(None,
+                                "error: watchOS device tests are not " +
+                                "supported in open-source Swift.")
         if not args.test_watchos_simulator:
             platforms_to_skip_test.add(
                 StdlibDeploymentTarget.AppleWatchSimulator)

@gottesmm
Copy link
Contributor

LGTM. Just an FYI, I am going to have to make a change here to add support for non-executable tests on iOS. We are going to setup public CI (maybe PR testing as well, not sure) for running non-executable device tests. We are hitting a bunch of IRGen test failures internally only that we could detect without issue publicly with the infrastructure.

@gottesmm
Copy link
Contributor

Looks like you need to add a value for the only_executable flag.

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Fix the tests, then let err rip. This looks good to me!

Thank you for splitting out the text so I can eyeball the review! I appreciate it = ).

This will allow using `HostSpecificConfiguration` from other parts that
are not the main script in the future. This is interesting because the
information is mostly useful when building Swift. The rest of products
are not really interested in the results of these calculations.

Includes a suite of tests that check the implementation correctly
calculates the right targets to build under diverse circumstances.
@drodriguez drodriguez force-pushed the build-script-host-specific-configuration-take-3 branch from 38bc491 to def82fe Compare May 29, 2019 21:52
@drodriguez
Copy link
Contributor Author

Yes. That was it. Good thing the test catch it.

Would you like that I hold this until you finish your changes, or you prefer to have this in place? I have no preference.

@swift-ci please smoke test

@gottesmm
Copy link
Contributor

Lets land this

@drodriguez
Copy link
Contributor Author

drodriguez commented May 29, 2019

The errors seems to imply that #25030 wasn’t compiled in, but swiftlang/swift-package-manager#2134 was?

@drodriguez
Copy link
Contributor Author

@swift-ci Please smoke test OS X platform

@gottesmm
Copy link
Contributor

Yes, sounds like a race. It happens pretty rarely, but it does happen.

@drodriguez drodriguez merged commit 46f130a into swiftlang:master May 30, 2019
@drodriguez drodriguez deleted the build-script-host-specific-configuration-take-3 branch July 16, 2019 23:42
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.

3 participants