| 21 May 2025 |
| @alanpearce:private.coffee left the room. | 18:50:34 |
| Sebastian (he/him) joined the room. | 22:19:16 |
| 23 May 2025 |
| @silvio:booq.org left the room. | 08:16:29 |
| paq joined the room. | 21:13:28 |
| 26 May 2025 |
| XenGi joined the room. | 08:12:02 |
| Alison Jenkins joined the room. | 18:44:40 |
| 27 May 2025 |
| Lorenz joined the room. | 11:18:16 |
| 28 May 2025 |
| matrixrooms.info mod bot (does NOT read/send messages and/or invites; used for checking reported rooms) joined the room. | 09:01:47 |
| 29 May 2025 |
| deepreef11 joined the room. | 02:58:43 |
| 30 May 2025 |
| samuel joined the room. | 18:00:52 |
samuel | Hi! I'm looking into developing some go, but I'm not sure I fully follow how dependencies are managed for go. For other languages I worked with, they are typically passed into buildInputs, which puts them in the development shell, but for go it seems that they need to be managed by go with go mod. Is that accurate? | 18:02:49 |
jrick | for the vast majority of dependencies, yes | 18:13:22 |
jrick | as soon as you start using cgo, those need to be put in the nix inputs | 18:13:59 |
jrick | as the go tooling doesn't know how/where to get those from | 18:14:12 |
samuel | ok, thanks | 18:17:24 |
samuel | Feels a bit strange that I'll be using different files in the shell than to build the final derivation thought. What's the reason not to feed the dependencies to go as part of the build shell (e.g. by modifying GOPATH the same way the go builder does)? | 18:19:39 |
jrick | go already has its own (very good) dependency tooling | 18:22:17 |
jrick | buildGoModule is built to work with that | 18:22:36 |
K900 ⚡️ | In reply to @s_r:matrix.org Feels a bit strange that I'll be using different files in the shell than to build the final derivation thought. What's the reason not to feed the dependencies to go as part of the build shell (e.g. by modifying GOPATH the same way the go builder does)? Go will also explode horribly if you give it a version of an input that is even slightly off | 18:22:52 |
jrick | practically every go project in existence uses go modules | 18:23:06 |
K900 ⚡️ | So the whole point of a central package repository is kind of ruined by that | 18:23:23 |
jrick | and when you create a nix port for some software, you want it to use those same ones | 18:23:25 |
samuel | That is not incompatible with providing them as nix dependencies | 18:23:32 |
samuel | that's how other languages with their own package modules work (haskell, elisp, python, ...) | 18:23:56 |
jrick | the difference is those all suck :) | 18:24:15 |
samuel | that I would not dispute :) | 18:24:43 |
samuel | but I still feel a bit dirty for using packages downloaded in my home directory when running in a nix shell :p | 18:25:24 |
samuel | maybe is possible to get the dependencies with go mod but store them as output of some derivation and use that as buildInput for the actual package that you are building... | 18:26:50 |
jrick | GOMODCACHE will override where modules are downloaded to | 18:27:52 |
jrick | it can also be cleared at any time with go clean -modcache | 18:28:39 |