Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.1.1] Fall back to rctx.name if $original_name is empty #25310

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static java.nio.charset.StandardCharsets.ISO_8859_1;

import com.github.difflib.patch.PatchFailedException;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.docgen.annot.DocCategory;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
Expand Down Expand Up @@ -168,7 +169,7 @@ public String getOriginalName() {
// backing Bazel modules. In case of the former, the original name is the same as the name, in
// the latter the original name doesn't matter as the restricted set of rules that can back
// Bazel modules do not use the name.
return originalName != null ? originalName : rule.getName();
return Strings.isNullOrEmpty(originalName) ? rule.getName() : originalName;
}

@StarlarkMethod(
Expand Down
Loading