!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

229 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.50 Servers

Load older messages


SenderMessageTime
8 Jul 2024
@kaya:catnip.eekaya changed their profile picture.00:56:17
@octvs:matrix.orgoctvs joined the room.07:13:12
@octvs:matrix.orgoctvs

Hey everyone,

I'm have little to no knowledge on go and how to build it. Mish-mashing from

other pkg derivations, I wrote the following:

{
  buildGoModule,
  lib,
  fetchFromGitHub,
}:
buildGoModule rec {
  pname = "wsl-notify-send";
  version = "0.1.871612270";

  src = fetchFromGitHub {
    owner = "stuartleeks";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-XbBqbuAp4gmD/OBr8sjCUQS1m2eoiMrTKTrt9Dj/70w=";
  };

  vendorHash = null;

  # GOOS = "linux";

  meta = with lib; {
    description = "WSL replacement for notify-send";
    homepage = "https://github.com/stuartleeks/wsl-notify-send";
    license = with licenses; [mit];
    mainProgram = pname;
  };
}

Which fails with

       last 10 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/1livjb3n3n2hyzafx8qay42msxi45xnl-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > # gopkg.in/toast.v1
       > vendor/gopkg.in/toast.v1/toast.go:352:41: unknown field HideWindow in struct literal of type "syscall".SysProcAttr

First searches I did online pointed towards an OS issue so I've tried setting
GOOS='linux' to be resulted in the same error. I also tried to build the

module which is the dependency, toast explicitly however since it doesn't

have a go.mod file it surpassed the amount of knowledge I have over go.

Anybody has an idea how can I drive forward?

07:13:17
@octvs:matrix.orgoctvs *

Hey everyone,

I'm have little to no knowledge on go and how to build it. Mish-mashing from
other pkg derivations, I wrote the following:

{
  buildGoModule,
  lib,
  fetchFromGitHub,
}:
buildGoModule rec {
  pname = "wsl-notify-send";
  version = "0.1.871612270";

  src = fetchFromGitHub {
    owner = "stuartleeks";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-XbBqbuAp4gmD/OBr8sjCUQS1m2eoiMrTKTrt9Dj/70w=";
  };

  vendorHash = null;

  # GOOS = "linux";

  meta = with lib; {
    description = "WSL replacement for notify-send";
    homepage = "https://github.com/stuartleeks/wsl-notify-send";
    license = with licenses; [mit];
    mainProgram = pname;
  };
}

Which fails with

       last 10 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/1livjb3n3n2hyzafx8qay42msxi45xnl-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > # gopkg.in/toast.v1
       > vendor/gopkg.in/toast.v1/toast.go:352:41: unknown field HideWindow in struct literal of type "syscall".SysProcAttr

First searches I did online pointed towards an OS issue so I've tried setting
GOOS='linux' to be resulted in the same error. I also tried to build the
module which is the dependency, toast explicitly however since it doesn't
have a go.mod file it surpassed the amount of knowledge I have over go.

Anybody has an idea how can I drive forward?

07:14:27
@katexochen:matrix.orgPaul Meyer (katexochen) octvs: From the the Makefile of wsl-notify-send (https://github.com/stuartleeks/wsl-notify-send/blob/main/Makefile#L8) and the readme of toast it looks like this must be build on windows. They also only release binaries for win: https://github.com/stuartleeks/wsl-notify-send/releases/tag/v0.1.871612270 07:35:52
@jrick:zettaport.comjrickfwiw, i tried cross compiling windows cgo executables with nix and ran into some issues. but if you are not using cgo, you can skip all of that hassle and use go's tooling directly to produce executables07:51:24
@octvs:matrix.orgoctvs
In reply to @katexochen:matrix.org
octvs: From the the Makefile of wsl-notify-send (https://github.com/stuartleeks/wsl-notify-send/blob/main/Makefile#L8) and the readme of toast it looks like this must be build on windows. They also only release binaries for win: https://github.com/stuartleeks/wsl-notify-send/releases/tag/v0.1.871612270

Thanks a lot for looking into it. Should have been more careful.

07:57:22
@octvs:matrix.orgoctvs
In reply to @jrick:zettaport.com
fwiw, i tried cross compiling windows cgo executables with nix and ran into some issues. but if you are not using cgo, you can skip all of that hassle and use go's tooling directly to produce executables

Thanks, I will stick by just grabbing exe via fetchzip

07:57:42
9 Jul 2024
@sbc64:matrix.orgsbc64 joined the room.16:48:58
14 Jul 2024
@tsomipa_ts:matrix.orgTsomipa_ts joined the room.18:55:24
15 Jul 2024
@dminca:matrix.orgdminca changed their display name from dminca to nixpkgs.17:28:54
@drupol:matrix.orgPol left the room.17:40:01
@dminca:matrix.orgdminca changed their display name from nixpkgs to dminca.17:42:30
19 Jul 2024
@easel:matrix.orgeasel changed their profile picture.14:17:16
21 Jul 2024
@katexochen:matrix.orgPaul Meyer (katexochen)https://github.com/NixOS/nixpkgs/pull/328876 | buildGoPackage: deprecate17:09:26
@norihiori:matrix.orgAdrien (Iglou.eu) left the room.18:13:05
22 Jul 2024
@gsaurel:laas.frGuilhem joined the room.08:30:16
@gsaurel:laas.frGuilhem

Hello !
I'm trying to build a static website with hugo. A naive buildPhase = "hugo"; shows that it is trying to build some dependencies:

anr-hercules> go: git init --bare in /build/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/bf777e9c93e1a481b3d333886ea1bcc13630093f487c405b49f67fc14a20211b: exec: "git": executable file not found in $PATH
anr-hercules> go: git init --bare in /build/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/bf777e9c93e1a481b3d333886ea1bcc13630093f487c405b49f67fc14a20211b: exec: "git": executable file not found in $PATH
anr-hercules> Total in 5 ms
anr-hercules> Error: failed to load modules: failed to download modules: failed to execute 'go [mod download -modcacherw]': failed to execute binary "go" with args [mod download -modcacherw]: go: git init --bare in /build/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/bf777e9c93e1a481b3d333886ea1bcc13630093f487c405b49f67fc14a20211b: exec: "git": executable file not found in $PATH

Anyone has an example for this use case ? Or could I do something like giving go.mod & go.sum to buildGoModule ?

08:42:55
@katexochen:matrix.orgPaul Meyer (katexochen) Guilhem: might this be helpful to you? https://jnsgr.uk/2024/01/building-a-blog-with-go-nix-hugo/#building-the-blog
See the replacements done in postPatch
08:57:05
@gsaurel:laas.frGuilhemlooks like exactly what I need, thanks !08:57:42
@bashfulrobot.:matrix.orgbashfulrobot joined the room.17:17:00
23 Jul 2024
@kaya:catnip.eekaya changed their profile picture.05:29:54
@ezzobirbezziou:matrix.orgEzzobir Bezziou joined the room.08:20:44
24 Jul 2024
@ftchrist:matrix.orgFrédéric Christ left the room.19:35:47
@kaya:catnip.eekaya changed their profile picture.21:51:35
25 Jul 2024
@bumperboat:matrix.orgbumperboat changed their display name from bumperboat (UTC+2) to bumperboat.12:47:25
26 Jul 2024
@lnlsn:matrix.orglnlsn joined the room.13:49:20
27 Jul 2024
@aetaric:matrix.orgaetaric joined the room.06:57:04
@aetaric:matrix.orgaetaric set a profile picture.07:04:12
@bumperboat:matrix.orgbumperboat left the room.11:58:49

Show newer messages


Back to Room ListRoom Version: 9