cmd/go: [modules + integration] go mod build, build all the binaries provided by a module #31323
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 needs an official
go mod build
command that builds all the binaries provided by a particular Go module.Constrains
the input should be:
module path
, ormodule path
+module version
, orfilesystem path
of a specificmod
module descriptorgo.mod
file at the root of an unpacked module tree, ormod
file inside a goproxy hierarchyall the usual
go build
flags should applythe
destination
should be any binary directory path the user specifiesfor compatibility with existing tooling, a separate optional
prefix
flag should allow pre-pending a path to the destination:destination
, actually work onfilepath.Join(prefix, destination)
canonical_path
, using a/prefix/canonical_path
staging directoryto allow integration with CI/CD software, the command should optionally output a list of the files it created, in machine-readable format, to a user-specified result file
destination
prefix
, since the command is pretending to write directly intodestination
go mod pack
(cmd/go: [modules + integration] go mod pack, pack sources as module files #31302) and should use the same conventionsthe command should allow selecting (or not) the following binary sets:
the command should work in secure no-internet-download mode. In that mode it should fail if one of the modules it needs for building is not available in the cache or configured goproxy (cmd/go: [modules + integration] use several goproxy sources simultaneously #31304) sources
go get
download from the internetMotivation
Go modules are wonderful and exciting, until you realise they only deal with the code download part. One stills need to dissect individual Go packages in the next stages of a CI/CD Go-related job.
The Go module concept should be extended to the rest of Go code processing phases.
The text was updated successfully, but these errors were encountered: