Skip to content
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

Disable benchmark builds by default in build-script #11717

Closed
wants to merge 3 commits into from

Conversation

Rostepher
Copy link
Contributor

@Rostepher Rostepher commented Sep 1, 2017

Purpose

This PR modifies build-script and build-script-impl such that they no longer build the benchmark suite by default. Instead it's completely opt-in using the new --build-benchmarks and --test-benchmarks flags in build-script. The --skip-build-benchmarks and --skip-test-benchmarks flags are now no-ops and can be removed in a later cleanup pass once all uses have been thoroughly eradicated. The -B and --benchmark flags have been repurposed as an alias for both --build-benchmarks and --test-benchmarks. Changing the default behavior should not cause much (if any) problems for the vast majority of Swift contributors and instead it's likely that many developers will see improved compilation times (especially from a clean build).

I've also taken the liberty to fix uses of SKIP_TEST_BENCHMARK in build-script-impl, rather than the plural SKIP_TEST_BENCHMARKS, which seems to be a typo as far as I can tell. A bit of digging shows it was added in a refactor, but the command line option is plural.

rdar://problem/34375102

@Rostepher Rostepher changed the title Modified the build-script to no longer build the benchmark suite by d… Disable benchmark builds by default in build-script Sep 1, 2017
@Rostepher
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Member

gottesmm commented Sep 1, 2017

Just to double check. The benchmarks will still be built as part of smoke testing right? That is important to make sure that we do not break the benchmarks.

As a nice win, you could also have the PR testing run the benchmarks, but force the benchmarks to be run for 1 sample per test where each sample uses 2 iterations. This should be pretty fast. But you would need to measure the amount of time it takes just to be careful.

@Rostepher
Copy link
Contributor Author

I'll need to confirm with @shahmishal, but if the smoke-test bots were already passing the -B or --benchmark flag it should Just Work™.

@Rostepher
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@@ -40,7 +40,7 @@ from swift_build_support.swift_build_support.SwiftBuildSupport import (
SWIFT_REPO_NAME,
SWIFT_SOURCE_ROOT,
get_all_preset_names,
get_preset_options,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: generally we frown on removing trailing space from an entire file because it muddies up the diff. While we don't want to introduce new ones, can you set your editor not to do it by default?

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 1, 2017

Build failed
Swift Test OS X Platform
Git Sha - 6527a18762595d31892182f92bb7522bbc814891

@najacque
Copy link
Contributor

najacque commented Sep 1, 2017

@swift-ci please test

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 1, 2017

Build failed
Swift Test Linux Platform
Git Sha - 6527a18762595d31892182f92bb7522bbc814891

@Rostepher
Copy link
Contributor Author

@swift-ci please smoke test

@Rostepher
Copy link
Contributor Author

For the short-while I'm going to hold off on merging this until I've finished cleaning up some parts of build-script. The first of which is #11827

@najacque
Copy link
Contributor

najacque commented Sep 11, 2017

@swift-ci Please nominate

Explanation: Disable benchmark builds by default in build-script, and make it completely opt-in using the new --build-benchmarks and --test-benchmarks flags in build-script
Scope: Change to build script invocation
Radar (and possibly SR Issue): rdar://problem/34375102
Risk: existing bots or automation could have unexpected behavior.
Testing: Testing is being done in CI and locally

@najacque
Copy link
Contributor

This pull request has been nominated for inclusion to master

…efault, instead it's completely opt-in using the new `--build-benchmarks` and `--test-benchmarks` flags. The `--skip-build-benchmarks` and `--skip-test-benchmarks` flags are now no-ops and can be removed in a later cleanup pass once all uses have been thoroughly eradicated. The `-B` and `--benchmark` flags have been repurposed as an alias for both `--build-benchmarks` and `--test-benchmarks`.
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 4, 2018

Build failed
Swift Test Linux Platform
Git Sha - 825a18d

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 4, 2018

Build failed
Swift Test OS X Platform
Git Sha - 825a18d

…st_benchmarks rather than the combined benchmark attribute in the argument namespace.
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 4, 2018

Build failed
Swift Test Linux Platform
Git Sha - 825a18d

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 4, 2018

Build failed
Swift Test OS X Platform
Git Sha - 825a18d

…or --build-benchmarks and --test-benchmarks to 0 (False).
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 289233a

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - 289233a

@rudkx
Copy link
Member

rudkx commented Jan 25, 2018

@Rostepher Is this something you expect to merge soon?

It would be great to no longer have to specify the option to disable building the benchmarks as it is easy to forget if you're doing a build without using a preset, alias, script, etc.

@Rostepher
Copy link
Contributor Author

@rudkx I'd like to merge this soon, but I need to resolve some conflicts and ensure my changes to the presets don't mess up the CI bots. Turns out that flipping the flag is not as easy as a simple search and replace due to the complex layers of presets and mixins we have.

@Rostepher Rostepher closed this Sep 12, 2018
@Rostepher Rostepher deleted the bench-the-benchmarks branch September 12, 2018 21:31
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.

None yet

6 participants