From fdf9837118199344adbbb3682f1d425e92a36784 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Wed, 19 Jul 2023 09:16:20 -0400 Subject: [PATCH 1/3] lxd: URLs have changed to canonical --- pkgs/tools/admin/lxd/default.nix | 13 +++++-------- pkgs/tools/admin/lxd/ui.nix | 3 +-- pkgs/tools/virtualization/distrobuilder/default.nix | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix index 7d4c10688b80..88a7c7fb6993 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/tools/admin/lxd/default.nix @@ -21,10 +21,7 @@ buildGoModule rec { version = "5.15"; src = fetchurl { - urls = [ - "https://linuxcontainers.org/downloads/lxd/lxd-${version}.tar.gz" - "https://github.com/lxc/lxd/releases/download/lxd-${version}/lxd-${version}.tar.gz" - ]; + url = "https://github.com/canonical/lxd/releases/download/lxd-${version}/lxd-${version}.tar.gz"; hash = "sha256-ez/875yu0XYu5ORf4ak6RN1jWGxuGk0n9023zJkoluM="; }; @@ -52,7 +49,7 @@ buildGoModule rec { tags = [ "libsqlite3" ]; preBuild = '' - # required for go-dqlite. See: https://github.com/lxc/lxd/pull/8939 + # required for go-dqlite. See: https://github.com/canonical/lxd/pull/8939 export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)" ''; @@ -78,14 +75,14 @@ buildGoModule rec { passthru.tests.lxd-ui = nixosTests.lxd-ui; passthru.ui = callPackage ./ui.nix { }; passthru.updateScript = gitUpdater { - url = "https://github.com/lxc/lxd.git"; + url = "https://github.com/canonical/lxd.git"; rev-prefix = "lxd-"; }; meta = with lib; { description = "Daemon based on liblxc offering a REST API to manage containers"; - homepage = "https://linuxcontainers.org/lxd/"; - changelog = "https://github.com/lxc/lxd/releases/tag/lxd-${version}"; + homepage = "https://ubuntu.com/lxd"; + changelog = "https://github.com/canonical/lxd/releases/tag/lxd-${version}"; license = licenses.asl20; maintainers = with maintainers; [ marsam adamcstephens ]; platforms = platforms.linux; diff --git a/pkgs/tools/admin/lxd/ui.nix b/pkgs/tools/admin/lxd/ui.nix index 3ffcb00a9e37..a6d41659a9da 100644 --- a/pkgs/tools/admin/lxd/ui.nix +++ b/pkgs/tools/admin/lxd/ui.nix @@ -33,8 +33,7 @@ mkYarnPackage rec { meta = { description = "Web user interface for LXD."; - homepage = "https://linuxcontainers.org/lxd/"; - changelog = "https://github.com/canonical/lxd-ui"; + homepage = "https://github.com/canonical/lxd-ui"; license = lib.licenses.gpl3; maintainers = with lib.maintainers; [ jnsgruk ]; platforms = lib.platforms.linux; diff --git a/pkgs/tools/virtualization/distrobuilder/default.nix b/pkgs/tools/virtualization/distrobuilder/default.nix index a6ae67b07e7b..ac65ea3f54b9 100644 --- a/pkgs/tools/virtualization/distrobuilder/default.nix +++ b/pkgs/tools/virtualization/distrobuilder/default.nix @@ -38,7 +38,7 @@ buildGoModule rec { patches = [ # go.mod update: needed to to include a newer lxd which contains - # https://github.com/lxc/lxd/commit/d83f061a21f509d42b7a334b97403d2a019a7b52 + # https://github.com/canonical/lxd/commit/d83f061a21f509d42b7a334b97403d2a019a7b52 # which is needed to fix the build w/glibc-2.36. (fetchpatch { url = "https://github.com/lxc/distrobuilder/commit/5346bcc77dd7f141a36a8da851f016d0b929835e.patch"; From e53c0de8dd1cfd156b796bdb726a9c784d5f51cf Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Wed, 19 Jul 2023 09:17:54 -0400 Subject: [PATCH 2/3] lxd: statically compile agent and migration tools --- pkgs/tools/admin/lxd/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix index 88a7c7fb6993..5b06b6e868fc 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/tools/admin/lxd/default.nix @@ -32,7 +32,7 @@ buildGoModule rec { --replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids" ''; - excludedPackages = [ "test" "lxd/db/generate" ]; + excludedPackages = [ "test" "lxd/db/generate" "lxd-agent" "lxd-migrate" ]; nativeBuildInputs = [ installShellFiles pkg-config ]; buildInputs = [ @@ -53,6 +53,11 @@ buildGoModule rec { export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)" ''; + # build static binaries: https://github.com/canonical/lxd/blob/6fd175c45e65cd475d198db69d6528e489733e19/Makefile#L43-L51 + postBuild = '' + make lxd-agent lxd-migrate + ''; + preCheck = let skippedTests = [ "TestValidateConfig" From 4635b36ac86237fc2ea4cf8e063aba82ef067ae3 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Fri, 21 Jul 2023 11:00:36 -0400 Subject: [PATCH 3/3] lxd: 5.15 -> 5.16 --- pkgs/tools/admin/lxd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix index 5b06b6e868fc..02bf8cbd4e6c 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/tools/admin/lxd/default.nix @@ -18,11 +18,11 @@ buildGoModule rec { pname = "lxd-unwrapped"; - version = "5.15"; + version = "5.16"; src = fetchurl { url = "https://github.com/canonical/lxd/releases/download/lxd-${version}/lxd-${version}.tar.gz"; - hash = "sha256-ez/875yu0XYu5ORf4ak6RN1jWGxuGk0n9023zJkoluM="; + hash = "sha256-evtNPZvnx8rzr/tJkEp0E7BhUBWHBSJdMtZJQk3VZI8="; }; vendorHash = null;