From 990bd301c178d864288e9655a31572837982e3cf Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Wed, 22 Jun 2022 14:50:17 +1000 Subject: [PATCH] talosctl: 1.0.6 -> 1.1.0 https://github.com/siderolabs/talos/releases/tag/v1.1.0 > https://github.com/siderolabs/talos/commit/b315ed95327a9b7cfb1f83a9da02e96bafecbb1d > Generate separate file for each variable and assign them during go build using go:embed instead of using ldflags -X. --- .../networking/cluster/talosctl/default.nix | 42 ++++++------------- pkgs/top-level/all-packages.nix | 4 +- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/pkgs/applications/networking/cluster/talosctl/default.nix b/pkgs/applications/networking/cluster/talosctl/default.nix index da240b337bfc..42d451bd44db 100644 --- a/pkgs/applications/networking/cluster/talosctl/default.nix +++ b/pkgs/applications/networking/cluster/talosctl/default.nix @@ -1,42 +1,21 @@ -{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: -let - # look for GO_LDFLAGS getting set in the Makefile - version = "1.0.6"; - sha256 = "sha256-4cUaQWqVndp06eFgqInOMMGITbTdZO5BOqXW2XEpuWU="; - vendorSha256 = "sha256-7q35d+jbIDe7fAy6nL5FWdSovBb/f64HYLHGL+zE6bI="; - pkgsVersion = "v1.0.0-25-gcf9709e"; - extrasVersion = "v1.0.0-4-g05b0920"; -in +{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }: + buildGoModule rec { pname = "talosctl"; - inherit version vendorSha256; - # nixpkgs-update: no auto update + version = "1.1.0"; src = fetchFromGitHub { owner = "siderolabs"; repo = "talos"; rev = "v${version}"; - inherit sha256; + sha256 = "sha256-52WzQ5LWgIX/XBJPNvWV0tAPnw1AiINDL/7D3UYvvn4="; }; - ldflags = - let - versionPkg = "github.com/talos-systems/talos/pkg/version"; # VERSION_PKG - imagesPkgs = "github.com/talos-systems/talos/pkg/images"; # IMAGES_PKGS - mgmtHelpersPkg = "github.com/talos-systems/talos/cmd/talosctl/pkg/mgmt/helpers"; #MGMT_HELPERS_PKG - in - [ - "-X ${versionPkg}.Name=Client" - "-X ${versionPkg}.SHA=${src.rev}" # should be the hash, but as we build from tags, this needs to do - "-X ${versionPkg}.Tag=${src.rev}" - "-X ${versionPkg}.PkgsVersion=${pkgsVersion}" # PKGS - "-X ${versionPkg}.ExtrasVersion=${extrasVersion}" # EXTRAS - "-X ${imagesPkgs}.Username=siderolabs" # USERNAME - "-X ${imagesPkgs}.Registry=ghcr.io" # REGISTRY - "-X ${mgmtHelpersPkg}.ArtifactsPath=_out" # ARTIFACTS - "-s" - "-w" - ]; + vendorSha256 = "sha256-iluI4UGw5cZ70wmC9jDiGttvxZ7xFyqcL9IZX4ubJqs="; + + ldflags = [ "-s" "-w" ]; + + GOWORK = "off"; subPackages = [ "cmd/talosctl" ]; @@ -56,5 +35,8 @@ buildGoModule rec { homepage = "https://www.talos.dev/"; license = licenses.mpl20; maintainers = with maintainers; [ flokli ]; + # requires >= 10.14 SDK https://github.com/NixOS/nixpkgs/issues/101229 + # Undefined symbols for architecture x86_64: "_SecTrustEvaluateWithError" + broken = stdenv.isDarwin && stdenv.isx86_64; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 238e2537d2bf..55ba07c1b7c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30046,7 +30046,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; - talosctl = callPackage ../applications/networking/cluster/talosctl { }; + talosctl = callPackage ../applications/networking/cluster/talosctl { + buildGoModule = buildGo118Module; + }; talentedhack = callPackage ../applications/audio/talentedhack { };