golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.73k stars 17.63k forks source link

cmd/go: [modules + integration] go mod requires, list the direct requirements for using a module #31308

Open nim-nim opened 5 years ago

nim-nim commented 5 years ago

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 requires command that processes packed Go module file and returns the list of dependencies needed to use this module in other code.

go mod requires could be implemented as a go mod graph mode, via specific option flags, or as a separate subcommand.

It is the pendant of go mod buildrequires (#31300) and used by the CI/CD system to populate the job runtime environment, after go mod buildrequires analysis.

Constrains

Motivation

thepudds commented 5 years ago

FYI, as of now, there are currently 7 or so related issues filed today. See for example this search on open issues authored by @nim-nim.

CC @bcmills @rsc

nim-nim commented 5 years ago

@thepudds Thanks for the ping. I still have a few more to write, it takes time to put things into order and write a coherent report.

nim-nim commented 5 years ago

@thepudds @bcmills @rsc Since the generic issue boilerplate references issue #29452, it has an up-to-date list of all the reports I filled.

Short-term the only remaining showstopper for is issue #31304. I know how to workaround or get by without the others, in degraded mode¹.

Mid to long-term local workarounds and degraded mode are a terrible strategy. Once the language is no longer new and shiny (which will eventually happen to Go), people will actively resist getting involved in something that makes their integration work an obstacle course, and people already involved will migrate to bluer skyes. It’s not a single issue problem, it’s a death by a thousand papercuts problem, where each small tooling misbehaviour and missing functionnality contributes to human rejection.

¹ Workaround means reimplementing the Go tooling:

nim-nim commented 5 years ago

(also, issue #31304 is something more in @jcajka’s ballpark than mine Fedora-side, since it touches directly the go compiler behaviour)