rules_maven icon indicating copy to clipboard operation
rules_maven copied to clipboard

Feedback dependency management approach from here into bazel core.

Open hsyed opened this issue 8 years ago • 4 comments

I'm hoping we can work some parts of the dependency management approach here into bazel core.

Bridge to issue in bazel core / migration-tooling.

hsyed avatar Sep 18 '17 12:09 hsyed

Hi @hsyed thanks for the feedback. Sounds like a pain point for you is copying back the transitive closure into the rule, which you are proposing some sort of lock file. I agree it's a little annoying, lock file could be a good idea.

However, let's say for a moment that the lockfile had the format sha1:org:name:version, like the format of the transitive_deps attribute. One would still probably be copying back those values into the lock file every time you changed the deps attribute and had a different set of transitive dependencies.

So, question is, how to make lock file maintenance less annoying than the current state of affairs?

pcj avatar Sep 18 '17 14:09 pcj

@hsyed ping

pcj avatar Sep 27 '17 21:09 pcj

@pcj sorry for the delay.

If we had a lock file of some form couldn't we generate it and get rid of the copy pasting ? The user manages tuning the dependencies but beyond that the boilerplate could be generated.

Taking some inspiration from the go rules gazelle tool. Could we express dependencies in a yaml file with the high level co-ords of along with force entries. This repo could provide a tool of some form that generates two skylark files.

  1. The external repo macro file: contains a macro with all the maven_repository rules.
  2. The loader macro file: contains load call for all the external repos and a macro that primes them all.

Would this be doable ?

hsyed avatar Sep 30 '17 08:09 hsyed

Have you tried https://github.com/johnynek/bazel-deps by @johnynek? That approach is fairly similar to what you are describing.

pcj avatar Sep 30 '17 17:09 pcj