Skip to content

Check for 'deps' attr in scala_doc rule #1740

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

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions scala/private/rules/scala_doc.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Scaladoc support"""

load("//scala/private:common.bzl", "collect_plugin_paths")
load("//scala:providers.bzl", "ScalaInfo")
load("//scala/private:common.bzl", "collect_plugin_paths")

ScaladocAspectInfo = provider(fields = [
"src_files", #depset[File]
Expand Down Expand Up @@ -33,7 +33,7 @@ def _scaladoc_aspect_impl(target, ctx, transitive = True):

macro_classpath = []

for dependency in ctx.rule.attr.deps:
for dependency in getattr(ctx.rule.attr, "deps", []):
if ScalaInfo in dependency and dependency[ScalaInfo].contains_macros:
macro_classpath.append(dependency[JavaInfo].transitive_runtime_jars)

Expand Down
2 changes: 1 addition & 1 deletion test/shell/test_macros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
runner=$(get_test_runner "${1:-local}")

incorrect_macro_user_does_not_build() {
(! bazel build //test/macros:incorrect-macro-user) |&
(! bazel build //test/macros:incorrect-macro-user) 2>&1 |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was invalid on my mac GNU bash, version 3.2.57(1)-release (arm64-apple-darwin24)

Copy link
Contributor

@mbland mbland May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, yeah, I forgot to mention that. I just fixed that locally, too. Wouldn't hurt to put a #!/usr/bin/env bash at the top, either.

grep --fixed-strings 'Build failure during macro expansion. You may have declared a target containing a macro as a `scala_library` target instead of a `scala_macro_library` target'
}

Expand Down