cmd/go: [modules + integration] tidy a specific module descriptor #31318
Labels
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
This report is part of a series, filled at the request of @mdempsky, focused at making Go modules integrator-friendly.
Please do not close or mark it as duplicate before making sure you’ve read and understood the general context. A lot of work went into identifying problems points precisely.
Needed feature
go mod tidy
needs to optionally operate on a specific*.mod
module descriptor file.Constrains
go.mod
located at the tree root) andzip
payload filename)module path
(+module version
) tricky for humans. It is very likely the go command will find some other module in its cache to work on, instead of using the one the human intended.Motivation
Curating a module for use in an integration baseline may result in:
This will invalidate part of the dependency information in the upstream
go.mod
file. In fact, retargetting dependencies to something saner, part of the integrator baseline, is often the whole point of the curating process.It is undesirable to recompute the new module descriptor before all the curating operations in the CI/CD job have finished. As long as the module has not been packed, some modifications can still occur. Therefore, the correct and safe
go mod tidy
target is the packed module fileset.Trying to schedule descriptor tiding before the packing has finished is unreliable, because some of the culling can occur directly during zip payload writing time. That is not the case for
go mod pack
, as specified in #31302, but it is the case for modist.The text was updated successfully, but these errors were encountered: