Update bzlmod dependencies and enhance separation of components
This PR takes bzlmod migration a step further and tries to lay ground for future work in that area.
Currently, there are a few components / modules which were all depending on each other:
-
core - toolchains:
-
cc -
go -
java -
posix -
rust -
python
-
-
nixpkgs(the everything component)
It should be possible to require a specific toolchain with only pulling in the required dependencies.
This PR adds a toolchains parameter to the rules_nixpkgs_dependencies function signalling which toolchain is required.
Interestingly, every component depends on java, posix and the cc toolchain (even the core). This is because of the stardoc dependency which consists of a java_binary...
IMO, it would be a good idea to separate the docs generation into another component, in order to get rid of the excess dependencies. WDYT?
IMO, it would be a good idea to separate the docs generation into another component, in order to get rid of the excess dependencies. WDYT?
That sounds like a reasonable approach to me, if feasible. FWIW modules also introduce a notion of dev-dependencies, so, perhaps in that case the components needed for Stardoc could simply be marked as such and wouldn't be needed for regular use. cc @fricklerhandwerk any thoughts? I think you're more familiar with this part than me.
Is this something you want to tackle in a follow-up PR?
Yes, I created an issue to track this: https://github.com/tweag/rules_nixpkgs/issues/264