Bug 2085377 - Review requested: libzpc - IBM Z specific hardware exploitation library
Summary: Review requested: libzpc - IBM Z specific hardware exploitation library
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: s390x
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Horák
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-13 08:00 UTC by jschmidb
Modified: 2022-10-06 10:46 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-09-21 14:22:00 UTC
Type: Bug
Embargoed:
dan: fedora-review+


Attachments (Terms of Use)
SPEC file (2.37 KB, text/plain)
2022-05-13 08:05 UTC, jschmidb
no flags Details
Source RPM (534.41 KB, application/octet-stream)
2022-05-13 08:07 UTC, jschmidb
no flags Details
Updated rpm (91.30 KB, application/x-rpm)
2022-05-30 08:33 UTC, jschmidb
no flags Details
Updated spec file (2.40 KB, text/plain)
2022-06-08 13:54 UTC, jschmidb
no flags Details
Updated rpm (87.84 KB, application/x-rpm)
2022-06-08 13:55 UTC, jschmidb
no flags Details
Updated source rpm with new spec file (87.89 KB, application/x-rpm)
2022-06-14 14:30 UTC, jschmidb
no flags Details
Updated spec file (2.41 KB, text/plain)
2022-06-15 10:43 UTC, jschmidb
no flags Details
v1.0.1 rpm (89.14 KB, application/x-rpm)
2022-06-23 15:09 UTC, jschmidb
no flags Details
v1.0.1 spec file (2.65 KB, text/plain)
2022-06-23 15:10 UTC, jschmidb
no flags Details
spec file with unix-style line endings (2.56 KB, text/plain)
2022-06-29 15:21 UTC, jschmidb
no flags Details
spec file without static sections (2.32 KB, text/plain)
2022-07-01 08:23 UTC, jschmidb
no flags Details
Related srpm (89.03 KB, application/x-rpm)
2022-07-04 07:28 UTC, jschmidb
no flags Details

Description jschmidb 2022-05-13 08:00:39 UTC
Description: The libzpc library provides a user space API for exploitation of the
IBM Z protected key functionality, which is part of the IBM Z CPACF feature.

Fedora Account System Username: jschmidb

Version-Release number of selected component (if applicable): 1.0.0

Comment 1 jschmidb 2022-05-13 08:02:45 UTC
https://github.com/opencryptoki/libzpc

Comment 2 jschmidb 2022-05-13 08:05:51 UTC
Created attachment 1879335 [details]
SPEC file

Comment 3 jschmidb 2022-05-13 08:07:45 UTC
Created attachment 1879336 [details]
Source RPM

Comment 4 Dan Horák 2022-05-13 08:15:56 UTC
taking for review

Comment 5 Dan Horák 2022-05-24 07:49:28 UTC
Hi Joerg, I see two issues
- the tar.gz archive bundled with the srpm doesn't match the one you get from github from the Source0 URL (via spectool -g libzpc.spec). Looks like the bundled version contains the complete archive of a local libzpc checkout.
- there is no %files section for the static library

Comment 6 Dan Horák 2022-05-24 08:25:58 UTC
and when the github source archive will be used, then "%setup -q -n %{name}" can become %autosetup (or %setup)

Comment 7 Dan Horák 2022-05-24 08:40:07 UTC
- the actual library is swapped between the libzpc and libzpc-devel rpms
- the value of the License tag should be just "MIT"

Comment 8 jschmidb 2022-05-30 08:31:24 UTC
Hi Dan,

ok, I changed the License tag to just MIT. Will open a pr for this. 

After changing the %prep to %autosetup, I get an rpm build error, so I left this as 
"%setup -q -n %{name}" for now.

Comparing the tar.gz archives shows that I in fact included the .git and build folders, which
is probably not what you want. I rebuilt the rpm without these two folders and I'm attaching
the new rpm to this bugzilla. 

You also mentioned: "there is no %files section for the static library" 
The %files section has this entry:
%{_libdir}/%{name}.so
What else do we need here?

Thanks,
Joerg

Comment 9 jschmidb 2022-05-30 08:33:36 UTC
Created attachment 1885002 [details]
Updated rpm

Updated rpm with updated spec file, without .git and build folders

