vaticle / bazel-distribution

Bazel rules for assembling and deploying software distributions (see @vaticle for usage example)
https://bazel.build
Apache License 2.0
155 stars 53 forks source link

assemble_maven fails when workspace_refs is not set #403

Open agluszak opened 4 months ago

agluszak commented 4 months ago

workspace_refs in assemble_maven defaults to None, but apparently it has to be specified.

ERROR: /home/andrzej.gluszak/code/jetbrains/build-server-protocol/bsp4j/BUILD:22:15: in assemble_maven rule //bsp4j:bsp4j-maven: 
Traceback (most recent call last):
        File "/home/andrzej.gluszak/.cache/bazel/_bazel_andrzej.gluszak/c4fc80b1fd3f4a972d7f2a9d753953d8/external/vaticle_bazel_distribution~override/maven/rules.bzl", line 166, column 34, in _assemble_maven_impl
                pom_file = _generate_pom_file(ctx, version_file)
        File "/home/andrzej.gluszak/.cache/bazel/_bazel_andrzej.gluszak/c4fc80b1fd3f4a972d7f2a9d753953d8/external/vaticle_bazel_distribution~override/maven/rules.bzl", line 94, column 63, in _generate_pom_file
                "--workspace_refs_file=" + ctx.file.workspace_refs.path,
Error: 'NoneType' value has no field or method 'path'
ERROR: /home/andrzej.gluszak/code/jetbrains/build-server-protocol/bsp4j/BUILD:22:15: Analysis of target '//bsp4j:bsp4j-maven' failed
INFO: Analyzed target //bsp4j:bsp4j-maven (222 packages loaded, 4987 targets configured).
WARNING: errors encountered while analyzing target '//bsp4j:bsp4j-maven', it will not be built.
INFO: Found 0 targets...
ERROR: command succeeded, but not all targets were analyzed
INFO: Elapsed time: 0.539s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
alexjpwalker commented 3 weeks ago

According to this issue and PR it was intentionally made optional. Perhaps a change since has broken it in the case that it is unset?