bazel-contrib / bazel-contrib/rules_python
`external/gazelle~~go_deps~com_github_dougthor42_go_tree_sitter/python/scanner.c:1:10: fatal error: '../array.h' file not found` with gazelle 0.38+
- Dominant language
- Starlark
- Stars
- 688
- Forks
- 721
- Avg merge
- 14h 49m
- Merged PRs (30d)
- 81
Description
# 🐞 bug report
### Affected Rule
The issue is caused by the rule: rules_python_gazelle_plugin (version 1.1.0) when running with gazelle 0.38+
### Is this a regression?
Maybe, the issue starts with gazelle 0.38
### Description
A clear and concise description of the problem...
When running gazelle `bazel run //python:gazelle update` go_tree_sitter fails to build
This is using the config from https://github.com/bazelbuild/rules_python/tree/main/examples/bzlmod_build_file_generation
When downgrading gazelle to 0.37 it runs (at the expense of features in go, namely the `build_file_generation = "clean"` which was introduced in 0.38)
The issue seems linked to https://github.com/smacker/go-tree-sitter/issues/175
## 🔬 Minimal Reproduction
https://github.com/bazelbuild/rules_python/tree/main/examples/bzlmod_build_file_generation with gazelle 0.38+
## 🔥 Exception or Error
INFO: Analyzed target //python:gazelle (51 packages loaded, 282 targets configured).
ERROR: /private/var/tmp/_bazel_ripper/5d3e93b0f5b6e19252cd0dca794d49db/external/gazelle~~go_deps~com_github_dougthor42_go_tree_sitter/python/BUILD.bazel:3:11: GoCompilePkg external/gazelle~~go_deps~com_github_dougthor42_go_tree_sitter/python/python.a failed: (Exit 1): builder failed: error executing GoCompilePkg command (from target @@gazelle~~go_deps~com_github_dougthor42_go_tree_sitter//python:python) bazel-out/darwin_x86_64-opt-exec-ST-d57f47055a04/bin/external/rules_go~~go_sdk~myproject__download_0/builder_reset/builder compilepkg -sdk external/rules_go~~go_sdk~myproject__download_0 -goroot ... (remaining 43 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/gazelle~~go_deps~com_github_dougthor42_go_tree_sitter/python/scanner.c:1:10: fatal error: '../array.h' file not found
#include "../array.h"
^~~~~~~~~~~~
1 error generated.
compilepkg: error running subcommand external/toolchains_llvm~~llvm~llvm_toolchain/bin/cc_wrapper.sh: exit status 1
Target //python:gazelle failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 29.799s, Critical Path: 5.75s
INFO: 33 processes: 9 internal, 24 darwin-sandbox.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
## 🌍 Your Environment
**Operating System:**
Mac OS 15.1.1 (24B91) Intel
**Output of `bazel version`:**
Build label: 7.4.1-homebrew
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800
**Rules_python version:**
bazel_dep(name = "rules_python", version = "1.1.0")
bazel_dep(name = "rules_python_gazelle_plugin", version = "1.1.0")
**Anything else relevant?**
Contributor guide
Assessment
This issue has not been assessed yet.