Skip to content

cmd/go: allow local replacements without a corresponding explicit requirement? #33370

Open
@bcmills

Description

@bcmills

In CL 153157, I added code so that a module path that has a replace directive resolves to a pseudo-version of the form vX.0.0-00010101000000-000000000000 rather than checking for upstream dependencies.

That unblocks builds, but means that the module graph may indicate a commit that doesn't actually exist. There are use-cases for such a configuration, such as testing against unpublished commits of upstream modules (see #26241 (comment) and #32776), but since the commit does not actually exist, the requirement graph of the resulting module cannot be used without a corresponding replace directive in every downstream consumer.

Since this pseudo-version has an unambiguous and very unique commit hash (all zeroes!), I propose that we special-case it (if unreplaced) and treat it as equivalent to an empty commit.

CC @jayconrod @thepudds @rogpeppe

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions