Skip to content

Commit 222acba

Browse files
author
Jaden Peterson
committed
Compute the SemanticDB target root correctly
In Bazel, `File#short_path` is prefixed with `..` if the file belongs to an external repository. However, this isn't meant to be interpreted as a relative path, as external repositories' outputs are in the `external` output directory. This meant that when `semanticdb_bundle` was enabled and external repositories contained Scala rules, they'd fail to build, since the `-P:semanticdb:sourceroot` or `-semanticdb-target` compiler options would be computed incorrectly.
1 parent ae550b8 commit 222acba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/private/phases/phase_semanticdb.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def _semanticdb_directory_from_file(file):
1515
nested function closure by default.
1616
"""
1717

18-
return "{}/{}".format(file.root.path, file.short_path[:file.short_path.find("META-INF") - 1])
18+
return file.path[:file.path.find("META-INF") - 1]
1919

2020
#
2121
# PHASE: semanticdb

0 commit comments

Comments
 (0)