Comment 10 Dan Horák 2022-06-01 10:34:09 UTC
(In reply to jschmidb from comment #8)
> Hi Dan,
> 
> ok, I changed the License tag to just MIT. Will open a pr for this. 
> 
> After changing the %prep to %autosetup, I get an rpm build error, so I left
> this as 
> "%setup -q -n %{name}" for now.
> 
> Comparing the tar.gz archives shows that I in fact included the .git and
> build folders, which
> is probably not what you want. I rebuilt the rpm without these two folders
> and I'm attaching
> the new rpm to this bugzilla. 

The source rpm must include the source archive downloaded from github, as referred by the Source0 tag. I guess you are building the source archive locally. The reviewed source rpm must include the source archive that matches the one from the Source0, otherwise we are possibly reviewing something completely different.
 
> You also mentioned: "there is no %files section for the static library" 
> The %files section has this entry:
> %{_libdir}/%{name}.so
> What else do we need here?

There is a %package section for the static subpackage, but no corresponding %files section. As a result the libzpc.a static library is not distributed. And as mentioned in my comment #7, the *.so file belongs to the devel subpackage and the *.so.* file into the main package.

Comment 11 jschmidb 2022-06-07 11:08:36 UTC
Hi Dan,

> There is a %package section for the static subpackage, but no corresponding %files section.

I'm not completely sure what you mean here, is it like:

%files static
%{_libdir}/%{name}.so.%{soversion}*

> The source rpm must include the source archive downloaded from github, as referred by the Source0 tag.

Yes, I was in fact creating a new tar.gz from the project source.
And I see a difference between the tar.gz created locally and the one from Source0:

The locally created one contains this structure:

libzpc-1.0.0.tar
  - libzpc-1.0.0 folder
      - libzpc folder   <- missing in the tar.gz from Source0 
          - project contents ..   

The libzpc folder is missing in the tar.gz from Source0 and the rpmbuild fails. 

So does this mean the tar.gz on Source0 is incorrectly built?

Comment 12 jschmidb 2022-06-08 13:53:00 UTC
Thanks for your comments via mail Dan! 

Building the rpm with "rpmbuild -bs ..." solved the build problem. I was using "rpmbuild -ba ...".
I'm attaching the new rpm.

Regarding '%files devel' versus '%files', looks like I have just swapped the two symlinks.
I'm attaching the new spec file with exchanged symlinks. 

And I added a '%files static' section with 

%files static
%{_libdir}/%{name}.a

Comment 13 jschmidb 2022-06-08 13:54:01 UTC
Created attachment 1888055 [details]
Updated spec file

Comment 14 jschmidb 2022-06-08 13:55:47 UTC
Created attachment 1888056 [details]
Updated rpm

Comment 15 Dan Horák 2022-06-14 13:08:39 UTC
Joerg, seems the spec file attached is different compared to the one in the attached source rpm.

Comment 16 jschmidb 2022-06-14 14:29:53 UTC
Ah sorry, yes you are right: I made the changes in my git project folder, but did 
not copy the new spec file to rpmbuild/SPECS on my build system. 

I re-created the source rpm with the new spec file. I will create a new pull request
on github for it to include it into the libzpc lib. 

Attaching new files ...

Comment 17 jschmidb 2022-06-14 14:30:59 UTC
Created attachment 1889885 [details]
Updated source rpm with new spec file

Comment 18 Dan Horák 2022-06-15 07:46:35 UTC
Thanks, I believe we are close now :-)

Please update the %setup command to reflect the use of the canonical (aka github) source archive which uses %{name}-%{version} format for the top level directory, I recommend to use %autosetup.

I hope the last item is the location of the pkgconfig file, which is currently installed into /usr/share/pkgconfig by the project's buildsystem. Looks like it's a valid location in addition to the classic /usr/{lib,lib64}/pkgconfig. Either location is OK, but seems there is mismatch between the CMakeLists.txt and the spec file.

Comment 19 jschmidb 2022-06-15 10:42:48 UTC
OK, I changed the %setup command to:

%autosetup -q -n %{name}-%{version}

The pull request is open at:
https://github.com/opencryptoki/libzpc/pull/6

Regarding the pkgconfig file location: The previous commit "Provide spec file for rpmbuild"
changes the location to ${CMAKE_INSTALL_LIBDIR}/pkgconfig, which translates to
/usr/{local}/{lib,lib64}/pkgconfig. The spec file has %{_libdir}/pkgconfig/.
I do not see the mismatch yet ... 

Re-uploading new spec file ...

Comment 20 jschmidb 2022-06-15 10:43:26 UTC
Created attachment 1890246 [details]
Updated spec file

Comment 21 Dan Horák 2022-06-15 10:52:10 UTC
(In reply to jschmidb from comment #19)
> OK, I changed the %setup command to:
> 
> %autosetup -q -n %{name}-%{version}
> 
> The pull request is open at:
> https://github.com/opencryptoki/libzpc/pull/6
> 
> Regarding the pkgconfig file location: The previous commit "Provide spec
> file for rpmbuild"
> changes the location to ${CMAKE_INSTALL_LIBDIR}/pkgconfig, which translates
> to
> /usr/{local}/{lib,lib64}/pkgconfig. The spec file has %{_libdir}/pkgconfig/.
> I do not see the mismatch yet ... 

Yes, but this change hasn't made it to the released libzpc archive (currently still version 1.0.0), if I see right. Looks to me it would make sense to release version 1.0.1 with the latest changes.

One reminder because I saw some test data files/URLs in the CMakeLists.txt file, the Fedora or RHEL build systems don't have access to the internet (by design), so should the build download any files on the fly, it will fail.

Comment 22 jschmidb 2022-06-15 14:07:28 UTC
> Yes, but this change hasn't made it to the released libzpc archive (currently still version 1.0.0), if > I see right. Looks to me it would make sense to release version 1.0.1 with the latest changes.

Yep, makes sense. I changed the version to 1.0.1 in the spec file and CMakeLists.txt to be
consistent. But then the rpmbuild fails, because it wants to get a libzpc-1.0.1.tar.gz.
So I probably could first commit the changes on github to force rebuilding the tar.gz
and then do the rpmbuild again, or I just rename the tar.gz? But then the contained
CMakeLists.txt would not have the correct release ... hmm .. what should we do here?

I also noticed that "%autosetup -q -n %{name}-%{version}" doesn't like the -q option,
so I removed it. 

> One reminder because I saw some test data files/URLs in the CMakeLists.txt file, the Fedora or RHEL
> build systems don't have access to the internet (by design), so should the build download any files on > the fly, it will fail.

Yes, "cmake -DBUILD_TEST=ON" downloads test vectors from NIST and also downloads the Google
gtest suite. But when building without test, no internet connection is needed.

Comment 23 Dan Horák 2022-06-21 10:27:39 UTC
(In reply to jschmidb from comment #22)
> > Yes, but this change hasn't made it to the released libzpc archive (currently still version 1.0.0), if > I see right. Looks to me it would make sense to release version 1.0.1 with the latest changes.
> 
> Yep, makes sense. I changed the version to 1.0.1 in the spec file and
> CMakeLists.txt to be
> consistent. But then the rpmbuild fails, because it wants to get a
> libzpc-1.0.1.tar.gz.
> So I probably could first commit the changes on github to force rebuilding
> the tar.gz
> and then do the rpmbuild again, or I just rename the tar.gz? But then the
> contained
> CMakeLists.txt would not have the correct release ... hmm .. what should we
> do here?

good question, but I think the best option is to commit changes to github, make a new release (1.0.1) and use that for the next iteration in the review.
 
> I also noticed that "%autosetup -q -n %{name}-%{version}" doesn't like the
> -q option,
> so I removed it. 

plain %autosetup should be sufficient for standard source archives
 
> > One reminder because I saw some test data files/URLs in the CMakeLists.txt file, the Fedora or RHEL
> > build systems don't have access to the internet (by design), so should the build download any files on > the fly, it will fail.
> 
> Yes, "cmake -DBUILD_TEST=ON" downloads test vectors from NIST and also
> downloads the Google
> gtest suite. But when building without test, no internet connection is
> needed.

OK, no problem then

Comment 24 jschmidb 2022-06-23 15:07:57 UTC
> good question, but I think the best option is to commit changes to github, make a new release (1.0.1) and use that for the next iteration in the review.

OK, I merged the pr and made a new v1.0.1. I'm attaching the final rpm (built with the v1.0.1 tar.gz) and spec file. 

> plain %autosetup should be sufficient for standard source archives

Yep, it's now just %autosetup.

Comment 25 jschmidb 2022-06-23 15:09:08 UTC
Created attachment 1892213 [details]
v1.0.1 rpm

Comment 26 jschmidb 2022-06-23 15:10:06 UTC
Created attachment 1892214 [details]
v1.0.1 spec file

Comment 27 Dan Horák 2022-06-29 09:19:50 UTC
The spec file got DOS/Win line endings (CR+LF) somehow which breaks rpmbuild :-(

Comment 28 jschmidb 2022-06-29 15:21:09 UTC
Your are right, sorry! 
I'm going to re-attach the spec file with Unix-style line endings.

Comment 29 jschmidb 2022-06-29 15:21:49 UTC
Created attachment 1893436 [details]
spec file with unix-style line endings

Comment 30 Dan Horák 2022-07-01 07:41:16 UTC
thanks for the update

But it looks to me that the current Cmake project file is able to build either a shared lib or a static lib, but not both. I suggest to remove all the sections for the static lib from the spec file, so we can finish the review. Ignore the spec file in libzpc project and make the change "locally" only.

rpmbuild -ba libzpc.spec fails with

RPM build errors:
    File not found: /home/sharkcz/rpmbuild/BUILDROOT/libzpc-1.0.1-1.fc36.s390x/usr/lib64/libzpc.a

Comment 31 jschmidb 2022-07-01 08:22:32 UTC
Hmm, yes, I'm getting the same build error with rpmbuild -ba. 

I removed the static sections from the spec file as you suggested 
and the build with rpmbuild -ba now succeeds.

... re-attaching changed spec file

Comment 32 jschmidb 2022-07-01 08:23:16 UTC
Created attachment 1893861 [details]
spec file without static sections

Comment 33 Dan Horák 2022-07-01 08:31:14 UTC
please attach the srpm as well

Comment 34 jschmidb 2022-07-04 07:28:44 UTC
Created attachment 1894437 [details]
Related srpm

Comment 35 Dan Horák 2022-08-01 16:29:37 UTC
formal review is here, see the notes explaining OK* and BAD statuses below:

OK      source files match upstream:
    c7be71b5f4139b724ba6a8e058898056c9a7b09e  libzpc-1.0.1.tar.gz

OK      package meets naming and versioning guidelines.
OK      specfile is properly named, is cleanly written and uses macros consistently.
OK      dist tag is present.
OK      license field matches the actual license (MIT).
OK      license is open source-compatible. License text included in package.
OK      latest version is being packaged.
OK      BuildRequires are proper.
OK      compiler flags are appropriate.
OK      package builds in mock (Rawhide/s390x).
OK      debuginfo package looks complete.
OK      rpmlint is silent.
OK      final provides and requires look sane.
OK      %check is present and all tests pass.
OK      shared libraries are corectly added to the regular linker search paths.
OK      owns the directories it creates.
OK      doesn't own any directories it shouldn't.
OK      no duplicates in %files.
OK      file permissions are appropriate.
OK      no scriptlets present.
OK      code, not content.
OK      documentation is small, so no -docs subpackage is necessary.
OK      %docs are not necessary for the proper functioning of the package.
OK      headers in devel subpackage
OK      pkgconfig files in devel subpackage
OK      no libtool .la droppings.
OK      not a GUI app.

- tests require Internet access, thus they are not run during our builds

The libzpc package is APPROVED.

Comment 36 jschmidb 2022-09-16 08:20:07 UTC
- Requested ACL token
- fedpkg set-pagure-token xxxxx
- fedpkg request-repo libzpc 2085377

I changed the bugzilla title to include "Review requested:", because I first got error msg
"Could not execute request_repo: Invalid title for this Bugzilla bug (no ":" present)"

Now waiting until the request is approved:
https://pagure.io/releng/fedora-scm-requests/issue/47590

Comment 37 Gwyn Ciesla 2022-09-19 14:04:10 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/libzpc

Comment 38 jschmidb 2022-09-21 14:20:16 UTC
OK, meanwhile I requested branches for f35 and f36, did a git merge rawhide, fedpkg push, and fedpkg build for both branches.

The packaging guide says I'm now supposed to close the ticket.

I'm closing with RAWHIDE as I did the build for rawhide. 

As I'm completely new to this process, please let me know if there are still todo's for me.
According to the packaging guide "New Package Process for Existing Contributors" I'm now
finishing step 12 (Close bugzilla). Not sure if I have something to do for step 13 and 14.

Comment 39 jschmidb 2022-09-21 14:22:00 UTC
Closing.

Comment 40 Dan Horák 2022-09-22 07:37:23 UTC
Good job, thanks.

But there are few items still missing
- there is no build for rawhide (aka f38), I see only f35 and f36 builds, to be resolved with "fedpkg build" from the rawhide/main branch
- there is no f37 branch at all if I see correctly, it's the release to be GA very soon (aka "branched"), it got a separate branch from rawhide in early August

Step 13 is required to get builds for the "current" releases published, so users can actually install them. This includes F-35, F-36 and F-37.
And yes, step 14 can be skipped.

Comment 41 jschmidb 2022-09-26 09:35:59 UTC
- rawhide (aka f38) is now built.

- For f37, as suggested in https://pagure.io/releng/fedora-scm-requests/issue/47711
  I did a 
  $ git checkout -b f37
  $ git push -u origin f37
  $ fedpkg build
  Here, the build failed with:
(gssapi auth failed: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://koji.fedoraproject.org/kojihub/ssllogin)
Use following documentation to debug kerberos/gssapi auth issues. https://docs.pagure.org/koji/kerberos_gssapi_debug/
Kerberos authentication fails: unable to obtain a session (gssapi auth failed: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://koji.fedoraproject.org/kojihub/ssllogin)
Use following documentation to debug kerberos/gssapi auth issues. https://docs.pagure.org/koji/kerberos_gssapi_debug/
Could not execute build: Could not login to https://koji.fedoraproject.org/kojihub

- Question: for Step 13 I would do for f35, f36, f37 and f38 (rawhide):
  # fedpkg build
  # fedpkg update
  Monitor the update’s status ... 
  # bodhi updates request <update_id> stable
  correct?

Comment 42 Dan Horák 2022-09-27 08:31:14 UTC
- to create the missing f37 branch please use "fedpkg request-branch f37"
- no need to submit an update for rawhide/f38, this is handled automagically and immediately goes into "stable", rawhide is a "rolling release"
- the "update" procedure looks correct, although the "stable request" is not necessary, because the move is done by automation by default, based on karma set by users (>=3) or by time (7 or 14 days in updates-testing)
- personally I am using the web UI (https://bodhi.fedoraproject.org/) which allows me to create updates for multiple branches by filling one form (you select multiple builds, eg. f35 + f36 + f37, and bodhi creates 3 update entries)

Comment 43 jschmidb 2022-09-27 11:06:21 UTC
Thanks Dan!
 - just did a "fedpkg request-branch f37": 
   https://pagure.io/releng/fedora-scm-requests/issue/47787
 - I requested builds for f35 and f36 via the web UI and I already see
   libzpc-1.0.1-1.fc35 -> pending/testing
   libzpc-1.0.1-1.fc36 -> pending/testing
   libzpc-1.0.1-1.fc38 -> stable
So I will do the same for f37 as soon as I have it.

Comment 44 jschmidb 2022-09-27 13:43:02 UTC
There's still a problem with f37:

$ git checkout f37
Switched to branch 'f37'
Your branch is up to date with 'origin/f37'.

$ git push -u origin f37
Branch 'f37' set up to track remote branch 'f37' from 'origin'.
Everything up-to-date

$ git merge f37
Already up to date.

$ fedpkg build
(gssapi auth failed: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://koji.fedoraproject.org/kojihub/ssllogin)
Use following documentation to debug kerberos/gssapi auth issues. https://docs.pagure.org/koji/kerberos_gssapi_debug/
Kerberos authentication fails: unable to obtain a session (gssapi auth failed: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://koji.fedoraproject.org/kojihub/ssllogin)
Use following documentation to debug kerberos/gssapi auth issues. https://docs.pagure.org/koji/kerberos_gssapi_debug/
Could not execute build: Could not login to https://koji.fedoraproject.org/kojihub

Comment 45 Dan Horák 2022-09-27 14:26:13 UTC
Hi Joerg, do you have a valid kerberos ticket?

Comment 46 jschmidb 2022-09-27 15:17:25 UTC
Hmm, I'm not aware of any ... so most likely not.

Comment 47 jschmidb 2022-09-28 14:05:30 UTC
ok, 'fkinit -u jschmidb' did the trick.
f37 is now also built and I requested an update via the web GUI.

Comment 48 jschmidb 2022-10-06 10:38:57 UTC
Looks like everything is now ok in Fedora:
https://buildsys.fedoraproject.org/koji/packageinfo?packageID=36058

Please let me know if there is anything to do for me to get the packages into RHEL.
My current understanding is that is done automatically.

Comment 49 Dan Horák 2022-10-06 10:46:02 UTC
Thanks for the work on the Fedora package, all looks good here. There is a separate process for the inclusion in RHEL and it has already been started. Thomas will be tracking it from the IBM side.


Note You need to log in before you can comment on or make changes to this bug.