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

go/build: missing Position information for go:embed patterns #43632

Closed
bcmills opened this issue Jan 11, 2021 · 4 comments
Closed

go/build: missing Position information for go:embed patterns #43632

bcmills opened this issue Jan 11, 2021 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jan 11, 2021

Go 1.16 adds support for go:embed patterns in source files (#41191), which are parsed and reported by the go/build package in the {,Test,XTest}EmbedPatterns fields of the build.Package struct as of CL 243941.

Much like imports, embed patterns can introduce errors in the build due to missing inputs — in this case, missing embedded files. Those errors need to be attributed back to source file positions.

For imports, the build.Package struct represents the file and line information as token.Position values in the {,Test,XTest}ImportPos fields. However, the corresponding information for embed patterns seems not to be present.

This came to my attention via CL 280452.

@bcmills
Copy link
Contributor Author

bcmills commented Jan 11, 2021

Marking as release-blocker for Go 1.16 because it impacts go:embed API changes for 1.16 (#43407; CC @golang/release, @rsc).

However, we could perhaps decide to ship the go/build API changes as-is and follow up with fields for the missing position information in a subsequent release, in which case this issue should be re-milestoned.

@bcmills bcmills added this to the Go1.16 milestone Jan 11, 2021
@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jan 11, 2021
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 11, 2021
@gopherbot
Copy link

Change https://golang.org/cl/283638 mentions this issue: cmd/go/internal/load: report positions for embed errors

@gopherbot
Copy link

Change https://golang.org/cl/283636 mentions this issue: go/build: report positions for go:embed directives

gopherbot pushed a commit that referenced this issue Jan 14, 2021
For #43469
For #43632

Change-Id: I9ac2da690344935da0e1dbe00b134dfcee65ec8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/283636
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/285213 mentions this issue: doc/go1.16: mention go/build changes

gopherbot pushed a commit that referenced this issue Jan 25, 2021
For #40070
For #41191
For #43469
For #43632

Change-Id: I6dc6b6ea0f35876a4c252e4e287a0280aca9d502
Reviewed-on: https://go-review.googlesource.com/c/go/+/285213
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants
@bcmills @gopherbot and others