| 30 Aug 2023 |
Moritz | - system:
"x86_64-linux"
- host os:
Linux 6.4.11, NixOS, 23.11 (Tapir), 23.11.20230823.9201b5f - multi-user?:
no - sandbox:
yes - version:
nix-env (Nix Super) 2.18.0pre20230813_65e8aba - channels(root):
"" - channels(moritz):
"" - nixpkgs:
not found
| 09:29:15 |
Moritz | * - system:
"x86_64-linux" - host os:
Linux 6.4.11, NixOS, 23.11 (Tapir), 23.11.20230823.9201b5f - multi-user?:
no - sandbox:
yes - version:
nix-env (Nix Super) 2.18.0pre20230813_65e8aba - channels(root):
"" - channels(moritz):
"" - nixpkgs:
not found | 09:29:41 |
Moritz | I guess I really just need to setup my channels to follow the flake input. | 09:30:13 |
j-k | hmm ok so I thought it might be sandboxing disabled but it's on. I'm not sure how you managed to turn off multi-user on nixos ... š nix 2.18 probably didn't break anything.
is this file in a clone of nixpkgs? how are you running nix-build?
| 09:31:08 |
Moritz | I'm running:
nix-build -E '(import <nixpkgs> {}).callPackage ./default.nix {}' | 09:32:05 |
j-k | yeah so that's pulling nixpkgs from your channels which will be super old | 09:32:31 |
j-k | <nixpkgs> is channels syntax | 09:32:51 |
Moritz | Ahhh, that makes perfect sense then... | 09:33:24 |
Moritz | Thanks for your help. Now with the nixpkgs it builds flawlessly :) | 09:48:25 |
j-k | glad to hear | 11:23:13 |
| 5 Sep 2023 |
| zoopli joined the room. | 17:28:41 |
| 9 Sep 2023 |
| Moritz Sanft joined the room. | 12:15:00 |
| 10 Sep 2023 |
| farcaller joined the room. | 12:35:56 |
farcaller |  Download image.png | 12:39:52 |
farcaller | wrote a tiny idiomatic API wrapper around C bindings to nix:
```
$ go run examples/build_hello/main.go
drv /nix/store/nms6chyaxb6pxzb021jx351nn32j3lx7-hello-2.12.1.drv vaild? true
out -> /nix/store/6wmplzfs0nz866p320xnknpr05q79m62-hello-2.12.1
``` | 12:39:52 |
farcaller | * wrote a tiny idiomatic API wrapper around C bindings to nix: \$ go run examples/build\_hello/main.go
drv /nix/store/nms6chyaxb6pxzb021jx351nn32j3lx7-hello-2.12.1.drv vaild? true
out -> /nix/store/6wmplzfs0nz866p320xnknpr05q79m62-hello-2.12.1 | 12:40:07 |
farcaller | * wrote a tiny idiomatic API wrapper around C bindings to nix: $ go run examples/build_hello/main.go
drv /nix/store/nms6chyaxb6pxzb021jx351nn32j3lx7-hello-2.12.1.drv vaild? true
out -> /nix/store/6wmplzfs0nz866p320xnknpr05q79m62-hello-2.12.1 | 12:40:29 |
@qbit:tapenet.org | farcaller: nice!! | 12:51:04 |
@qbit:tapenet.org | link? | 12:51:31 |
farcaller | In reply to @qbit:tapenet.org link? https://github.com/farcaller/gonix. Iām hacking this as I go, but evals and builds seem to work as intended. | 12:57:54 |
@qbit:tapenet.org | rad :D | 13:01:05 |
| 11 Sep 2023 |
Moritz Sanft | Hey, I'm currently trying to build a static binary of a Go module which uses CGO. However, the local header file I'm trying to include in my main.go is not being picked up. I struggle to find the definition of buildGoModule to see what happens exactly. In my understanding, the header file should be included since src = ./.
| 18:31:14 |
Moritz Sanft | The corresponding output for reference:
packages.x86_64-linux.default = pkgs.buildGoModule rec { # pkgs.pkgsCross.riscv64.buildGoModule rec {
pname = "keystone-go-enclaves";
version = "0.0.0";
src = ./.;
vendorHash = null;
nativeBuildInputs = [ musl ];
CGO_ENABLED = 1;
ldflags = [
"-s -w"
"-linkmode external"
"-extldflags '-static -L${musl}/lib'"
];
};
| 18:31:38 |
countoren | Hi Moritz Sanft , I guess it is not directly answer your question but I had to play with go packages myself I had to cross compile a server to arm I was thinking to go the static compilation route, but I ended up with dynamicly linked + deliverable with NAR files to the system. I dont know if it is much help but it might give you a lead. | 21:07:34 |
| 12 Sep 2023 |
@atalii:matrix.org | In reply to @msanft:matrix.org Hey, I'm currently trying to build a static binary of a Go module which uses CGO. However, the local header file I'm trying to include in my main.go is not being picked up. I struggle to find the definition of buildGoModule to see what happens exactly. In my understanding, the header file should be included since src = ./.
i'm not too experienced with CGO/nix/etc, but i'll take a stab in the dark - if ./. is a git repository, nix will ignore any file that isn't indexed; you can git add -N $your_header_file if that is the issue | 01:14:01 |
Moritz Sanft | Hey oren :) Thanks for your reply! Actually, I think I inevitably need a static binary. I don't know if it will even work out in the end, but I'm trying to compile a CGo-using Go app for an embedded RISCV device which requires static binaries from my x86 builder device. Quite unusual I guess :D | 05:31:01 |
Moritz Sanft | God, yes. I didn't notice I had not checked in this file. Thank you so much! | 05:32:20 |
| chrispickard removed their display name chrispickard. | 17:38:32 |
| 13 Sep 2023 |
| jsla joined the room. | 07:35:55 |
| 15 Sep 2023 |
| Michal Fikejs joined the room. | 00:07:20 |