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

Fix unrecognized options by bazel mod command #6756

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

LeFrosch
Copy link
Collaborator

@LeFrosch LeFrosch commented Sep 12, 2024

Build flags defined in the project view are forwarded to bazel mod which breaks sync, since --define is not a known option for the mod command.

Not sure if excluding build flags from the mod command is the right way to go. But fixes the sync.

@LeFrosch LeFrosch changed the title Fixe unrecognized options by bazel mod command Fix unrecognized options by bazel mod command Sep 12, 2024
@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Sep 12, 2024
@LeFrosch
Copy link
Collaborator Author

CC @mtoader

@mtoader
Copy link
Contributor

mtoader commented Sep 12, 2024

The right thing here is more complicated unfortunately since what is really needed is something similar to how .bazelrc works.

This is ok for now but it will break in different ways too, e.g. adding --incompatible_use_plus_in_repo_names in build_flags will make mod show different canonical names than what build would use.

@LeFrosch
Copy link
Collaborator Author

Yes I thought that this might be the case. Tbh, not really sure how the bazel mod stuff works. But if it is okay with you I would like to merge this for now to fix sync.

@mtoader
Copy link
Contributor

mtoader commented Sep 12, 2024

Yes I thought that this might be the case. Tbh, not really sure how the bazel mod stuff works. But if it is okay with you I would like to merge this for now to fix sync.

I'm ok with it. I have to add a notifier anyway to let people know that the plus flag should be set for proper completion to work anyway. I'll recommend them set it in the .blazerc file.

@mtoader
Copy link
Contributor

mtoader commented Sep 12, 2024

Yes I thought that this might be the case. Tbh, not really sure how the bazel mod stuff works. But if it is okay with you I would like to merge this for now to fix sync.

I'm ok with it. I have to add a notifier anyway to let people know that the plus flag should be set for proper completion to work anyway. I'll recommend them set it in the .blazerc file.

I also don't have write/review access here so I can't help further unfortunately

@mtoader
Copy link
Contributor

mtoader commented Sep 12, 2024

@agluszak @tpasternak I think the semantics of build_flags in the new plugin could be smarter. Maybe a .blazerc fragment? I could avoid this kind of issues.

@tpasternak
Copy link
Collaborator

Sorry, my responses might be delayed until the end of next week. Sure, providing bazelrc-like inheritance would be nice, however it might require extra maintenance to make sure we agree with bazel on that.

It could also be done for free just with --bazelrc CLI option, it would be even a low hanging fruit in the old plugin, to provide 'bazelrc` section that would create a bazelrc file on the fly. It could replace all other sections and perform better

But speaking about this particular problem, it seems like the mod command simply doesn't inherit flags from build so we can't pass build_flags there.

@mtoader
Copy link
Contributor

mtoader commented Sep 12, 2024

Sorry, my responses might be delayed until the end of next week. Sure, providing bazelrc-like inheritance would be nice, however it might require extra maintenance to make sure we agree with bazel on that.

It could also be done for free just with --bazelrc CLI option, it would be even a low hanging fruit in the old plugin, to provide 'bazelrc` section that would create a bazelrc file on the fly. It could replace all other sections and perform better

But speaking about this particular problem, it seems like the mod command simply doesn't inherit flags from build so we can't pass build_flags there.

Yea. That was my thinking also. I opened a ticket to think about this in the new plugin (now might be a good time to update section semantics if this is what it would be needed and since I'm adding blazerc support there it would be easier too).

@mai93 mai93 merged commit 02ad803 into bazelbuild:master Sep 12, 2024
8 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants