!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

153 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.41 Servers

Load older messages


SenderMessageTime
27 Sep 2024
@phanirithvij:matrix.orgloudgolem changed their display name from phanirithvij to loudgolem.14:38:15
@phanirithvij:matrix.orgloudgolem changed their profile picture.14:38:38
@k900:0upti.meK900Is this the easiest way to use Go 1.23 for a package? https://github.com/NixOS/nixpkgs/pull/34493419:21:07
@k900:0upti.meK900Or am I holding something wrong19:21:10
@sandro:supersandro.deSandro 🐧that's the easiest and most correct way22:35:24
@sandro:supersandro.deSandro 🐧and for ktailctl we do some manual things because of the go build inside cmake and I did the exact same patch 22:35:44
28 Sep 2024
@genga898:matrix.orgEmmanuel GengaHey guys, I'm curious as to how you'd approach building an electron app with go dependencies and an already defined taskfile for binary generation.10:13:08
@genga898:matrix.orgEmmanuel Genga* Hey guys, I'm curious as to how you'd approach building an electron app with go dependencies and an already defined taskfile for binary generation ?It's my first foray into nix and nixpkgs so I'm still learning.10:29:25
@kaya:catnip.eekaya changed their profile picture.16:54:19
@sandro:supersandro.deSandro 🐧at least you need to fetch the go deps separately if there is not vendoring17:41:06
@sandro:supersandro.deSandro 🐧maybe try looking at ktailctl that does that17:41:17
@libregeekingkid:matrix.orgrajudev joined the room.22:13:33
30 Sep 2024
@frederic:scs.ems.hostFrédéric Christ changed their display name from Frédéric Christ 🌴 16.09. - 30.09. to Frédéric Christ.08:49:42
1 Oct 2024
@-_o:matrix.org-_o joined the room.21:03:26
2 Oct 2024
@k900:0upti.meK900Question10:03:29
@k900:0upti.meK900GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap10:03:30
@k900:0upti.meK9001) what the fuck10:03:33
@k900:0upti.meK9002) is this Go 1.23 again10:03:47
@k900:0upti.meK900https://github.com/grafana/agent/issues/697210:04:10
@k900:0upti.meK900YEUP10:04:11
3 Oct 2024
@midirhee12:tchncs.demidirhee12 joined the room.14:38:10
4 Oct 2024
@katexochen:matrix.orgPaul Meyer (katexochen)https://github.com/NixOS/nixpkgs/issues/34638010:14:14
@bashfulrobot.:matrix.orgbashfulrobot changed their profile picture.16:24:15
6 Oct 2024
@galaxyyy:matrix.orgSaturn joined the room.03:59:58
@galaxyyy:matrix.orgSaturn

Hello, I am trying to package a Go application however I ran into an error I've never seen before and can't seem to find anything online

        github.com/hrfee/jfa-go/docs: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/common: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/ombi: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/logger: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/linecache: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/api: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/hrfee/jfa-go/easyproxy: is replaced in go.mod, but not marked as replaced in vendor/modules.txt

        To ignore the vendor directory, use -mod=readonly or -mod=mod.
        To sync the vendor directory, run:
                go mod vendor

That is the error I am getting and here is my current derivation

{
  lib,
  buildGoModule,
  fetchFromGitHub,
  pkg-config,
  libayatana-appindicator,
  go-swag,
}:
buildGoModule rec {
  pname = "jfa-go";
  version = "0.5.1";

  src = fetchFromGitHub {
    owner = "hrfee";
    repo = "jfa-go";
    rev = "v${version}";
    hash = "sha256-7F0cPTG3LuZQk5AT5V5UwW9+dX25aGS8RDYi62CGDR8=";
  };
  vendorHash = "sha256-JC9d/FDG6hadkX1ywJ120BAsVkg/xMt9sUkh/DHModI=";

  nativeBuildInputs = [
    pkg-config
    go-swag
  ];

  buildInputs = [
    libayatana-appindicator
  ];

  preBuild = ''
    swag init -g main.go -d ${src}/
  '';

  ldflags = [
    "-X=main.version=v${version}"
    "-X=main.commit=${src.rev}"
    "-X=main.updater=binary"
    "-X=main.cssVersion=v3"
    "-X=main.builtBy=Nix"
  ];

  meta = {
    description = "A bit-of-everything user managament app for Jellyfin";
    homepage = "https://github.com/hrfee/jfa-go/tree/main";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [saturn745];
    mainProgram = "jfa-go";
  };
}

Does anybody have any ideas?

04:03:34
@katexochen:matrix.orgPaul Meyer (katexochen)

Saturn: The error your quoting doesn't seem to be the fatal one. Rather the build of internal.go seems to fail:

jfa-go> Building subPackage .
jfa-go> internal.go:13:12: pattern data: no matching files found

internal.go has a build tag !external, so it seems like this shouldn't be build by nix.

Also check the Makefile, where they control this build tag: https://github.com/hrfee/jfa-go/blob/main/Makefile#L35-L42

So add tags = [ "external" ];

Next error you will face is

jfa-go> Building subPackage .
jfa-go> Building subPackage ./common
jfa-go> main module (github.com/hrfee/jfa-go) does not contain package github.com/hrfee/jfa-go/common

As this is a multi-module repository ./common cannot be build, you can use subPackages so that only the top level package is build:

subPackages = [ "." ];

11:08:43
@katexochen:matrix.orgPaul Meyer (katexochen) *

Saturn: The error your quoting doesn't seem to be the fatal one. Rather the build of internal.go seems to fail:

jfa-go> Building subPackage .
jfa-go> internal.go:13:12: pattern data: no matching files found

internal.go has a build tag !external, so it seems like this shouldn't be build by nix.

Also check the Makefile, where they control this build tag: https://github.com/hrfee/jfa-go/blob/main/Makefile#L35-L42

So add tags = [ "external" ];

Next error you will face is

jfa-go> Building subPackage .
jfa-go> Building subPackage ./common
jfa-go> main module (github.com/hrfee/jfa-go) does not contain package github.com/hrfee/jfa-go/common

As this is a multi-module repository ./common cannot be build, you can use subPackages so that only the top level package is build:

subPackages = [ "." ];

Then it builds for me successfully. :)

11:09:21
@galaxyyy:matrix.orgSaturn
In reply to @katexochen:matrix.org

Saturn: The error your quoting doesn't seem to be the fatal one. Rather the build of internal.go seems to fail:

jfa-go> Building subPackage .
jfa-go> internal.go:13:12: pattern data: no matching files found

internal.go has a build tag !external, so it seems like this shouldn't be build by nix.

Also check the Makefile, where they control this build tag: https://github.com/hrfee/jfa-go/blob/main/Makefile#L35-L42

So add tags = [ "external" ];

Next error you will face is

jfa-go> Building subPackage .
jfa-go> Building subPackage ./common
jfa-go> main module (github.com/hrfee/jfa-go) does not contain package github.com/hrfee/jfa-go/common

As this is a multi-module repository ./common cannot be build, you can use subPackages so that only the top level package is build:

subPackages = [ "." ];

Then it builds for me successfully. :)

I see :) I greatly appreciate your help
15:06:41
@galaxyyy:matrix.orgSaturnAwesome yep it built. So this package also needs to generate some UI stuff via NodeJS it seems. What would be the best way to go about that? Just adding node into the build inputs and running the commands in a hook or is there a better way?15:55:08
@diamondburned:matrix.orgDiamond (it/she)i'd at least split the nodejs stuff out into a separate derivation then link/copy them in16:03:17

Show newer messages


Back to Room ListRoom Version: 9