Skip to content

cmd/dist: internal import detection is generating false positives #68570

Open
@4a6f656c

Description

@4a6f656c

After updating the Go port for OpenBSD to start testing 1.23rc2, the build fails with:

===>  Building for go-1.23rc2
Building Go cmd/dist using /usr/ports/pobj/go-1.23rc2/go-openbsd-amd64-bootstrap. (go1.22.5 openbsd/amd64)
Building Go toolchain1 using /usr/ports/pobj/go-1.23rc2/go-openbsd-amd64-bootstrap.
go tool dist: /usr/ports/pobj/go-1.23rc2/go/src/cmd/internal/obj/x86/asm_test.go.orig.port:10: bootstrap-copied source file cannot import internal/testenv

This appears to be a result of code added in 805f6b3, combined with the fact that the OpenBSD ports build applies patches (and hence patch produces a backup .orig.port file). This approach has worked without issue for Go 1.22 (and every earlier version) - the new code seems to be unnecessarily excessive since this is not a .go file, does not have any build tags and is additionally test code.

In order to avoid packaging complications, can we restrict this check to files that Go will actually compile?

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.OS-OpenBSD

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions