Skip to content

support installation via Bzlmod or WORKSPACE in addition to go.mod#1

Merged
jvandew merged 6 commits intomainfrom
jacob-workspaceInstallSupport
Jun 2, 2025
Merged

support installation via Bzlmod or WORKSPACE in addition to go.mod#1
jvandew merged 6 commits intomainfrom
jacob-workspaceInstallSupport

Conversation

@jvandew
Copy link
Copy Markdown
Contributor

@jvandew jvandew commented Jun 1, 2025

While this repo was previously consumable as a go dependency (which is in fact how our internal monorepo consumes it), it is also useful to allow installation via Bzlmod or WORKSPACE for repos which otherwise don't require a go environment. Support for these is added here, although Bzlmod currently requires an --override_module flag as we aren't published to the Bazel Central Registry.

The two main bits of complexity here are:

  1. Making sure the requisite go module dependencies get installed. Bzlmod handles this for us, but WORKSPACE requires that we set up Gazelle to generate a macro users can call to install them.

  2. Solving the patching situation with go-tree-sitter. There is an unreleased fix merged to rules_go which this PR uses to remove the need for patching in this repo. However, we still require the patch being available for downstream users who might not have the rules_go fix available. In the WORKSPACE setup this is handled for them by the scala_gazelle_deps macro, but Bzlmod users will have to add the go_deps.module_override manually as it is only callable from their repo's root module.

@jvandew jvandew requested review from a team and jamesma100 June 1, 2025 15:23
@jvandew jvandew merged commit 7f6784a into main Jun 2, 2025
@jvandew jvandew deleted the jacob-workspaceInstallSupport branch June 2, 2025 20:27
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

Successfully merging this pull request may close these issues.

2 participants