budimanjojo / talhelper

A tool to help creating Talos kubernetes cluster
https://budimanjojo.github.io/talhelper
BSD 3-Clause "New" or "Revised" License
308 stars 19 forks source link

Flake fails to build after release of 3.0.7 #648

Closed abb-corpay closed 1 month ago

abb-corpay commented 1 month ago

Thank you for a great tool.

After the release of 3.0.7, this error occurs when trying to install via the flake:

warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/ax5di1cill14lmvbaksdldhvxbp7l8y7-go-task-3.39.2-go-modules.drv^*'
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/w611p6wgzs5x0zvs68w6yzxzlv6kkdnq-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch /nix/store/y5jgbbdi3jwpaidyq3yf9cn8spf0507q-fix-ldflags-version.patch
patching file internal/version/version.go
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file internal/version/version.go.rej
budimanjojo commented 1 month ago

Thanks for the report!

May I know how are you building it? Are you using the nixpkgs provided by the flake? I can't reproduce it on my machine:

 nix build . --no-link

returns no error.

abb-corpay commented 1 month ago

Of cause!

I am using it for a devShell:


{
  inputs = {
    # NixPkgs (nixos-unstable)
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    # Flake-utils
    flake-utils.url = "github:numtide/flake-utils";

    # talhelper
    talhelper.url = "github:budimanjojo/talhelper";
  };

  outputs = {self, ...} @ inputs:
    inputs.flake-utils.lib.eachDefaultSystem (
      system: let
        pkgs = inputs.nixpkgs.legacyPackages.${system};
      in {
        devShells.default = pkgs.mkShell {
          packages = [
            pkgs.age
            pkgs.bashInteractive
            pkgs.cilium-cli
            pkgs.coreutils
            pkgs.curl
            pkgs.fluxcd
            pkgs.gawk
            pkgs.gnugrep
            pkgs.go-task
            pkgs.incus
            pkgs.kubectl
            pkgs.kustomize
            pkgs.sops
            inputs.talhelper.packages.x86_64-linux.default
            pkgs.talosctl
            pkgs.yq-go
          ];
        };
      }
    );
}```
budimanjojo commented 1 month ago

Weird, I just updated nixpkgs to the latest version locally and it builds fine too. Have you tried doing nix flake update?

budimanjojo commented 1 month ago

Also, I don't know anything about the ldflag-patch like in your output above and I don't think I put any patch for the derivation.

abb-corpay commented 1 month ago

Yeah, I did that:

❯ nix flake update
❯ nix build .#devShells.x86_64-linux.default 
error: builder for '/nix/store/ax5di1cill14lmvbaksdldhvxbp7l8y7-go-task-3.39.2-go-modules.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/w611p6wgzs5x0zvs68w6yzxzlv6kkdnq-source
       > source root is source
       > Running phase: patchPhase
       > applying patch /nix/store/y5jgbbdi3jwpaidyq3yf9cn8spf0507q-fix-ldflags-version.patch
       > patching file internal/version/version.go
       > Reversed (or previously applied) patch detected!  Assume -R? [n]
       > Apply anyway? [n]
       > Skipping patch.
       > 1 out of 1 hunk ignored -- saving rejects to file internal/version/version.go.rej
       For full logs, run 'nix log /nix/store/ax5di1cill14lmvbaksdldhvxbp7l8y7-go-task-3.39.2-go-modules.drv'.
error: 1 dependencies of derivation '/nix/store/ldgk6wl4m0nrp5648va3kvrn2w5a17j5-go-task-3.39.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/a6xdxqn0xmgrdx246h3mxp1s6gfs3mjk-nix-shell.drv' failed to build
abb-corpay commented 1 month ago

Could this be something to do with version of Nix?

❯ nix --version
nix (Nix) 2.24.7
budimanjojo commented 1 month ago

I just tried the flake.nix you provided above. Seems like the error comes from go-task package.

abb-corpay commented 1 month ago

:facepalm: You are totally correct. This does not appear to have anything to do with talhelper. I was so focused on getting the new version of talhelper, that I did not read the output thoroughly. Sorry for the disturbance.