Bug 2101691

Summary: Enable libkrun support in rawhide
Product: [Fedora] Fedora Reporter: Sergio Lopez <slopezpa>
Component: crunAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: container-sig, gscrivan, lsm5, pehunt, rh.container.bot
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-21 13:03:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergio Lopez 2022-06-28 07:15:39 UTC
Now that libkrun has landed in rawhide, please consider enabling libkrun support in the Fedora package for newer releases (releases produced after merging PR#946, PR#955 and PR#956) of crun.

In addition to the "configure" option and the additional "BuildRequires", the package would need to ship a symbolic link from "krun" to "crun".

Comment 1 Lokesh Mandvekar 2022-06-28 13:04:15 UTC
Is this rawhide only? What's the ETA for f36 and f35?

Comment 2 Sergio Lopez 2022-06-28 15:03:06 UTC
(In reply to Lokesh Mandvekar from comment #1)
> Is this rawhide only? What's the ETA for f36 and f35?

Yes, the idea is to keep it in rawhide, with f37 being the first release featuring libkrun-enabled programs.

Comment 3 Lokesh Mandvekar 2022-06-28 18:00:32 UTC
Sergio, Giuseppe, PTAL @ diff.

I can commit this change whenever we're about to cut a new release.


diff --git a/crun.spec b/crun.spec
index 9a9976a..a46f30a 100644
--- a/crun.spec
+++ b/crun.spec
@@ -1,3 +1,9 @@
+%if 0%{?fedora} >= 37
+%global krun_enabled 1
+%else
+%global krun_enabled 0
+%endif
+
 %global built_tag 1.4.5

 Summary: OCI runtime written in C
@@ -31,6 +37,10 @@ BuildRequires: python3
 BuildRequires: libcap-devel
 BuildRequires: systemd-devel
 BuildRequires: yajl-devel
+%if %{krun_enabled}
+BuildRequires: libkrun-devel
+Provides: krun
+%endif
 BuildRequires: libseccomp-devel
 BuildRequires: libselinux-devel
 BuildRequires: python3-libmount
@@ -51,7 +61,12 @@ Provides: oci-runtime

 %build
 ./autogen.sh
+
+%if %{krun_enabled}
+%configure --disable-silent-rules --with-libkrun
+%else
 %configure --disable-silent-rules
+%endif

 %make_build

@@ -59,9 +74,16 @@ Provides: oci-runtime
 %make_install
 rm -rf %{buildroot}%{_prefix}/lib*

+%if %{krun_enabled}
+ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/krun
+%endif
+
 %files
 %license COPYING
 %{_bindir}/%{name}
+%if %{krun_enabled}
+%{_bindir}/krun
+%endif
 %{_mandir}/man1/*

 %changelog

Comment 4 Sergio Lopez 2022-07-04 09:24:22 UTC
LGTM, thanks Lokesh!

Comment 5 Lokesh Mandvekar 2022-07-05 12:36:31 UTC
Thanks Sergio.

Giuseppe, please let me know when you're about to cut a new crun. I'll push this patch along with the rpm version update.

Comment 6 Giuseppe Scrivano 2022-07-20 14:56:12 UTC
Lokesh, I've just cut 1.5 upstream

Comment 7 Fedora Update System 2022-07-20 20:12:12 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 8 Fedora Update System 2022-07-20 20:12:17 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 9 Fedora Update System 2022-07-20 20:12:21 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 10 Fedora Update System 2022-07-20 20:12:29 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 11 Fedora Update System 2022-07-20 20:12:43 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 12 Fedora Update System 2022-07-20 20:12:55 UTC
FEDORA-2022-8593b9ea9c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

Comment 13 Fedora Update System 2022-07-21 23:05:27 UTC
FEDORA-2022-8593b9ea9c has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-8593b9ea9c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-8593b9ea9c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.