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

Same transition dirs when only cmd line options differs #13580

Closed
wants to merge 1 commit into from

Conversation

ulrfa
Copy link
Contributor

@ulrfa ulrfa commented Jun 16, 2021

Ignore user defined build settings only set on
command line and not affected by any transition,
when calculating transitionDirectoryNameFragment
output directory.

Native options on command line already have this
behavior, and this commit provides the same also
for user defined build settings.

This allows reducing transition scalability issues,
by combining transitions with command line options:

a) Setting a limited number of common options via
transitions, which affects large parts of the
code base, but with limited number of variants.
b) When needed, also setting a few of many
specific options, each of them affecting only
their parts of the code base, but with many
variants.

Resolves #12731
Resolves #13317

@google-cla google-cla bot added the cla: yes label Jun 16, 2021
@ulrfa ulrfa marked this pull request as ready for review June 16, 2021 15:06
@aiuto aiuto requested a review from gregestren June 24, 2021 04:29
@aiuto aiuto added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Jun 24, 2021
@frazze-jobb
Copy link
Contributor

@gregestren have you got the time to review this yet?

@gregestren
Copy link
Contributor

I'm switching to giving this more attention around this week. Thanks for your patience.

@ulrfa
Copy link
Contributor Author

ulrfa commented Sep 3, 2021

Now I waited more than 11 weeks. @gregestren, when do you think you will have time to review?

@gregestren
Copy link
Contributor

I apologize for the wait and appreciate your patience.

I was looking at this issue in earnest yesterday - not just this PR but the collection of related issues I think speak to this theme (like #13591 and #12171).

I'm trying to stitch together how they'll all fit in my head. Expect a more technical update from me today. I'm also happy to share contact info if you want better ping access.

Copy link
Contributor

@gregestren gregestren left a comment

Choose a reason for hiding this comment

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

Thanks again for your patience. Overall this looks great to me.

Before this review I ran through the technicalities on my own to map my own understanding of the right approach. This is exactly the change I would have made. I'm encouraged by this convergence.

I haven't reviewed the test code yet, but hopefully these comments help. No major comments - all in all the base approach looks spot on.

@ulrfa
Copy link
Contributor Author

ulrfa commented Sep 6, 2021

Thanks @gregestren for reviewing! Please, see my follow up questions.

Yes, encouraging with the convergence about the approach! 😃

@ulrfa
Copy link
Contributor Author

ulrfa commented Sep 13, 2021

The failing windows test cases seems related to python version, and not this PR. Perhaps they will be resolved when I rebase.

Ignore user defined build settings only set on
command line and not affected by any transition,
when calculating transitionDirectoryNameFragment
output directory.

Native options on command line already have this
behavior, and this commit provides the same also
for user defined build settings.

This allows reducing transition scalability issues,
by combining transitions with command line options:

 a) Setting a limited number of common options via
    transitions, which affects large parts of the
    code base, but with limited number of variants.
 b) When needed, *also* setting a few of many
    specific options, each of them affecting only
    their parts of the code base, but with many
    variants.

Resolves bazelbuild#12731
@ulrfa
Copy link
Contributor Author

ulrfa commented Sep 13, 2021

I tried to resolve the comments and rebased.

@gregestren, note that there is one open conversation waiting for your feedback.

@gregestren, is it something more you want from me before this can land?

@gregestren
Copy link
Contributor

I also experimentally verified this at the command line with a simple project (building the same target that applies a transition twice, first time with --//foo:unrelated_flag=a and second with --//foo:unrelated_flag=b).

@bazel-io bazel-io closed this in 82d4db2 Sep 14, 2021
@ulrfa
Copy link
Contributor Author

ulrfa commented Sep 15, 2021

Hurray! 🎉 🎈 I'm very happy! Thank you @gregestren!

@gregestren
Copy link
Contributor

Hey @ulrfa. #14239 (comment) suggests the null check from this PR may not have actually been necessary? Do you remember the considerations behind that line?

It seems like the relevant tests still pass with a small modification @sdtwigg made in a pending change. I wonder if the problem was

failing if its value is null.

@ulrfa
Copy link
Contributor Author

ulrfa commented Nov 9, 2021

Hi @gregestren, see my answer in #14239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes P1 I'll work on this now. (Assignee required) team-Configurability platforms, toolchains, cquery, select(), config transitions
Projects
None yet
6 participants