bazelbuild / migration-tooling

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

--artifact is pulling in unrelated artifacts #41

Closed pgr0ss closed 7 years ago

pgr0ss commented 7 years ago

I ran this on a fresh clone of migration-tooling:

bazel run //generate_workspace -- --output_dir /tmp --artifact=com.google.guava:guava:22.0

and it wrote a generate_workspace.bzl with 138 dependencies:

% grep -A 1 native.maven_jar /tmp/generate_workspace.bzl | grep name | wc -l       
138

% grep -A 1 native.maven_jar /tmp/generate_workspace.bzl | grep name | sort | head
      name = "ant_ant",
      name = "asm_asm",
      name = "backport_util_concurrent_backport_util_concurrent",
      name = "cglib_cglib",
      name = "classworlds_classworlds",
      name = "com_google_code_findbugs_jsr305",
      name = "com_google_errorprone_error_prone_annotations",
      name = "com_google_guava_guava",
      name = "com_google_j2objc_j2objc_annotations",
      name = "com_jcraft_jsch",

When I run the similar command in the main bazel repo, I only get 5:

% cd /tmp/bazel

% bazel run //src/tools/generate_workspace -- --output_dir /tmp --artifact=com.google.guava:guava:22.0

% grep -A 1 maven_jar /tmp/WORKSPACE | grep name | wc -l                                                                                                                       
5
% bazel version
Build label: 0.5.2
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 27 13:27:03 2017 (1498570023)
Build timestamp: 1498570023
Build timestamp as int: 1498570023
petroseskinder commented 7 years ago

@kchodorow we are treating build plug-ins as dependencies. For example, org.codehaus.mojo:animal-sniffer-annotations:1.14 has no direct dependencies. However, it does have org.apache.maven.plugins:maven-enforcer-plugin: and org.apache.maven:maven-plugin-api as plugins. [source]. 133 of the 138 dependencies are coming from plugins. I doubt this is good.

pgr0ss commented 7 years ago

Any update on this? It seems like a blocker to being able to switch to this repo. Thanks.

kchodorow commented 7 years ago

The patch above should fix it once it's merged, sorry about that.