bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
45 stars 30 forks source link

Provide tooling to import multiple versions of an artifact #11

Open petroseskinder opened 7 years ago

petroseskinder commented 7 years ago

Migrated from issue #1783 in main repository.

E.g., generate_workspace --artifact=jetty:1,old_prod --artifact=jetty:2,prod will create two maven_jars with the given suffixes and their dependencies, matching deps where possible and appending the suffix where not, e.g.,

jetty_prod -> foo_prod -> bar
jetty_old_prod -> foo_old_prod -> bar

jetty, foo, and bar are maven artifacts, dep on bar is the same version for both, dep on foo is not.

petroseskinder commented 7 years ago

@kchodorow this is an old issue or idea for a feature. However, I would argue that this tool shouldn't allow shading, i.e. adding suffixes to targets. My reasoning is that it makes upgrading an extremely painful and messy process. In addition, suppose we introduce another maven package that depends on foo:3.1, which just so happens to be foo_old_prod, we would need to be able to identify this equivalence when we fetch jars. There are other arguments against shading in package managers.

Although it has been a while, do you remember what context or use case prompted the issue?

kchodorow commented 7 years ago

Yeah, some companies have old projects that are stuck using some version of a library and other parts of the codebase that use another. We might be able to do something elegant here with selects so that we'd have one jetty target, but code tagged legacy would get the version exporting jetty-1.jar and "normal" code would get jetty-2.jar.