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

[Bazel CI]Error in glob: glob pattern '*.jar' didn't match anything #109

Open
sgowroji opened this issue Oct 10, 2024 · 6 comments
Open

Comments

@sgowroji
Copy link
Member

sgowroji commented Oct 10, 2024

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4189#019274a0-a4f7-4c6a-985e-2429371cae1f

Platform: Ubuntu

Logs:

 ERROR: Traceback (most recent call last):
    File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ce3a021bc359dbeb12949f8320b71d1f/external/stardoc+/stardoc/BUILD", line 72, column 16, in <toplevel>
        srcs = glob(["*.jar"]),
Error in glob: glob pattern '*.jar' didn't match anything, but allow_empty is set to False (the default value of allow_empty can be set with --incompatible_disallow_empty_glob).
(04:27:38) ERROR: /var/lib/buildkite-agent/builds/bk-docker-qd9t/bazel-org-repo-root/rules_testing/docgen/BUILD:24:16: Target '@@stardoc+//stardoc:templates/markdown_tables/repository_rule.vm' contains an error and its package is in error and referenced by '//docgen:_docs_struct_subject'
(04:27:38) ERROR: Analysis of target '//docgen:docs_build_test' failed; build aborted: Analysis failed
(04:27:38) INFO: Elapsed time: 2.517s, Critical Path: 0.03s
(04:27:38) INFO: 1 process: 1 internal.
(04:27:38) ERROR: Build did NOT complete successfully
(04:27:38) ERROR: No test targets were found, yet testing was requested
(04:27:38) FAILED:

Culprit: bazelbuild/bazel#8195

Steps:

 git clone https://github.com/bazelbuild/rules_testing
git reset 724bf647aaf30d302f07c7890b5c8149526bbfe7  --hard
export USE_BAZEL_VERSION=788b6080f54c6ca5093526023dfd9b12b90403f8
bazel test --enable_bzlmod //docgen/... //docs/... 

CC Greenteam @fweikert

@rickeylev
Copy link
Collaborator

I can't repro. The error looks like it comes from stardoc. I think this was fixed by mattrobmattrob/stardoc@5f92c74

I'd close this issue, but it looks like I don't have that permission anymore 🤷

@sgowroji
Copy link
Member Author

Hi @rickeylev, Missed adding the test flag =  "--enable_bzlmod". Updated now. please take a look. Am able to reproduce this issue in local adding below logs for your reference.

sgowroji-macbookpro3:rules_testing sgowroji$ git clone https://github.com/bazelbuild/rules_testing
Cloning into 'rules_testing'...
remote: Enumerating objects: 798, done.
remote: Counting objects: 100% (382/382), done.
remote: Compressing objects: 100% (176/176), done.
remote: Total 798 (delta 250), reused 265 (delta 201), pack-reused 416 (from 1)
Receiving objects: 100% (798/798), 345.99 KiB | 3.36 MiB/s, done.
Resolving deltas: 100% (453/453), done.
sgowroji-macbookpro3:rules_testing sgowroji$ cd rules_*
sgowroji-macbookpro3:rules_testing sgowroji$ git reset 724bf647aaf30d302f07c7890b5c8149526bbfe7  --hard
HEAD is now at 724bf64 Skip analysis tests when coverage is run.
sgowroji-macbookpro3:rules_testing sgowroji$ export USE_BAZEL_VERSION=788b6080f54c6ca5093526023dfd9b12b90403f8
sgowroji-macbookpro3:rules_testing sgowroji$ bazel test --enable_bzlmod //docgen/... //docs/... 
2024/10/14 09:39:22 Using unreleased version at commit 788b6080f54c6ca5093526023dfd9b12b90403f8
2024/10/14 09:39:22 Downloading https://storage.googleapis.com/bazel-builds/artifacts/macos/788b6080f54c6ca5093526023dfd9b12b90403f8/bazel...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
WARNING: For repository 'platforms', the root module requires module version platforms@0.0.6, but got platforms@0.0.10 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.3.0, but got bazel_skylib@1.7.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_license', the root module requires module version rules_license@0.0.4, but got rules_license@1.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'io_bazel_stardoc', the root module requires module version stardoc@0.6.2, but got stardoc@0.7.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_python', the root module requires module version rules_python@0.27.0, but got rules_python@0.36.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'protobuf' found. This will result in a failure if there's a reference to those rules or symbols.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
ERROR: Traceback (most recent call last):
	File "/private/var/tmp/_bazel_sgowroji/45a7034ebd75ba66b4f1abff8e305317/external/stardoc+/stardoc/BUILD", line 72, column 16, in <toplevel>
		srcs = glob(["*.jar"]),
Error in glob: glob pattern '*.jar' didn't match anything, but allow_empty is set to False (the default value of allow_empty can be set with --incompatible_disallow_empty_glob).
ERROR: /Users/sgowroji/bazelci/rules_testing/rules_testing/docgen/BUILD:24:16: Target '@@stardoc+//stardoc:templates/markdown_tables/module_extension.vm' contains an error and its package is in error and referenced by '//docgen:_docs_action_subject'
Target //docs:requirements_test was skipped
ERROR: Analysis of target '//docgen:_docs_action_subject' failed; build aborted: Analysis failed
INFO: Elapsed time: 22.651s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
//docs:requirements_test                                                SKIPPED

Executed 0 out of 1 test: 1 was skipped.
All tests passed but there were other errors during the build.

@rickeylev
Copy link
Collaborator

The reported error is in stardoc, so I tried updating from 0.6.2 to 0.7.1. Though the empty_glob error is gone, a different error occurs:

ERROR: /home/rlevasseur/.cache/bazel/_bazel_rlevasseur/33243b5ab4f0b3234dfa3a65696fc186/external/rules_jvm_external+/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/BUILD:3:12: @@rules_jvm_external+//private/tools/java/com/github/bazelbuild/rules_jvm_external/jar:AddJarManifestEntry: no such attribute 'srcs' in 'java_binary' rule

Which is pretty weird error. I get the impression autoloading might have something to do with it.

In any case, sounds like, at the least, we need bump the stardoc version in MODULE.bazel

@fmeum
Copy link
Contributor

fmeum commented Oct 28, 2024

This is consistent with java_binary being an empty rule, which is an indication that autoloading failed unexpectedly.

@rickeylev
Copy link
Collaborator

Yeah, I'm increasing convinced there is some sort of bug with autoloading or an upstream dependency (protobuf, I think) isn't ready yet.

Another oddity is rules_python is able to run under bazel 8, and it should have a superset of dependencies of rules_testing. Yet I can't get a working bazel 8 build for rules_testing.

@rickeylev
Copy link
Collaborator

rickeylev commented Oct 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants