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

cmd/go: using go list -json=, EmbedFiles affects the presence of CompiledGoFiles, Export fields #59255

Closed
findleyr opened this issue Mar 26, 2023 · 5 comments
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@findleyr
Copy link
Contributor

Discovered while debugging a problem with go/packages, but minimized below. Observe that the presence of the EmbedFiles field in go list -json affects the presence of the CompiledGoFiles and Export fields.

This example was run from a workspace checked out to kubernetes@v1.24.0. This appears to affect many but not all packages. In this case ./pkg/kubelet/container does not have any go:embed directives, but perhaps this is related to a package in its transitive dependencies.

[kubernetes]> go list -e -json=Name,ImportPath,CompiledGoFiles,Export -compiled=true -export=true -find=false -- ./pkg/kubelet/container
{
        "ImportPath": "k8s.io/kubernetes/pkg/kubelet/container",
        "Name": "container"
}
[kubernetes]> go list -e -json=Name,ImportPath,CompiledGoFiles,Export,EmbedFiles -compiled=true -export=true -find=false -- ./pkg/kubelet/container
{
        "ImportPath": "k8s.io/kubernetes/pkg/kubelet/container",
        "Name": "container",
        "Export": "/home/rfindley/.cache/go-build/2f/2fbdb57edbec5ac55ec09a4e2eef9b20c2c354a33d7d953670540b41bb02e724-d",
        "CompiledGoFiles": [
                "cache.go",
                "container_gc.go",
                "helpers.go",
                "os.go",
                "ref.go",
                "resize.go",
                "runtime.go",
                "runtime_cache.go",
                "runtime_cache_fake.go",
                "sync_result.go"
        ]
}
@mdempsky mdempsky added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 27, 2023
@mdempsky
Copy link
Member

/cc @bcmills

@findleyr
Copy link
Contributor Author

CC @matloob as well.

@bcmills
Copy link
Contributor

bcmills commented Mar 31, 2023

What go version was this running against? This should have been fixed by CL 477197.

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. GoCommand cmd/go labels Mar 31, 2023
@bcmills bcmills added this to the Go1.21 milestone Mar 31, 2023
@findleyr
Copy link
Contributor Author

The issue was filed before that CL. I will test at tip and close this after confirming.

@findleyr
Copy link
Contributor Author

findleyr commented Apr 3, 2023

Looks like it is fixed.

@findleyr findleyr closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants