Skip to content

x/tools: TestCgoNoSyntax doesn't seem to be passing -compiled when NeedTypes is set #52435

Open
@matloob

Description

@matloob

Context: https://go-review.googlesource.com/c/tools/+/393017/comments/b58b52f4_30beeb0f

Getting types for cgo requires CompiledGoFiles because we need to run cgo preprocessing on the Go files before running the typechecker on them. We don't request compiled files by default when doing typechecking because for non-cgo files we can check types without .go files, but TestCgoNoSyntax relies on CompiledGoFiles being present on the output of the go command to properly check types.

It seems like either the test should need to explicitly request compiled files, or specify that it uses cgo (there's currently a non-exported bit for this), or maybe there should be some way for go/packages to upgrade to requesting compiled go files in certain circumstances where cgo is present?

cc: @bcmills

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions