Merge pull request #299340 from adamcstephens/incus/0.7

incus: 0.6 -> 0.7
This commit is contained in:
Adam C. Stephens 2024-03-27 07:29:00 -04:00 committed by GitHub
commit 0ca930ad59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 50 deletions

View File

@ -263,6 +263,7 @@ in
{
INCUS_LXC_TEMPLATE_CONFIG = "${pkgs.lxcfs}/share/lxc/config";
INCUS_OVMF_PATH = ovmf;
INCUS_USBIDS_PATH = "${pkgs.hwdata}/share/hwdata/usb.ids";
PATH = lib.mkForce serverBinPath;
}
(lib.mkIf (cfg.ui.enable) { "INCUS_UI" = cfg.ui.package; })

View File

@ -1,29 +0,0 @@
From 32a4beecbf8098fdbb15ef5f36088956922630f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
Date: Fri, 23 Feb 2024 18:47:15 -0500
Subject: [PATCH] incusd/device/disk: Fix incorrect block volume usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
---
internal/server/device/disk.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/internal/server/device/disk.go b/internal/server/device/disk.go
index 0d19e21139..4f9a3e7c1b 100644
--- a/internal/server/device/disk.go
+++ b/internal/server/device/disk.go
@@ -339,6 +339,11 @@ func (d *disk) validateConfig(instConf instance.ConfigReader) error {
var usedBy []string
err = storagePools.VolumeUsedByInstanceDevices(d.state, d.pool.Name(), storageProjectName, &dbVolume.StorageVolume, true, func(inst db.InstanceArgs, project api.Project, usedByDevices []string) error {
+ // Don't count the current instance.
+ if d.inst != nil && d.inst.Project().Name == inst.Project && d.inst.Name() == inst.Name {
+ return nil
+ }
+
usedBy = append(usedBy, inst.Name)
return nil

View File

@ -31,10 +31,8 @@ buildGoModule {
subPackages = [ "cmd/incus" ];
postInstall = ''
# use custom bash completion as it has extra logic for e.g. instance names
installShellCompletion --bash --name incus ./scripts/bash/incus
installShellCompletion --cmd incus \
--bash <($out/bin/incus completion bash) \
--fish <($out/bin/incus completion fish) \
--zsh <($out/bin/incus completion zsh)
'';

View File

@ -45,12 +45,6 @@ buildGoModule rec {
inherit hash;
};
# replace with env var > 0.6 https://github.com/lxc/incus/pull/610
postPatch = ''
substituteInPlace internal/usbid/load.go \
--replace-fail "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
'';
excludedPackages = [
# statically compile these
"cmd/incus-agent"
@ -103,10 +97,8 @@ buildGoModule rec {
'';
postInstall = ''
# use custom bash completion as it has extra logic for e.g. instance names
installShellCompletion --bash --name incus ./scripts/bash/incus
installShellCompletion --cmd incus \
--bash <($out/bin/incus completion bash) \
--fish <($out/bin/incus completion fish) \
--zsh <($out/bin/incus completion zsh)
'';

View File

@ -1,9 +1,6 @@
import ./generic.nix {
hash = "sha256-tGuAS0lZvoYb+TvmCklQ8TADZhbm4w/lhdI0ycS4/0o=";
version = "0.6.0";
vendorHash = "sha256-+WmgLOEBJ/7GF596iiTgyTPxn8l+hE6RVqjLKfCi5rs=";
patches = [
# fix storage bug, fixed in > 0.6
./529.patch
];
hash = "sha256-6TLoua3rooDRyPc5BPYgzU/oeVy6F8h+p3UtKGPZkAE=";
version = "0.7.0";
vendorHash = "sha256-Slw58pszT6sbpxK6/f+ojA+uStt0zSWxztFTm5ovZr8=";
patches = [ ];
}

View File

@ -10,12 +10,19 @@ def main [--lts = false, --regex: string] {
let current_version = nix eval --raw -f default.nix $"($attr).version" | str trim
if $latest_tag != $current_version {
print $"Updating: new ($latest_tag) != old ($current_version)"
update-source-version $attr $latest_tag $"--file=($file)"
let oldVendorHash = nix-instantiate . --eval --strict -A $"($attr).goModules.drvAttrs.outputHash" --json | from json
let vendorHash = do { nix-build -A $"($attr).goModules" } | complete | get stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
open $file | str replace $oldVendorHash $vendorHash | save --force $file
let checkBuild = do { nix-build -A $"($attr).goModules" } | complete
let vendorHash = $checkBuild.stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
if $vendorHash != null {
open $file | str replace $oldVendorHash $vendorHash | save --force $file
} else {
print $checkBuild.stderr
exit 1
}
}
{"lts?": $lts, before: $current_version, after: $latest_tag}