!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

203 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.46 Servers

Load older messages


SenderMessageTime
11 Jan 2024
@fractivore:cyberia.clubsymys

Okay so I updated my shell.nix to:

  1 let↵                                                                            
  2 ··lib·=·import·<nixpkgs>·{};↵                                                   
  3 in↵                                                                             
  4 ↵                                                                               
  5 lib.buildGoModule·rec·{↵                                                        
  6 ··pname·=·"signASLbot";↵                                                        
  7 ··version·=·"";↵                                                                
  8 ↵                                                                               
  9 ··src·=·lib.fetchFromGitHub·{↵                                                  
 10 ····url·=·"https://github.com/mplsbugbounty/signASLBot/archive/refs/heads/main.zip";↵
 11 ····owner·=·"mplsbugbounty";↵                                                   
 12 ····repo·=·pname;↵                                                              
 13 ····rev·=·"794245ee556b3ce80991872b5a59e9a810250c7d";↵                          
 14 ····sha256·=·"0s5qqmzp793012ynxyrlibi6g4xacvgs59z56dfh4ll4z2gv41md";↵           
 15 ··};↵                                                                           
 16 ↵                                                                               
 17 ··vendorHash·=·"sha256-9OY34TlxbvqNfGbDqQyovk+HWCCIUZOorbrH/5rhO3M";↵           
 18 ↵                                                                               
 19 ··meta·=·with·lib;·{↵                                                           
 20 ····description·=·"";↵                                                          
 21 ····longDescription·=·''↵                                                       
 22 →       It's·a·pretty·basic·little·bot·really!↵                                 
 23 ····'';↵                                                                        
 24 ····homepage·=·"https://github.com/mplsbugbounty/signASLBot";↵                  
 25 ····license·=·"";↵                                                              
 26 ····maintainers·=·with·maintainers;·[·symys·];↵                                 
 27 ··};↵                                                                           
 28 }↵    

I get:

error: builder for '/nix/store/45ql7689gpqdqj2ylwhzhgi9khi5l7ly-signASLbot-.drv' failed with exit code 1;                                                     
...
       > Running phase: buildPhase                                                                                                                            
       > Building subPackage .                                                                                                                                
       > main.go:26:5: package signaslbot/errUtils is not in std (/nix/store/6qd8p8gilzgplpk2ni3109m0k71r21s7-go-1.21.5/share/go/src/signaslbot/errUtils)     
       For full logs, run 'nix-store -l /nix/store/45ql7689gpqdqj2ylwhzhgi9khi5l7ly-signASLbot-.drv'. 
05:42:06
@fractivore:cyberia.clubsymyssignaslbot/errUtils is a custom package in the same repo05:43:08
@fractivore:cyberia.clubsymys * signaslbot/errUtils is a custom package in the same repo. How can I make it available to the nix store before it gets to this build step?05:45:16
@qbit:tapenet.org@qbit:tapenet.orgif you want it to be a shell you need to use mkShell, no? 13:31:30
@qbit:tapenet.org@qbit:tapenet.orghttps://github.com/mplsbugbounty/signASLBot/blob/main/go.mod#L1 ah, i see you have a second go.mod in the errUtils dir13:32:54
@qbit:tapenet.org@qbit:tapenet.orgthat can't be ref'd as "signaslbot/errUtils" 13:33:17
@qbit:tapenet.org@qbit:tapenet.orgin go13:33:19
@qbit:tapenet.org@qbit:tapenet.orgbecause your "sub" module is literally called "errUtils" 13:33:43
@qbit:tapenet.org@qbit:tapenet.orgremote the errUtils/go.* files and things might work13:34:18
@qbit:tapenet.org@qbit:tapenet.orghttps://go.dev/ref/mod#modules-overview13:35:14
@qbit:tapenet.org@qbit:tapenet.orgyour errUtils is a package in the signaslbot module13:35:50
@qbit:tapenet.org@qbit:tapenet.org

Each package within a module is a collection of source files in the same directory that are compiled together. A package path is the module path joined with the subdirectory containing the package (relative to the module root). For example, the module "golang.org/x/net" contains a package in the directory "html". That package’s path is "golang.org/x/net/html".

13:35:51
@qbit:tapenet.org@qbit:tapenet.orgdoing sub-modules is .. tricky and probably not what you want for a project of this size13:43:21
@fractivore:cyberia.clubsymys
In reply to @qbit:tapenet.org
doing sub-modules is .. tricky and probably not what you want for a project of this size
Yeah I really just did that because I wanted to get more experience structuring projects this way
16:03:46
@qbit:tapenet.org@qbit:tapenet.orgi think to do sub-modules you need to use the "full" path of the module16:05:34
@qbit:tapenet.org@qbit:tapenet.org so github.com/mplsbugbounty/signaslbot 16:06:25
@qbit:tapenet.org@qbit:tapenet.org instead of signaslbot 16:06:36
@fractivore:cyberia.clubsymysI've been thinking a lot lately that a good way to structure programs is to write a library and then implement the app using that library. And errUtils contains some code that I've just been copying around between my go programs so it seemed a good first candidate.16:07:23
@fractivore:cyberia.clubsymys
In reply to @qbit:tapenet.org
so github.com/mplsbugbounty/signaslbot
Okay thanks, I'll give that a shot!
16:07:45
@fractivore:cyberia.clubsymys
In reply to @qbit:tapenet.org
remote the errUtils/go.* files and things might work
I'm having some issues still after trying renaming the submodule paths in a few different ways. When you say remote the errUtils.go.* files, you mean like just make a new repo for them? I guess that would make more sense anyway.
19:30:23
@qbit:tapenet.org@qbit:tapenet.orgno, I was suggesting making them just a package, not a full blown submodule19:31:03
@qbit:tapenet.org@qbit:tapenet.org so you'd remove the go.* files and then ref github.com/mplsbugbounty/signaslbot/errUtils 19:31:41
@qbit:tapenet.org@qbit:tapenet.org where errUtils is the package name in the errUtils dir 19:31:53
13 Jan 2024
@fractivore:cyberia.clubsymysI decided to just refactor it to avoid the custom import which wasn't really necessary. Now I'm having another problem with the build:00:47:48
@fractivore:cyberia.clubsymys *

I decided to just refactor it to avoid the custom import which wasn't really necessary. Now I'm having another problem with the build:

error: builder for '/nix/store/zf22x2ygw6ldag7b7dxi8r4gd7vgbd3q-signASLbot-.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > # maunium.net/go/mautrix/crypto/olm
       > vendor/maunium.net/go/mautrix/crypto/olm/account.go:4:11: fatal error: olm/olm.h: No such file or directory
       >     4 | // #include <olm/olm.h>
       >       |           ^~~~~~~~~~~
00:48:04
@fractivore:cyberia.clubsymys

I tried to make libolm available to my environment by installing it in my configuration, e.g.:

  environment.systemPackages = [
    pkgs.olm
  ];

Might not be the right package, or might not be what I need to do to make olm.h available . Does anybody know what to do here?

00:49:55
@qbit:tapenet.org@qbit:tapenet.orgyou might need pkg-config 00:58:06
@qbit:tapenet.org@qbit:tapenet.orgbut also you probably want olm in your derivation that builds signaslbot00:58:21
@qbit:tapenet.org@qbit:tapenet.orghere's an example that uses some x11 stuff: https://github.com/qbit/traygent/blob/main/flake.nix#L2801:02:02
@qbit:tapenet.org@qbit:tapenet.orgall your deps go in buildInputs01:02:14

There are no newer messages yet.


Back to Room ListRoom Version: 9