Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 23, 2019

This PR contains a set of small improvements to build-script-helper.py, including the one from #91.

  • Add argument to build-script-helper.py to update SwiftPM dependencies
  • Fail with an error message instead of a stack trace when a subcommand failed
  • Don't run build action if a test is requested
    • The test action creates its own build and building twice just wastes resources.
  • Name generated SwiftEvolve project SwiftEvolve
    • Previously also the generated SwiftEvolve Xcode projects was named SourceKitStressTester
  • Update .gitignore in SwiftEvolve to match the one in the stress tester

@ahoppen ahoppen requested review from beccadax and nathawes October 23, 2019 21:51
@ahoppen ahoppen force-pushed the build-script-fixes branch from 09ec338 to 4b72a26 Compare October 23, 2019 22:55
The test action creates its own build and building twice just wastes
resources.
Previously also generated SwiftEvolve Xcode projects was name
SourceKitStressTester.
@ahoppen ahoppen force-pushed the build-script-fixes branch from 4b72a26 to 55f4381 Compare October 23, 2019 23:05
@beccadax
Copy link
Contributor

  • Don't run build action if a test is requested

Does build-script ask us to just test when it assumes that this will also cause a build? If so, this may not be the right move.

@ahoppen
Copy link
Member Author

ahoppen commented Oct 26, 2019

Does build-script ask us to just test when it assumes that this will also cause a build? If so, this may not be the right move.

swift test always creates its own build. And since it’s using a different build directory it cannot reuse the build that was already created beforehand, effectively doubling the test time.

@ahoppen
Copy link
Member Author

ahoppen commented Oct 28, 2019

CI testing passed: https://ci.swift.org/job/swift-PR-osx-preset/64/

Copy link

@nathawes nathawes left a comment

Choose a reason for hiding this comment

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

LGTM!

def should_run_action(action_name, selected_actions):
if action_name in selected_actions:
return True
elif "all" in selected_actions:
Copy link

@nathawes nathawes Oct 30, 2019

Choose a reason for hiding this comment

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

Not important, but you could return "all" in selected_actions at this point, or replace the whole body with something like return any(item in (action_name, "all") for item in selected_actions).

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually find it clearer this way. The second suggestion means, I actually need to think about what’s going on and I like repeating the same pattern that I used for action_name already for "all". It’s a bit more verbose but I find it reads clearer.

Choose a reason for hiding this comment

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

No worries!

@ahoppen ahoppen merged commit 0cb1972 into swiftlang:master Oct 30, 2019
@ahoppen ahoppen deleted the build-script-fixes branch October 30, 2019 22:19
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