Skip to content

gazelle: smacker/go-tree-sitter package conflictΒ #3151

@Olsworn

Description

@Olsworn

🐞 bug report

Affected Rule

Using @rules_python_gazelle_plugin//python in the language array of a gazelle_binary rule.

Is this a regression?

No

Description

Running gazelle_binary with the @rules_python_gazelle_plugin//python plugin, along with another plugin that depends on github.com/smacker/go-tree-sitter fails to build.

πŸ”¬ Minimal Reproduction

https://github.com/Olsworn/rules_python_gazelle_smacker

πŸ”₯ Exception or Error


package conflict error: github.com/smacker/go-tree-sitter: multiple copies of package passed to linker:
    @@rules_python_gazelle_plugin++_repo_rules+com_github_smacker_go_tree_sitter//
    @@gazelle++go_deps+com_github_smacker_go_tree_sitter//

🌍 Your Environment

Operating System:

  
linux_amd64
  

Output of bazel version:

  
8.3.1
  

Rules_python version:

1.5.1 patched with the latest changes from "main".
Or specifically the commit which interests us from: #3069

Anything else relevant?

It seems like the issue is caused by the patch on: com_github_smacker_go_tree_sitter

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_github_smacker_go_tree_sitter",
build_file = "//:internal/smacker_BUILD.bazel",
integrity = "sha256-4AkDY4Rh5Auu9Kwzhj5XYSirMLlhmd6ClMWo/r0kmu4=",
strip_prefix = "go-tree-sitter-dd81d9e9be82a8cac96ed1d50c7389c5f1997c02",
url = "https://github.com/smacker/go-tree-sitter/archive/dd81d9e9be82a8cac96ed1d50c7389c5f1997c02.zip",
)

I am not sure what the patch adding various header files to github.com/smacker/go-tree-sitter/python is supposed to help with, but our setup seems to run fine without it, and does not produce any diff when running gazelle after removing that patch.
Just removing that patch might lead to other issues that I am not aware of though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions