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

migrate mode tests flags which are not yet available #147

Closed
siddharthab opened this issue Aug 1, 2020 · 12 comments
Closed

migrate mode tests flags which are not yet available #147

siddharthab opened this issue Aug 1, 2020 · 12 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee)

Comments

@siddharthab
Copy link

For example, as of today, with bazelisk version 1.5.0 and bazel version 3.4.1, the --migrate mode tries these flags which are not defined for bazel 3.4.1:

  --//tools/build_defs/pkg:incompatible_no_build_defs_pkg (Bazel 4.0: https://github.com/bazelbuild/bazel/issues/8857)
  --//tools/build_defs/pkg:incompatible_no_build_defs_pkg_deb (Bazel 4.0: https://github.com/bazelbuild/bazel/issues/11217)
  --//tools/build_defs/pkg:incompatible_no_build_defs_pkg_rpm (Bazel 4.0: https://github.com/bazelbuild/bazel/issues/11218)
  --incompatible_proto_output_v2 (Bazel 4.0: https://github.com/bazelbuild/bazel/issues/10358)

How are other people using the --migrate flag in practice?

See this Github Actions log for a real life example.

To reproduce:

git clone git@github.com:grailbio/bazel-compilation-database.git
cd bazel-compilation-database
tests/check_migration.sh
@philwo
Copy link
Member

philwo commented Aug 1, 2020

Pinging the flag owners @aiuto and @joeleba - if I understand correctly, the flags should be available in Bazel 3.4.1, right? Then why does it fail (see the log)? 🤔

@aiuto
Copy link
Contributor

aiuto commented Aug 2, 2020 via email

@siddharthab
Copy link
Author

The problem is that these issues (e.g.: bazelbuild/bazel#10358, bazelbuild/bazel#11218) are labelled as migration-3.4 which makes bazelisk think that these flags are available in bazel-3.4.z, and so it tries to use these flags when running in --migrate and --strict mode. But these flags are actually not available in bazel-3.4.z, making the run fail.

What are the semantics of labelling an issue with migration-x.y?

This is an example log describing the failure.

@aiuto
Copy link
Contributor

aiuto commented Aug 2, 2020 via email

@joeleba
Copy link
Member

joeleba commented Aug 3, 2020

--incompatible_proto_output_v2 isn't a build flag, but an aquery flag, so the failure is expected.

@siddharthab
Copy link
Author

@philwo What do you think about making the flag placement logic a little more intelligent?

I can send in a PR to help. I was thinking we can check whether or not to use the flag based on the command that's being used, and checking for that in bazel's help output for that command. Happy to go with whatever you suggest?

Without this, migration check in CIs has always been noisy.

@siddharthab
Copy link
Author

As for the starlark flags, they need to be prefixed with @bazel_tools, so they should be used as --@bazel_tools//tools/build_defs/pkg:incompatible_no_build_defs_pkg. Maybe we should rename the github issues that correspond to them?

@philwo
Copy link
Member

philwo commented Aug 4, 2020

@siddharthab That sounds like an interesting idea. 🤔 If you can come up with a way that's not too complex, I'd be happy to review a PR.

Regarding the Starlark flags, if they have to be prefixed with @bazel_tools, I think we should rename the GitHub issue titles, yes.

@limdor
Copy link

limdor commented Nov 13, 2020

I would also be interested on knowing how people is supposed to use strict and migrate.
I just naively run bazelisk --strict build //... and I also saw this error message
ERROR: --incompatible_proto_output_v2 :: Unrecognized option: --incompatible_proto_output_v2

@siddharthab
Copy link
Author

This has not been an issue in the past several months, so we can close this.

@limdor
Copy link

limdor commented Nov 9, 2021

I would like if before closing it someone from Bazel team could comment on it. What is the official way for the user to migrate to a new bazel version? (thinking specially from an LTS to the next LTS). I assume that it would be to use --strict now that --all_incompatible_changes has been removed in bazelbuild/bazel#13892.

@fweikert fweikert added the P3 We're not considering working on this, but happy to review a PR. (No assignee) label Feb 6, 2024
@fweikert
Copy link
Member

fweikert commented Feb 6, 2024

Closing since this looks more like a Bazel issue.

@fweikert fweikert closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee)
Projects
None yet
Development

No branches or pull requests

6 participants