Replies: 7 comments 7 replies
-
Can you elaborate a bit on when and how you run those aspects? Do you need to run all of them no matter which languages the project is configured for? I guess it's running within the same workspace as the project? |
Beta Was this translation helpful? Give feedback.
-
How do you expect people to depend on That file does depend on Rust things so it's natural to require that the Rust rules are in the workspace. If you use bzlmod, that will naturally happen if you add the Rust rules to your |
Beta Was this translation helpful? Give feedback.
-
I'm familiar with the problem. It has 2 main ingredients:
The desire is that IDE aspect can support all possible rulesets (for example multiple flavours of Rust rules). The problem is, that IDE aspect then needs to depend on all of the rulesets it supports, because it needs to load provider key. If the repository is using particular ruleset, that ok, because there's already a repo dependency. If the repository is not using particular ruleset, IDE aspect still needs to pull it in. The more rulesets you support, the more of unneeded things get pulled in. |
Beta Was this translation helpful? Give feedback.
-
#18292 (comment) sums the issue quite well overview of the flow:
|
Beta Was this translation helpful? Give feedback.
-
I can see this might be solvable with Bzlmod by using But there are still going to be some side-effects of this approach, because the transitive dependencies you introduced via the rulesets may change the resolved external dependencies of the root module.
I actually think this is the best approach because this runs only what needs to be run and doesn't require much Bazel magic. |
Beta Was this translation helpful? Give feedback.
-
i see, then we will try to implement the workaround on our side; one more question - is there a nice way to know what rules / languages are included in the workspace? it'd be useful in the mechanizm, to determine what providers can be loaded |
Beta Was this translation helpful? Give feedback.
-
Over in buck2, there is an ability to create a starlark script(BXL) and execute it using Given how convoluted the current approach of "sideloading" an aspect into a repo, perhaps Bazel should consider adopting something similar.
could be replaced with
|
Beta Was this translation helpful? Give feedback.
-
hi, with my team we are working on bazel bsp server and one of our goals is to support multiple languages / bazel rules. Unfortunately it's a bit tricky for 'custom' (not builtin) rules like rust rules and the fact that the old providers are deprecated.
It means that in order to obtain all the data we need to add a
load
statement for a provider. (example for rust). It means that this code wont work in workspaces without rust rules. Probably we will encounter similar problems with other languages in the future : (We can try to solve it somehow on our side by creating aspects on the fly based on the installed rules or defined languages by user, but we were wondering is there a better way?
possible options:
Beta Was this translation helpful? Give feedback.
All reactions