rules_nixpkgs icon indicating copy to clipboard operation
rules_nixpkgs copied to clipboard

Update bzlmod dependencies and enhance separation of components

Open avdv opened this issue 3 years ago • 1 comments

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?

avdv avatar Aug 05 '22 15:08 avdv

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.

aherrmann avatar Aug 11 '22 12:08 aherrmann

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

avdv avatar Sep 05 '22 13:09 avdv