Nix + Go | 234 Members | |
| Go packaging for and with Nixpkgs. | Be excellent to each other. | 48 Servers |
| Sender | Message | Time |
|---|---|---|
| 2 May 2024 | ||
| 20:41:06 | ||
| 21:07:39 | ||
| 4 May 2024 | ||
| 06:49:44 | ||
| 20:56:31 | ||
| 7 May 2024 | ||
| 06:50:12 | ||
| 8 May 2024 | ||
| 22:24:36 | ||
| 9 May 2024 | ||
| 05:57:18 | ||
I'm confused about gomuks... the package source includes olm in buildInputs, but it doesn't seem to have encryption support on my machine? Is it just me somehow? | 06:01:38 | |
I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc` installed on my real machine now, there's still no encryption support. | 21:05:28 | |
* I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc\ installed on my real machine now, there's still no encryption support. | 21:05:37 | |
* I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc installed on my real machine now, there's still no encryption support. | 21:05:50 | |
| IDK, this doesn't seem quite right to me. Shouldn't the package check for a C compiler if it needs one, rather than just building a different version? How is stuff like this with CGo usually handled? | 21:07:45 | |
add CGO_ENABLED = 1; to your buildGoModule attrset | 21:12:54 | |
cgo is disabled by default, and any source files that exclude cgo build tags won't be used | 21:14:08 | |
| at least i think it is disabled by default. i set it for the cgo things i build | 21:19:20 | |
| if it's not already in the nixpkgs file and that does indeed fix the issue, then you should file a PR | 22:01:34 | |
| it might be a regression, iirc Go now disables Cgo by default unless it detects CC in the env | 22:01:51 | |
| https://tip.golang.org/doc/go1.20 | 22:02:11 | |
The go command now disables cgo by default on systems without a C toolchain. More specifically, when the CGOENABLED environment variable is unset, the CC environment variable is unset, and the default C compiler (typically clang or gcc) is not found in the path, CGOENABLED defaults to 0. As always, you can override the default by setting CGO_ENABLED explicitly. | 22:02:20 | |
| 10 May 2024 | ||
wait.... It's actually building with encryption support in the VM without adding CGO_ENABLED=1; or gcc or anything. I'm confused, but I guess it's a quirk with my local system after all.Even so, the program does use CGO, and it's not like adding that attribute breaks the build, so should I submit the PR anyway? | 02:44:32 | |
| verify that your VM has the same nixpkgs input first | 02:54:01 | |
| 07:54:38 | ||
| 12:26:08 | ||
| 11 May 2024 | ||
| Hello, bit new here (with nix too). I would like to ask if somebody could clarify for me how do I add a runtimeInput to a go package? I understand that this is not a Go issue as per-say, but rather more flakes/derivation problem. I use gomod2nix with flake. All works good except that I have a cmd line tool that my go program needs to call. I would like my flake to specify this dependency just like | 08:03:58 | |
| * Hello, bit new here (with nix too). I would like to ask if somebody could clarify for me how do I add a runtimeInput to a go package? I understand that this is not a Go issue as per-say, but rather more flakes/derivation problem. I use gomod2nix with flake. All works good except that I have a cmd line tool that my go program needs to call. I would like my flake to specify this dependency just like Edit: the project: https://github.com/brumik/bw-setup-secrets/ | 08:05:22 | |
In reply to @brumik1:matrix.orgyou want to add a hook that calls wrapProgram on your binary to wrap it around a shell script that appends the PATH variable appropriately | 09:52:33 | |
| you may want to try using postInstall maybe | 09:54:14 | |
| Thank you for the answer! PostInstall is part of mkDerivation right? Can I do there | 10:10:31 | |
`nixbuildGoModule { // ... shellHook = } | 23:26:15 | |
| omg | 23:26:17 | |