| 23 Jul 2023 |
Artturin | tinygo.goModules
error: illegal path references in fixed-output derivation '/nix/store/06v7rn03bgsnzvv89dn8i2a6kap1fijl-tinygo-0.26.0-goModules.drv'
| 16:28:47 |
Artturin | These modules built correctly on older go versions but not on newer go versions | 16:29:11 |
Artturin | How can vendoring break version to version, Go damn | 16:29:49 |
Artturin | * How can vendoring break in multiple ways version to version, Go damn | 16:30:43 |
@qbit:tapenet.org | Is there a rewrite in the go.mod? | 17:17:55 |
| @atalii:matrix.org joined the room. | 17:58:44 |
@atalii:matrix.org | is it okay if i ask a quick question about buildGoModule here? i'm reading through the sourcue to get an idea of how to handle deps for a different language and build system, and it seems that the buildPhase of buildGoModule calls go mod vendor or go mod package. that seems to require the network, but it also seems to work in the sandbox. would anyone be able to tell me what i'm missing here? thanks :) | 18:00:56 |
@qbit:tapenet.org | the vendor stuff gets put in to its own derivation which gets linked in at build | 18:26:51 |
@qbit:tapenet.org | also go will print out "downloading..." even though it's using the vendor'd stuff | 18:27:05 |
@qbit:tapenet.org | https://github.com/qowoz/nixpkgs/blob/master/pkgs/build-support/go/module.nix#L55 | 18:27:06 |
@atalii:matrix.org | Okay - I think I'm misunderstanding quite a bit, then. where does the builder fetch the sources to vendor? | 18:30:40 |
@qbit:tapenet.org | it's part of the main derivation, if you set vendorHash = ""; it will rebuild the ${name}-go-modules stuff | 18:33:29 |
@qbit:tapenet.org | are you getting an error ? | 18:33:43 |
@atalii:matrix.org | no; just trying to understand the build process so i can do something like it for a different language. my understanding is that first go-modules is built, which runs go mod vendor or go mod download, and that output is then linked into the main derivation? | 18:35:21 |
@atalii:matrix.org | ^oh, and, if this is correct... how is that possible? go mod vendor downloads the sources for deps (right?), which shouldn't be able to happen in the sandbox? | 18:41:26 |
@qbit:tapenet.org | i am not sure on the download side of things | 21:48:06 |
Artturin | In reply to @atalii:matrix.org ^oh, and, if this is correct... how is that possible? go mod vendor downloads the sources for deps (right?), which shouldn't be able to happen in the sandbox? It uses a fixed output derivation which can access network | 22:26:57 |
Artturin | In reply to @atalii:matrix.org ^oh, and, if this is correct... how is that possible? go mod vendor downloads the sources for deps (right?), which shouldn't be able to happen in the sandbox? * go-modules uses a fixed output derivation which can access network | 22:27:25 |
Artturin | * go-modules is a fixed output derivation which can access network | 22:27:30 |
@qbit:tapenet.org | ah, so FOD works because we know what the hash will be? | 22:40:28 |
@qbit:tapenet.org | so network access is .. ok-ish | 22:40:40 |
@qbit:tapenet.org | ? | 22:40:59 |
@qbit:tapenet.org | what denotes that it's FOD? | 22:44:02 |
@qbit:tapenet.org | or.. i guess.. how would one know it was FOD? | 22:44:53 |
@atalii:matrix.org | In reply to @artturin:matrix.org go-modules is a fixed output derivation which can access network ah, thank you - same question as qbit, how does nix 'know' its fixed? | 22:45:51 |
Artturin | https://nixos.org/manual/nix/stable/language/advanced-attributes.html?highlight=fixed-output-#adv-attr-outputHash | 22:47:12 |
Artturin | https://github.com/NixOS/nixpkgs/blob/9ca0bd9db35fee3473dec48dbb163de7100e0455/pkgs/build-support/go/module.nix#L142-L144 | 22:47:55 |
Artturin | tali: qbit | 22:47:58 |
Artturin | * go-modules is a fixed-output derivation which can access network | 22:48:31 |
@atalii:matrix.org | ah, look at that - thanks so much! | 22:49:23 |