Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildGoModule: find build/test targets with go list #284568

Draft
wants to merge 9 commits into
base: staging
Choose a base branch
from
Prev Previous commit
Next Next commit
treewide: replace excludedPackages with subPackages in Go packages
Most packages should specify subPackages instead of excludedPackages,
as it makes the build more precise and is clearer in general.
  • Loading branch information
katexochen committed Feb 11, 2024
commit 5cff19e2b1ebbe0ef83067b29a36c9611a5dd870
5 changes: 1 addition & 4 deletions pkgs/applications/networking/cluster/ktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
buildGoModule rec {
pname = "ktop";
version = "0.3.5";
excludedPackages = [".ci"];

src = fetchFromGitHub {
owner = "vladimirvivien";
Expand All @@ -15,9 +14,7 @@ buildGoModule rec {
vendorHash = "sha256-IiAMmHOq69WMT2B1q9ZV2fGDnLr7AbRm1P7ACSde2FE=";
ldflags = [ "-s" "-w" "-X github.com/vladimirvivien/ktop/buildinfo.Version=v${version}" ];

postInstall = ''
rm $out/bin/hack
'';
subPackages = [ "." ];

doCheck = false;

Expand Down
9 changes: 7 additions & 2 deletions pkgs/applications/networking/cluster/velero/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ buildGoModule rec {
};

ldflags = [
"-s" "-w"
"-s"
"-w"
"-X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v${version}"
"-X github.com/vmware-tanzu/velero/pkg/buildinfo.ImageRegistry=velero"
"-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean"
Expand All @@ -22,7 +23,11 @@ buildGoModule rec {

vendorHash = "sha256-Fu4T2VEW5s/KCdgJLk3bf0wIUhKULK6QuNEmL99MUCI=";

excludedPackages = [ "issue-template-gen" "release-tools" "v1" "velero-restic-restore-helper" ];
subPackages = [
"cmd/velero"
"cmd/velero-helper"
"cmd/velero-restore-helper"
];

doCheck = false; # Tests expect a running cluster see https://github.com/vmware-tanzu/velero/tree/main/test/e2e
doInstallCheck = true;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/version-management/git-bug/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildGoModule rec {

doCheck = false;

excludedPackages = [ "doc" "misc" ];
subPackages = [ "." ];

ldflags = [
"-X github.com/MichaelMure/git-bug/commands.GitCommit=v${version}"
Expand Down