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

Do not clear --platforms on no-op change to --cpu #17158

Closed
wants to merge 2 commits into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 6, 2023

Resolves a TODO in the code to not unnecessarily fork the configuration when a transition has --cpu as a declared output but doesn't change it.

@katre katre self-requested a review January 6, 2023 15:56
fmeum added a commit to CodeIntelligenceTesting/jazzer that referenced this pull request Jan 6, 2023
Due to a Bazel issue (bazelbuild/bazel#17158),
the recent introduction of `universal_binary` ended up forking the
configuration for dependencies of the Jazzer launcher. As a result,
some Java targets were built twice and the Docker images failed to build
as the Jazzer standalone jar was no longer a dependency of the launcher
in the default configuration.

As a workaround and also because it prevents similar issues on a more
fundamental level, switch to the soon to be default improved config hash
algorithm.
@fmeum
Copy link
Collaborator Author

fmeum commented Jan 6, 2023

@gregestren Could you take a look? This resolves a build time regressions we had when we picked up rules_apple's universal_binary rule, which performs a no-op transition on --cpu on non-Apple platforms.

Resolves a TODO in the code to not unnecessarily fork the configuration
when a transition has `--cpu` as a declared output but doesn't change
it.
@fmeum fmeum force-pushed the fix-cpu-no-op-not-fully-no-op branch from 7a65c45 to 57fc3d2 Compare January 6, 2023 16:16
Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

LGTM, just a few small changes I'd like to request.

.build()
: originalOutput;
BuildOptions options, Map<String, Object> originalOutput) {
Object newCpu = originalOutput.get(COMMAND_LINE_OPTION_PREFIX + "cpu");
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The names newCpu and originalOutput don't seem to match. Can we rename one of them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, renamed the existing variable to be more descriptive.

@katre katre added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally labels Jan 6, 2023
fmeum added a commit to CodeIntelligenceTesting/jazzer that referenced this pull request Jan 7, 2023
Due to a Bazel issue (bazelbuild/bazel#17158),
the recent introduction of `universal_binary` ended up forking the
configuration for dependencies of the Jazzer launcher. As a result,
some Java targets were built twice and the Docker images failed to build
as the Jazzer standalone jar was no longer a dependency of the launcher
in the default configuration.

As a workaround and also because it prevents similar issues on a more
fundamental level, switch to the soon to be default improved config hash
algorithm.
@fmeum fmeum deleted the fix-cpu-no-op-not-fully-no-op branch January 10, 2023 17:59
@fmeum
Copy link
Collaborator Author

fmeum commented Jan 10, 2023

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jan 10, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jan 11, 2023
@ShreeM01
Copy link
Contributor

@bazel-io fork 6.1.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jan 19, 2023
ShreeM01 added a commit that referenced this pull request Jan 19, 2023
Resolves a TODO in the code to not unnecessarily fork the configuration when a transition has `--cpu` as a declared output but doesn't change it.

Closes #17158.

PiperOrigin-RevId: 501021431
Change-Id: Ib942ea9584b2ceb3083b5fec71e2e11b89dcfdb6

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
hvadehra pushed a commit that referenced this pull request Feb 14, 2023
Resolves a TODO in the code to not unnecessarily fork the configuration when a transition has `--cpu` as a declared output but doesn't change it.

Closes #17158.

PiperOrigin-RevId: 501021431
Change-Id: Ib942ea9584b2ceb3083b5fec71e2e11b89dcfdb6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants