Commit 7ef46545 authored by Emily's avatar Emily
Browse files

rust-hypervisor-firmware: drop

Cloud Hypervisor supports direct booting of kernels these days, and
`microvm.nix` has used that support since 2023. I couldn’t find
any other consumers from a search, and I believe this package has
failed to build since at least the Rust 1.90 upgrade, as the target
spec file no longer parses.
parent 54f68e82
Loading
Loading
Loading
Loading
+0 −67
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  stdenv,
  lld,
}:

let
  arch = stdenv.hostPlatform.qemuArch;

  target = ./. + "/${arch}-unknown-none.json";

in

let
  cross = import ../../../.. {
    system = stdenv.hostPlatform.system;
    crossSystem = lib.systems.examples."${arch}-embedded" // {
      rust.rustcTarget = "${arch}-unknown-none";
      rust.platform =
        assert lib.assertMsg (builtins.pathExists target) "Target spec not found";
        lib.importJSON target;
    };
  };

  inherit (cross) rustPlatform;

in

rustPlatform.buildRustPackage rec {
  pname = "rust-hypervisor-firmware";
  version = "0.5.0";

  src = fetchFromGitHub {
    owner = "cloud-hypervisor";
    repo = "rust-hypervisor-firmware";
    tag = version;
    sha256 = "sha256-iLYmPBJH7I6EJ8VTUbR0+lZaebvbZlRv2KglbjKX76Q=";
  };

  cargoHash = "sha256-iqsU4t8Zz9UTtAu+a6kqwnPZ6qdGAriQ7hcU58KDQ8M=";

  # lld: error: unknown argument '-Wl,--undefined=AUDITABLE_VERSION_INFO'
  # https://github.com/cloud-hypervisor/rust-hypervisor-firmware/issues/249
  auditable = false;

  env = {
    RUSTC_BOOTSTRAP = 1;
    RUSTFLAGS = "-C linker=lld -C linker-flavor=ld.lld";
  };

  nativeBuildInputs = [
    lld
  ];

  # Tests don't work for `no_std`. See https://os.phil-opp.com/testing/
  doCheck = false;

  meta = {
    homepage = "https://github.com/cloud-hypervisor/rust-hypervisor-firmware";
    description = "Simple firmware that is designed to be launched from anything that supports loading ELF binaries and running them with the PVH booting standard";
    license = with lib.licenses; [ asl20 ];
    maintainers = with lib.maintainers; [ astro ];
    platforms = [ "x86_64-none" ];
    mainProgram = "hypervisor-fw";
  };
}
+0 −20
Original line number Diff line number Diff line
{
  "llvm-target": "x86_64-unknown-none",
  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
  "arch": "x86_64",
  "target-endian": "little",
  "target-pointer-width": "64",
  "target-c-int-width": "32",
  "os": "none",
  "executables": true,
  "linker": "rust-lld",
  "linker-flavor": "ld.lld",
  "panic-strategy": "abort",
  "disable-redzone": true,
  "features": "-mmx,-sse,+soft-float",
  "code-model": "small",
  "relocation-model": "pic",
  "pre-link-args": {
    "ld.lld": ["--script=x86_64-unknown-none.ld"]
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -1713,6 +1713,7 @@ mapAliases {
  rucksack = throw "rucksack was removed due to numerous vulnerabilities in freeimage"; # Added 2025-10-23
  runCommandNoCC = warnAlias "'runCommandNoCC' has been renamed to/replaced by 'runCommand'" runCommand; # Converted to warning 2025-10-28
  runCommandNoCCLocal = warnAlias "'runCommandNoCCLocal' has been renamed to/replaced by 'runCommandLocal'" runCommandLocal; # Converted to warning 2025-10-28
  rust-hypervisor-firmware = throw "rust-hypevisor-firmware was removed, as it is no longer needed by Cloud Hypervisor and was broken"; # Added 2026-02-19
  rust-synapse-state-compress = throw "'rust-synapse-state-compress' has been renamed to/replaced by 'rust-synapse-compress-state'"; # Converted to throw 2025-10-27
  rustc-wasm32 = throw "'rustc-wasm32' has been renamed to/replaced by 'rustc'"; # Converted to throw 2025-10-27
  rustic-rs = throw "'rustic-rs' has been renamed to/replaced by 'rustic'"; # Converted to throw 2025-10-27
+0 −2
Original line number Diff line number Diff line
@@ -8477,8 +8477,6 @@ with pkgs;

  qboot = pkgsi686Linux.callPackage ../applications/virtualization/qboot { };

  rust-hypervisor-firmware = callPackage ../applications/virtualization/rust-hypervisor-firmware { };

  OVMF = callPackage ../applications/virtualization/OVMF {
    inherit (python3Packages) pexpect;
  };