The package rpms/firecracker.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/firecracker.git/commit/?id=192569c20....
Change: +ExclusiveArch: aarch64 x86_64
Thanks.
Full change: ============
commit 192569c202a24802c16893a4339d0db24fe6ba14 Author: David Michael fedora.dm0@gmail.com Date: Fri Apr 21 09:40:15 2023 -0400
Initial import (fedora#2181039).
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90dc979 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/firecracker-1.3.1.tar.gz +/kvm-bindings-e835920.tar.gz +/micro_http-4b18a04.tar.gz diff --git a/firecracker-1.3.1-remove-cargo_toml.patch b/firecracker-1.3.1-remove-cargo_toml.patch new file mode 100644 index 0000000..3526f90 --- /dev/null +++ b/firecracker-1.3.1-remove-cargo_toml.patch @@ -0,0 +1,17 @@ +This crate has licensing issues and is only used for a developer test. + +--- a/src/firecracker/Cargo.toml ++++ b/src/firecracker/Cargo.toml +@@ -23,5 +23,4 @@ + vmm = { path = "../vmm" } + + [dev-dependencies] +-cargo_toml = "0.13.0" + regex = "1.5.5" +--- a/src/firecracker/tests/verify_dependencies.rs ++++ b/src/firecracker/tests/verify_dependencies.rs +@@ -1,3 +1,4 @@ ++#![cfg(not(test))] + // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. + // SPDX-License-Identifier: Apache-2.0 + diff --git a/firecracker-1.3.1-remove-criterion.patch b/firecracker-1.3.1-remove-criterion.patch new file mode 100644 index 0000000..1bbc9ff --- /dev/null +++ b/firecracker-1.3.1-remove-criterion.patch @@ -0,0 +1,26 @@ +The build does not run benches, and the criterion crate is retired in Fedora. + +--- a/src/snapshot/Cargo.toml ++++ b/src/snapshot/Cargo.toml +@@ -12,9 +12,6 @@ + versionize_derive = "0.1.4" + thiserror = "1.0.32" + +-[dev-dependencies] +-criterion = "0.4.0" +- + [[bench]] + name = "version_map" + harness = false +--- a/src/vmm/Cargo.toml ++++ b/src/vmm/Cargo.toml +@@ -36,9 +36,6 @@ + [target.'cfg(target_arch = "x86_64")'.dependencies] + cpuid = { path = "../cpuid" } + +-[dev-dependencies] +-criterion = "0.4.0" +- + [[bench]] + name = "main" + harness = false diff --git a/firecracker-1.3.1-remove-device_tree.patch b/firecracker-1.3.1-remove-device_tree.patch new file mode 100644 index 0000000..3dbd5b9 --- /dev/null +++ b/firecracker-1.3.1-remove-device_tree.patch @@ -0,0 +1,32 @@ +This crate is unmaintained for many years with license issues and deprecation +warnings, but it is only used for two aarch64 tests. + +--- a/src/arch/Cargo.toml ++++ b/src/arch/Cargo.toml +@@ -21,6 +21,3 @@ + logger = { path = "../logger" } + utils = { path = "../utils" } + vm-memory = { path = "../vm-memory" } +- +-[dev-dependencies] +-device_tree = "1.1.0" +--- a/src/arch/src/aarch64/fdt.rs ++++ b/src/arch/src/aarch64/fdt.rs +@@ -494,7 +494,7 @@ + .is_ok()) + } + +- #[test] ++ #[cfg(not(test))] + fn test_create_fdt() { + let regions = arch_memory_regions(layout::FDT_MAX_SIZE + 0x1000); + let mem = vm_memory::test_utils::create_anon_guest_memory(®ions, false) +@@ -552,7 +552,7 @@ + ); + } + +- #[test] ++ #[cfg(not(test))] + fn test_create_fdt_with_initrd() { + let regions = arch_memory_regions(layout::FDT_MAX_SIZE + 0x1000); + let mem = vm_memory::test_utils::create_anon_guest_memory(®ions, false) diff --git a/firecracker-1.3.1-upgrade-kvm-ioctls.patch b/firecracker-1.3.1-upgrade-kvm-ioctls.patch new file mode 100644 index 0000000..d35681c --- /dev/null +++ b/firecracker-1.3.1-upgrade-kvm-ioctls.patch @@ -0,0 +1,35 @@ +Switch to a branch packaged in Fedora, which currently has a compatible API. + +--- a/src/arch/Cargo.toml ++++ b/src/arch/Cargo.toml +@@ -9,7 +9,7 @@ + bitflags = "1.3.2" + derive_more = { version = "0.99.17", default-features = false, features = ["from"] } + kvm-bindings = { version = "0.6.0", features = ["fam-wrappers"] } +-kvm-ioctls = "0.12.0" ++kvm-ioctls = "0.13.0" + libc = "0.2.117" + linux-loader = "0.8.1" + versionize = "0.1.6" +--- a/src/cpuid/Cargo.toml ++++ b/src/cpuid/Cargo.toml +@@ -7,7 +7,7 @@ + + [dependencies] + kvm-bindings = { version = "0.6.0", features = ["fam-wrappers"] } +-kvm-ioctls = "0.12.0" ++kvm-ioctls = "0.13.0" + thiserror = "1.0.32" + + arch = { path = "../arch" } +--- a/src/vmm/Cargo.toml ++++ b/src/vmm/Cargo.toml +@@ -9,7 +9,7 @@ + derive_more = { version = "0.99.17", default-features = false, features = ["from"] } + event-manager = "0.3.0" + kvm-bindings = { version = "0.6.0", features = ["fam-wrappers"] } +-kvm-ioctls = "0.12.0" ++kvm-ioctls = "0.13.0" + lazy_static = "1.4.0" + libc = "0.2.117" + linux-loader = "0.8.1" diff --git a/firecracker.spec b/firecracker.spec new file mode 100644 index 0000000..eec3102 --- /dev/null +++ b/firecracker.spec @@ -0,0 +1,110 @@ +# Disable tests by default since VMs can't run in containerized Fedora builds. +%bcond_with check + +# The RPM macro cargo_target can be defined to specify the Rust target to use +# during the build. When undefined, the distro's default target is used. + +# Assume that musl targets produce static binaries by default, which determines +# if the jailer program is usable. It should still build successfully with any +# linkage setting, so this conditional allows forcing it to build or not. +%if %{lua:print(rpm.expand("%{cargo_target}"):match("musl") and "1" or "0")} +%bcond_without jailer +%else +%bcond_with jailer +%endif + +Name: firecracker +Version: 1.3.1 +Release: 1%{?dist} + +Summary: Secure and fast microVMs for serverless computing +License: Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Unlicense) AND Unicode-DFS-2016 +URL: https://firecracker-microvm.github.io/ + +Source0: https://github.com/firecracker-microvm/firecracker/archive/v%%7Bversion%7D/%... + +# Bundle forked versions of existing crates to avoid conflicts with upstreams. +Source1: https://github.com/firecracker-microvm/kvm-bindings/archive/e8359204b41d5c2e... +Source2: https://github.com/firecracker-microvm/micro-http/archive/4b18a043e997da5b5f... + +# kvm-bindings: Apache-2.0 +Provides: bundled(crate(kvm-bindings)) = 0.6.0^gite835920 +# micro_http: Apache-2.0 +Provides: bundled(crate(micro_http)) = 0.1.0^git4b18a04 + +# Edit crate dependencies to track what is packaged in Fedora. +# These patches do not make sense to send upstream given their purpose. +Patch1: %{name}-1.3.1-remove-cargo_toml.patch +Patch2: %{name}-1.3.1-remove-criterion.patch +Patch3: %{name}-1.3.1-remove-device_tree.patch +Patch4: %{name}-1.3.1-upgrade-kvm-ioctls.patch + +BuildRequires: cargo-rpm-macros >= 24 +%if %defined cargo_target +BuildRequires: rust-std-static-%{cargo_target} +%endif + +# Currently only these architectures are supported. See the README. +ExclusiveArch: aarch64 x86_64 + +%description +Firecracker is an open source virtualization technology that is purpose-built +for creating and managing secure, multi-tenant container and function-based +services that provide serverless operational models. Firecracker runs +workloads in lightweight virtual machines, called microVMs, which combine the +security and isolation properties provided by hardware virtualization +technology with the speed and flexibility of containers. + + +%prep +%autosetup -p1 + +# Extract the bundled forked crates and point their users at the paths. +mkdir forks +tar --transform='s,^[^/]*,kvm-bindings,' -C forks -xzf %{SOURCE1} +tar --transform='s,^[^/]*,micro_http,' -C forks -xzf %{SOURCE2} +sed -i -e 's@^(kvm-bindings|micro_http) = {.*(, features =.*| }$)@\1 = { path = "../../forks/\1"\2@' Cargo.toml src/*/Cargo.toml +sed -i -e 's,../../forks,forks,' Cargo.toml + +%cargo_prep + +%generate_buildrequires +# Unconditionally include dev-dependencies to avoid build failures. +cargo2rpm --path Cargo.toml buildrequires --with-check + +%build +%cargo_build -- --package={firecracker,%{?with_jailer:jailer,}rebase-snap,seccompiler} %{?cargo_target:--target=%{cargo_target}} +%{cargo_license} > LICENSE.dependencies + +%install +install -pm 0755 -Dt %{buildroot}%{_bindir} target/%{?cargo_target}/release/{firecracker,%{?with_jailer:jailer,}rebase-snap,seccompiler-bin} + +# Ship the built-in seccomp JSON as an example that can be edited and compiled. +ln -fn resources/seccomp/%{cargo_target}.json seccomp-filter.json || +ln -fn resources/seccomp/unimplemented.json seccomp-filter.json + +# Prune unused images from the documentation directory prior to installation. +for image in docs/images/* +do grep --exclude-dir=images -FIqr "${image##*/}" docs *.md || rm -f "$image" +done + +%if %{with check} +%check +%cargo_test -- %{!?with_jailer:--exclude=jailer} %{?cargo_target:--target=%{cargo_target}} --workspace +%endif + + +%files +%{_bindir}/firecracker +%{?with_jailer:%{_bindir}/jailer} +%{_bindir}/rebase-snap +%{_bindir}/seccompiler-bin +%doc seccomp-filter.json +%doc src/api_server/swagger/firecracker.yaml +%doc docs CHANGELOG.md CHARTER.md CODE_OF_CONDUCT.md CONTRIBUTING.md CREDITS.md FAQ.md MAINTAINERS.md README.md SECURITY.md SPECIFICATION.md +%license LICENSE LICENSE.dependencies NOTICE THIRD-PARTY + + +%changelog +* Mon Mar 06 2023 David Michael fedora.dm0@gmail.com - 1.3.1-1 +- Initial package. diff --git a/sources b/sources new file mode 100644 index 0000000..feeefe8 --- /dev/null +++ b/sources @@ -0,0 +1,3 @@ +SHA512 (firecracker-1.3.1.tar.gz) = b4eef3fe1ae9ffff59890d793bb04d07bc97f4a8443d314bf6173eaa61376ec675e99c4065781e6875c88f1ad91aab016b798da522e8f21d52cffdf5c4eea719 +SHA512 (kvm-bindings-e835920.tar.gz) = e9e713c72e5a7cdd05063ec273abb8ab54aec71519119e7fbe0e93923dea89e3987346a7a09a101f01ace911ef6ac0694febc131e45b84692592065fa82eb74c +SHA512 (micro_http-4b18a04.tar.gz) = 883d76820b5ed3fa36cb8110bf34ca7fa9e345a9c4f5040f77f4a578cc86fdfde51bcb4fa4daf6ab371a67ed27bd36df38c710e884a59b85c672c2843c87d7d6
arch-excludes@lists.fedoraproject.org