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

Make go_bazel_test pass with Bzlmod enabled #4000

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Jul 31, 2024

This is a quick fix for the test runner only, the tests themselves still rely on WORKSPACE (via local_repository). The rules_go repo is also hardcoded, which means that other external repos likely won't work.

What type of PR is this?

Uncomment one line below and remove others.

Bug fix
Feature
Documentation
Other

What does this PR do? Why is it needed?

Which issues(s) does this PR fix?

Fixes #

Other notes for review

This is a quick fix for the test runner only, the tests themselves still rely on WORKSPACE (via local_repository).
The rules_go repo is also hardcoded, which means that other external repos likely won't work.
@fmeum
Copy link
Member Author

fmeum commented Jul 31, 2024

@tyler-french @linzhp This is the minimal change needed to get go_bazel_test to pass in the Gazelle repo.

The automatic collection of repos from runfiles is problematic with Bzlmod since we have no easy way of knowing the apparent name. If we decide to stick with it, I can probably make it work by generating and parsing repo_mapping files, but even that may not work due to the differences between local_repository and a proper Bazel module.

A better solution would be to rewrite the tests to use Bzlmod exclusively and, with the exception of the current repo, load all deps from the BCR instead of from runfiles. That's quite a non-trivial task though.

@fmeum fmeum marked this pull request as ready for review August 21, 2024 21:02
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.

1 participant