-
Notifications
You must be signed in to change notification settings - Fork 312
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
Running bazel mod ...
From Plugin Fails on Non-BzlMod Project
#6703
Comments
CC @mtoader |
Driving today, but i'll try to make it better at opting in here. |
@andponlin-canva posted a PR disabling this. I will think through on a better opt-in (most likely it will be an explicit flag in projectview if i can't find a reliable way to querying default values of flags). |
@mtoader ; Thank you for that. I'll wait for your PR to merge then remove it from my side. Unfortunately finding out if BzlMod is enabled is a bit tricky. Before your logic runs there is a The only other way I know of is to do this in Starlark;
|
I was also looking at running |
I also wanted to add a hidden flag that would disable it (just for basic troubleshooting). #6706 When comes to bzlmod, we can even ask the bazel team to provide flag, or even check if bazel fails with "Bzlmod has to be enabled" error and recover silently |
A flag in bazel would help but that would be in the future. I would need something now. Will try to see if i can use bazel query and maybe an expression like the one suggested above. And will definitely add a flag. |
Oh, the flag is intended only to unblock users for whom it would fail for an unknown, unexpected reason. We of course need to detect it (or precisely handle this failure and recover) |
Registry flag is already there btw |
I meant a project view flag (or section). However, in meantime I randomly realized this exists:
that thing should only show enable_bzlmod=false if the flag is actively disabled in bazel 7+. |
Description of the bug:
A recent change
0cd1de2aed660ffdda5f1f376d87dfea06c907e7
onmaster
runs a commandbazel mod
which fails for repositories which have--noenable_bzlmod
turned on (are usingWORKSPACE
) but are using a version of Bazel >=7.1.0
.The error from the tool is;
Can you please update
ExternalWorkspaceDataProvider#isEnabled
to always returnfalse
until there is a means to verify that the project has BzlMod configured before executing thebazel mod
command?Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Take a sample project that is not configured for BzlMod. Edit the
.bazelrc
file to contain;Ensure you are using Bazel >=
7.1.0
, open the project with a build of the Intelli-J plugin frommaster
and sync.Which Intellij IDE are you using? Please provide the specific version.
2024.1
What programming languages and tools are you using? Please provide specific versions.
What Bazel plugin version are you using?
7.3.1
Have you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: