Use cargo vendor-filterer to create vendor Source1

This is required for building the vendored dependencies on Fedora.
This in-turn is required for an OpenSSL build that does not include .dll
and Windows binary files.

Resolves: RHEL-68133

Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
This commit is contained in:
Tyler Fanelli 2025-02-18 22:55:22 -05:00
parent 0a92715317
commit db755c7ad1
6 changed files with 56 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/snphost-0.5.0.tar.gz
/snphost-0.5.0-vendor.tar.gz
/snphost-0.5.0-vendor-FEDORA.tar.gz

23
create_vendor_source.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# fail upon error
set -e
# Run on Fedora
# make sure all dependencies are yum installed
# cd <guest-components-dir-ready-to-be-built>
# create a .cargo/config.toml
if [ ! -f .cargo/config.toml ]; then
rpm -E '%{cargo_prep}' > cargo_prep.sh
bash cargo_prep.sh
fi
# run cargo vendor-filtered --offline
cargo vendor-filterer --respect-source-config --offline --platform x86_64-unknown-linux-gnu --keep-dep-kinds all --all-features --exclude-crate-path "idna#tests" --exclude-crate-path "idna-0.4.0#tests"
# run tar
tar -czf snphost-0.5.0-vendor-FEDORA.tar.gz vendor/
echo snphost-0.5.0-vendor-FEDORA.tar.gz created

View File

@ -6,12 +6,21 @@
Name: snphost
Version: %{version}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Administrative utility for AMD SEV-SNP
URL: https://github.com/virtee/%{crate}
Source: https://github.com/virtee/%{crate}/archive/refs/tags/snphost-%{version}.tar.gz
Source1: https://github.com/virtee/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz
# Creating vendor tar (on latest Fedora under a snphost dir):
# dnf install <all dependencies>
# Edit create_vendor_source.sh to reflect proper version number being updated.
# bash create_vendor_source.sh
# mv snphost-{VERSION}-vendor.tar.xz ../vendor/
Source1: vendor/snphost-%{version}-vendor-FEDORA.tar.gz
# To build vendored dependencies on Fedora, update the env_logger dependency to match Fedora's present version.
Patch: update-envlogger-dependency.diff
# snphost is a tool using features specific to AMD EPYC processors (x86_64).
ExclusiveArch: x86_64
@ -29,6 +38,7 @@ License: Apache-2.0 AND BSD-3-Clause AND MIT AND MPL-2.0 AND Unicode-DFS-2016 AN
BuildRequires: rust-toolset
BuildRequires: /usr/bin/pkg-config
BuildRequires: openssl-devel
BuildRequires: libcurl-devel
%global _description %{expand:
Administrative utility for AMD SEV-SNP.}
@ -43,6 +53,7 @@ Administrative utility for AMD SEV-SNP.}
%prep
%autosetup -n %{crate}-%{version} -p1 -a1
rm -f Cargo.lock
%cargo_prep -v vendor
%build
@ -59,6 +70,11 @@ Administrative utility for AMD SEV-SNP.}
%endif
%changelog
* Wed Feb 19 2025 Tyler Fanelli <tfanelli@redhat.com> - 0.5.0-2
- Update env_logger dependency to build vendored dependencies on Fedora
- Use cargo vendor-filterer to create vendor Source1
- Resolves: RHEL-68133
* Tue Feb 11 2025 Tyler Fanelli <tfanelli@redhat.com> - 0.5.0-1
- Initial commit on c9s
Resolves: RHELPLAN-171499

View File

@ -1,2 +1,2 @@
SHA512 (snphost-0.5.0-vendor.tar.gz) = c9ab9c2c776d68f9713526aee2446d50d1f333d77b0b80925908459cf06b1ee317690394da6b86b6fe1f951412510ab8da1f881525ffa3c7fcda308405c5c826
SHA512 (snphost-0.5.0.tar.gz) = 9292e17505c0e33874342b38ea2b8b87fa06ca59147db93a9f83e46fafee443a9804a2efac82defdfcb6fe6c9dcc8519b2a4b6f61fd55a0de08a0296dfef11af
SHA512 (snphost-0.5.0-vendor-FEDORA.tar.gz) = 435604e05efb3a20f40979644427de2ef2a0dfc27086d391909d750b7f386185478caef0c2c2f81b5934eca43c5c85534adccf1e713c4d2effdc0b015afc6773

View File

@ -0,0 +1,13 @@
diff --git a/Cargo.toml b/Cargo.toml
index f09f99c..dc448e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,7 +26,7 @@ is-it-maintained-open-issues = { repository = "virtee/snphost" }
[dependencies]
anyhow = "1.0.83"
sev = { version = "4.0.0", features = ['openssl']}
-env_logger = "0.10.1"
+env_logger = "0.11.6"
clap = { version = "4.5", features = [ "derive" ] }
colorful = "0.2.2"
libc = "0.2.154"

Binary file not shown.