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

Skip over godebug lines in go.mod/go.work files #1946

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

Conversation

zecke
Copy link

@zecke zecke commented Oct 5, 2024

Go 1.21 introduced support for godebug lines in go.mod and go.work files. Skip over these lines instead of failing

Related #1945

What type of PR is this?

Uncomment one line below and remove others.

Bug fix
Feature
Documentation
Other

What package or component does this PR mostly affect?

For example:

language/go
cmd/gazelle
go_repository
all

What does this PR do? Why is it needed?

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Go 1.21 introduced support for godebug lines in go.mod and go.work
files. Skip over these lines instead of failing

Related bazel-contrib#1945
@zecke
Copy link
Author

zecke commented Oct 11, 2024

What if we handle this like the go_embed directive and update the x_defs?

@fmeum
Copy link
Member

fmeum commented Oct 11, 2024

Yeah, I'm all for treating this exactly like Go itself does, I just don't know how it's wired up exactly. Happy to review a change that goes beyond skipping.

@zecke
Copy link
Author

zecke commented Oct 11, 2024

Yeah, I'm all for treating this exactly like Go itself does, I just don't know how it's wired up exactly. Happy to review a change that goes beyond skipping.

From what I can tell is that one of the challenges of rules_go is that the builder is not using go build. Which means we don't benefit from some of the checks (e.g. checking if the flag exists, if one can link an internal package).

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