Skip to content

cmd/go: -gcflags and cached packages #19340

Description

@aarzilli

Delve builds its binaries using -gcflags='-N -l' to disable inlining and optimizations. This works well until the user separately does a go install or a go build -i at which point any subsequent build will pick up the cached version of all unchanged dependencies, built with optimizations turned on, leading to surprising behavior.

Attempting to circumvent this problem by passing -a to build fail because of #18774.

Considering that #18774 has existed for a while (the first reference I found is #12055) would it be possible to make build pick up cached packages only when compiler flags match, making an exception for runtime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions