-
Notifications
You must be signed in to change notification settings - Fork 385
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
Gazelle reports "could not merge expression" when using select statements in hdrs or srcs #1735
Comments
Maybe https://github.com/bazelbuild/bazel-gazelle/blob/ec1591cb193591b9544b52b98b8ce52833b34c58/rule/platform.go#L51 is a good starting point, since it looks like the issue happens for all platforms not part of this list. |
This isn't any real bugfix, but more of a style thing. Gazelle can't work with select or glob statements (bazel-contrib/bazel-gazelle#1735), but will work fine with them and even ignore them if set to # keep. This adds that directive to make gazelle less verbose when running. Change-Id: I7c638867d6b566e1d398eef37aff2316bf90a00f Reviewed-on: https://review.monogon.dev/c/monogon/+/3241 Reviewed-by: Leopold Schabel <[email protected]> Tested-by: Jenkins CI
I still see this issue for Bazel 7.2.1 and Gazelle 0.37.0. Do you think it would be enough adding the missing platforms to https://github.com/bazelbuild/bazel-gazelle/blob/ec1591cb193591b9544b52b98b8ce52833b34c58/rule/platform.go#L51? I can see a depratation message there so not sure if I should add something there? |
It's deprecated only for use outside of Go. Feel free to submit a PR to add new platforms! |
Created #1853, working on the CLA |
<!-- Thanks for sending a PR! Before submitting: 1. If this is your first PR, please read CONTRIBUTING.md and sign the CLA first. We cannot review code without a signed CLA. 2. Please file an issue *first*. All features and most bug fixes should have an associated issue with a design discussed and decided upon. Small bug fixes and documentation improvements don't need issues. 3. New features and bug fixes must have tests. Documentation may need to be updated. If you're unsure what to update, send the PR, and we'll discuss in review. --> **What type of PR is this?** > Uncomment one line below and remove others. > Bug fix **What package or component does this PR mostly affect?** language/go cmd/gazelle **What does this PR do? Why is it needed?** Adding more known platforms to avoid issue reported in #1735. **Which issues(s) does this PR fix?** Fixes #1735 **Other notes for review**
@hofbi Could you also submit a commit to rules_go that adds these platforms there? It looks like they don't exist yet and thus result in error messages: #1862 (comment) |
@fmeum I came up with bazel-contrib/rules_go#4036 |
**What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** **Which issues(s) does this PR fix?** **Other notes for review** This change was requested in bazel-contrib/bazel-gazelle#1735 (comment)
**What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** **Which issues(s) does this PR fix?** **Other notes for review** This change was requested in bazel-contrib/bazel-gazelle#1735 (comment)
**What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** **Which issues(s) does this PR fix?** **Other notes for review** This change was requested in bazel-contrib/bazel-gazelle#1735 (comment)
#1853 has fixed this |
What version of gazelle are you using?
bazel_dep(name = "gazelle", version = "0.35.0")
What version of rules_go are you using?
bazel_dep(name = "rules_go", version = "0.46.0")
What version of Bazel are you using?
7.0.2
Does this issue reproduce with the latest releases of all the above?
Yes, thats what we use
What operating system and processor architecture are you using?
Ubuntu 20.04 x86
What did you do?
hdrs
orsrcs
with@platforms//os:XXX
as key@platforms//os:windows
,@platforms//os:linux
,@platforms//os:ios
the merge works fine, while for others such as@platforms//os:qnx
or@platforms//os:osx
this results in acould not merge expression
errorWhat did you expect to see?
The same behavior as for the other platforms
What did you see instead?
could not merge expression
errorThe text was updated successfully, but these errors were encountered: