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

rules_haskell does not build with incompatible_disallow_empty_glob #1827

Closed
limdor opened this issue Nov 3, 2022 · 5 comments · Fixed by #1828
Closed

rules_haskell does not build with incompatible_disallow_empty_glob #1827

limdor opened this issue Nov 3, 2022 · 5 comments · Fixed by #1828

Comments

@limdor
Copy link

limdor commented Nov 3, 2022

See: https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1320#018435e1-7742-44cb-911b-c21b89fb6e95

@avdv
Copy link
Member

avdv commented Nov 4, 2022

Noticed this error from the buildkite output:

(01:20:20) ERROR: Traceback (most recent call last):

	File "/var/lib/buildkite-agent/builds/bk-docker-6w0f/bazel-downstream-projects/rules_haskell/tests/stackage_zlib_runpath/BUILD.bazel", line 42, column 31, in <toplevel>

		srcs = glob(["**"]) + glob(["cabal_binary/**"]),

Error in glob: glob pattern 'cabal_binary/**' 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).

Is this a bug in Bazel? IMO, the pattern cabal_binary/** should match all files recursively inside the cabal_binary folder (there are two), but now it does not?

Using cabal_binary/* instead fixes the problem. But why is this?

@limdor
Copy link
Author

limdor commented Nov 4, 2022

It matches every file in every subdirectory. There is no subdirectory here.
The logic of logic is a bit complex, that is why some patterns are discouraged.
In the documentation the explanation is relatively complete with some examples included
https://bazel.build/reference/be/functions#glob

@limdor
Copy link
Author

limdor commented Nov 4, 2022

If you want to glob everything recursively you should do cabal_binary/**/*

@avdv
Copy link
Member

avdv commented Nov 4, 2022

Sorry for the noise, this actually works as intended, but one of the places where that specific pattern is used, has a typo 🙈

cabal-binary/** vs. cabal_binary/**

@limdor
Copy link
Author

limdor commented Nov 4, 2022

Ah ok, I did not see the typo

@mergify mergify bot closed this as completed in #1828 Nov 9, 2022
copybara-service bot pushed a commit to bazelbuild/bazel that referenced this issue Oct 7, 2024
This PR is to flip the default value of `incompatible_disallow_empty_glob`. This flag is tracked in #8195 and it is available since Bazel 0.29 from August 2019.
Once this is merged, users still can allow empty globs without being explicit setting `--incompatible_disallow_empty_glob=false`.

The motivation of the flip is bazel-contrib/SIG-rules-authors#37 and the fact of not keeping an incompatible flag for 4 years without flipping it.

What needs to be done before flipping this:

- [x] Merge protocolbuffers/upb#584
- [x] Update upb to a version that has the change in protocolbuffers/upb#584
- [x] Merge protocolbuffers/upb#745
- [x] Bring the changes from protocolbuffers/upb#745 to the 21.x branch
- [x] Bring the changes from protocolbuffers/upb@e5f2601 to the 21.x branch (protocolbuffers/upb#781)
- [x] Update upb to the latest commit of the 21.x branch (#16343)
- [x] Merge #15374
- [x] Merge #15339
- [x] Merge #15330
- [x] Merge #16431
- [x] Merge #16468
- [x] Get green checks for this PR
- [ ] Fix failures in downstream projects: https://buildkite.com/bazel/bazelisk-plus-incompatible-flags
  - [ ] Fix empty globs from IntellIJ Plugin (https://github.com/bazelbuild/intellij)
    - [ ] Issue: bazelbuild/intellij#4040
    - [ ] Android Studio Plugin
    - [ ] Android Studio Plugin Google
    - [ ] CLion Plugin
    - [ ] CLion Plugin Google
    - [ ] IntelliJ Plugin
    - [ ] IntelliJ Plugin Aspect
    - [ ] IntelliJ Plugin Aspect Google
    - [ ] IntelliJ Plugin Google
    - [ ] IntelliJ UE Plugin
    - [ ] IntelliJ UE Plugin Google
    - Opened PRs
      - [x] bazelbuild/intellij#4025
      - [x] bazelbuild/intellij#4038
  - [x] Fix empty globs from Bazel Bench (https://github.com/bazelbuild/bazel-bench)
    - [ ] bazelbuild/bazel-bench#174
    - [x] bazelbuild/bazel-bench#149
  - [x] Fix empty globs from Buildfarm (https://github.com/bazelbuild/bazel-buildfarm)
  - [x] Fix empty globs from Cargo
  - [x] ~~Fix empty globs from Cartographer (https://github.com/cartographer-project/cartographer)~~ (No longer maintained)
    - Issue: cartographer-project/cartographer#1908
    - PR to enforce it cartographer-project/cartographer#1944
  - [x] Fix empty globs from Cloud Robotics Core (https://github.com/googlecloudrobotics/core/)
    - [x] PR to prevent regresions googlecloudrobotics/core#279
  - [ ] Fix empty globs from Envoy
  - [x] Fix empty globs from FlatBuffers
  - [x] Fix empty globs from Flogger
  - [ ] Fix empty globs from Gerrit (https://gerrit.googlesource.com/gerrit.git)
    - Issue: https://issues.gerritcodereview.com/issues/40011754
  - [x] Fix empty globs from :bazel:Protobuf
  - [x] Fix empty globs from rules_android_ndk
  - [ ] Fix empty globs from rules_dotnet
  - [x] Fix empty globs from :bazel:rules_foreign_cc bazel-contrib/rules_foreign_cc#974
  - [x] Fix empty globs from rules_go
  - [x] Fix empty globs from rules_haskell tweag/rules_haskell#1827
  - [x] Fix empty globs from :bazel:rules_jvm_external
  - [x] Fix empty globs from rules_kotlin
  - [x] Fix empty globs from rules_nodejs
  - [x] Fix empty globs from :bazel:rules_python
  - [ ] Fix empty globs from rules_rust
  - [x] Fix empty globs from rules_swift
  - [x] Fix empty globs from rules_webtesting
  - [x] Fix empty globs from TensorFlow  tensorflow/tensorflow#58155
    - [x] tensorflow/tensorflow#58008
    - [x] tensorflow/tensorflow#58154
  - [x] Fix empty globs from upb

RELNOTES[INC]: The flag `--incompatible_disallow_empty_glob` now defaults to true.

Closes #15327.

PiperOrigin-RevId: 683316885
Change-Id: Id34ffd32a9e979fada9207e475b826a508100ba5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants