On Sun, Dec 22, 2024, at 01:12, Marek Paśnikowski wrote: > This is exactly it. You always must supply the #:import-path in Go build > system. > > This path is vital to the operation of the build system, as it adapts Go > build > environment to Guix environment. This path matches the name of the currently > built module. > > In practice, it is the string that follows the 'module' keyword in go.mod > files. > > I do not know the theory behind this coupling.
There is not much theory behind it. At the time we made the go-build-system, the process of building Go packages was different from how it is today. For example, Go modules had not been invented yet. Additionally, those of us who made the go-build-system were not Go programmers and did not (and still do not) have a strong understanding of how Go software is built. But, the import path was critical for building a Go codebase at that time. It was (is?) the actual "name" of the software, and is generally equivalent to the canonical URI from where the code is fetched. An unusual choice but it was the choice made by the Go team. Overall, Guix's Go build system is due for a complete overhaul by people who actually understand Go idioms.
