bazel: jar stamping of external repositories is broken

Description of the problem / feature request:

When one uses java_common.stamp_jar in a target of an external repository (for example scala_import_external which uses scala_import) bazel fails:

Output artifact 'external/io_bazel_rules_scala_scalactic/scalactic_2.11-3.0.5-stamped.jar' not under package directory 'external/io_bazel_rules_scala/scala/scalatest' for target '@io_bazel_rules_scala//scala/scalatest:scalatest'

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Create a custom jvm “import” rule which doesn’t use ijar and call java_common.stamp_jar in it. Create a repository rule which writes a BUILD file using the above rule. Have a target in your workspace depend on the above and see the failure. @anchlovi, Do you think you can generate a branch of rules_scala which fails like above?

What’s the output of bazel info release?

0.19.2

@lberki @iirina I don’t know how easy/hard it will be to fix this but if it’s easy and can get in to 0.21 that would be great. We want to try and push forward the move to JavaInfo and the usage of stamp_jar. Usage of stamp_jar will allow to align rules_scala with rules_java with respect to strict-deps labels and possibly performance (a lot of depset (mis?)handling going on right now)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (15 by maintainers)

Most upvoted comments

@ittaiz, let’s get this fixed. 😉