Bug 2176342 - Review Request: yggdrasil-worker-package-manager - Package manager worker for yggdrasil
Summary: Review Request: yggdrasil-worker-package-manager - Package manager worker for...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mark E. Fuller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2176241
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-08 02:36 UTC by Link Dupont
Modified: 2023-06-20 17:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-20 17:42:06 UTC
Type: ---
Embargoed:
mark.e.fuller: fedora-review+


Attachments (Terms of Use)

Description Link Dupont 2023-03-08 02:36:38 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/linkdupont/reviews/fedora-rawhide-x86_64/05604871-yggdrasil-worker-package-manager/yggdrasil-worker-package-manager.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/linkdupont/reviews/fedora-rawhide-x86_64/05604871-yggdrasil-worker-package-manager/yggdrasil-worker-package-manager-0.2.0-1.fc39.src.rpm
Description: yggdrasil-worker-package-manager is a simple package manager yggd worker. It knows how to install and remove packages, add, remove, enable and disable repositories, and does rudimentary detection of the host it is running on to guess the package manager to use. It only installs packages that match one of the provided allow-pattern regular expressions.
Fedora Account System Username: linkdupont
Fedora review: https://download.copr.fedorainfracloud.org/results/linkdupont/reviews/fedora-rawhide-x86_64/05604871-yggdrasil-worker-package-manager/fedora-review/review.txt

Comment 2 Jiri Hnidek 2023-03-14 10:05:45 UTC
Why do you specify build dependencies for dbus-devel package using this?

BuildRequires:  pkgconfig(dbus-1)

Why don't you use just this?

BuildRequires:  dbus-devel


When I tried to build binary RPM from the latest spec file and src.rpm, then I got following errors:


[jhnidek@thinkpad-p1 SPECS]$ rpmbuild -bb ./yggdrasil-worker-package-manager.spec 
setting SOURCE_DATE_EPOCH=1678752000
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.MlEfRr
+ umask 022
+ cd /home/jhnidek/rpmbuild/BUILD
+ cd /home/jhnidek/rpmbuild/BUILD
+ rm -rf yggdrasil-worker-package-manager-0.2.0
+ /usr/lib/rpm/rpmuncompress -x /home/jhnidek/rpmbuild/SOURCES/yggdrasil-worker-package-manager-0.2.0.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd yggdrasil-worker-package-manager-0.2.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ rm -fr /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/vendor
+ [[ ! -e /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/bin ]]
+ install -m 0755 -vd /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/bin
install: creating directory '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build'
install: creating directory '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/bin'
+ export GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build:/usr/share/gocode
+ GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build:/usr/share/gocode
+ [[ ! -e /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights/yggdrasil-worker-package-manager ]]
++ dirname /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights/yggdrasil-worker-package-manager
+ install -m 0755 -vd /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights
install: creating directory '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src'
install: creating directory '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com'
install: creating directory '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights'
+ ln -fs /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0 /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights/yggdrasil-worker-package-manager
+ cd /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/src/github.com/redhatinsights/yggdrasil-worker-package-manager
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.yWi6Ld
+ umask 022
+ cd /home/jhnidek/rpmbuild/BUILD
+ cd yggdrasil-worker-package-manager-0.2.0
+ GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build:/usr/share/gocode
+ GO111MODULE=off
+ golist --imported --package-path github.com/redhatinsights/yggdrasil-worker-package-manager --template 'golang({{.}})\n' --with-tests --skip-self
+ RPM_EC=0
++ jobs -p
+ exit 0
error: Failed build dependencies:
	golang(git.sr.ht/~spc/go-log) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/google/uuid) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/peterbourgon/ff/v3) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/peterbourgon/ff/v3/fftoml) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/redhatinsights/yggdrasil/ipc) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/redhatinsights/yggdrasil/worker) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/sgreben/flagvar) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
	golang(github.com/zcalusic/sysinfo) is needed by yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
Wrote: /home/jhnidek/rpmbuild/SRPMS/yggdrasil-worker-package-manager-0.2.0-1.fc37.buildreqs.nosrc.rpm

Comment 3 Link Dupont 2023-03-14 15:55:47 UTC
(In reply to Jiri Hnidek from comment #2)
> Why do you specify build dependencies for dbus-devel package using this?
> 
> BuildRequires:  pkgconfig(dbus-1)
> 
> Why don't you use just this?
> 
> BuildRequires:  dbus-devel

Current Fedora packaging guidelines prefer using pkg-config BuildRequires: https://docs.fedoraproject.org/en-US/packaging-guidelines/PkgConfigBuildRequires/. In addition, the rationale given in the "Rationale" section in the guidelines is accurate for this package.

> When I tried to build binary RPM from the latest spec file and src.rpm, then
> I got following errors:
> 
> 
> [jhnidek@thinkpad-p1 SPECS]$ rpmbuild -bb
> ./yggdrasil-worker-package-manager.spec 
> setting SOURCE_DATE_EPOCH=1678752000
> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.MlEfRr
> + umask 022
> + cd /home/jhnidek/rpmbuild/BUILD
> + cd /home/jhnidek/rpmbuild/BUILD
> + rm -rf yggdrasil-worker-package-manager-0.2.0
> + /usr/lib/rpm/rpmuncompress -x
> /home/jhnidek/rpmbuild/SOURCES/yggdrasil-worker-package-manager-0.2.0.tar.gz
> + STATUS=0
> + '[' 0 -ne 0 ']'
> + cd yggdrasil-worker-package-manager-0.2.0
> + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
> + rm -fr
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/vendor
> + [[ ! -e
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> bin ]]
> + install -m 0755 -vd
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> bin
> install: creating directory
> '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build'
> install: creating directory
> '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> bin'
> + export
> GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/
> _build:/usr/share/gocode
> +
> GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/
> _build:/usr/share/gocode
> + [[ ! -e
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights/yggdrasil-worker-package-manager ]]
> ++ dirname
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights/yggdrasil-worker-package-manager
> + install -m 0755 -vd
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights
> install: creating directory
> '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src'
> install: creating directory
> '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com'
> install: creating directory
> '/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights'
> + ln -fs /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights/yggdrasil-worker-package-manager
> + cd
> /home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/_build/
> src/github.com/redhatinsights/yggdrasil-worker-package-manager
> + RPM_EC=0
> ++ jobs -p
> + exit 0
> Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.yWi6Ld
> + umask 022
> + cd /home/jhnidek/rpmbuild/BUILD
> + cd yggdrasil-worker-package-manager-0.2.0
> +
> GOPATH=/home/jhnidek/rpmbuild/BUILD/yggdrasil-worker-package-manager-0.2.0/
> _build:/usr/share/gocode
> + GO111MODULE=off
> + golist --imported --package-path
> github.com/redhatinsights/yggdrasil-worker-package-manager --template
> 'golang({{.}})\n' --with-tests --skip-self
> + RPM_EC=0
> ++ jobs -p
> + exit 0
> error: Failed build dependencies:
> 	golang(git.sr.ht/~spc/go-log) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/google/uuid) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/peterbourgon/ff/v3) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/peterbourgon/ff/v3/fftoml) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/redhatinsights/yggdrasil/ipc) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/redhatinsights/yggdrasil/worker) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/sgreben/flagvar) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> 	golang(github.com/zcalusic/sysinfo) is needed by
> yggdrasil-worker-package-manager-0.2.0-1.fc37.x86_64
> Wrote:
> /home/jhnidek/rpmbuild/SRPMS/yggdrasil-worker-package-manager-0.2.0-1.fc37.
> buildreqs.nosrc.rpm

If you're going to build the RPM locally using rpmbuild, you'll need to manually install the build requirements first. You can express the installation requirement to dnf in the form of the golang() pattern like so: dnf install 'golang(git.sr.ht/~spc/go-log)', and the RPM that Provides: that pattern will be resolved to by dnf. I suggest building the RPM using `mock` or `fedpkg` though; it will resolve the build requirements for you automatically and install them into the buildroot, rather than onto your local host directly.

Currently, this package is still blocked by the inclusion of golang(github.com/zcalusic/sysinfo). That RPM is still under review in RHBZ#2176241. If you want to test building this RPM, you'll need to install golang-github-zcalusic-sysinfo-devel from my COPR for the time being. https://copr.fedorainfracloud.org/coprs/linkdupont/reviews/build/5641494/

Comment 4 Jiri Hnidek 2023-03-29 17:41:43 UTC
OK, when I built and installed github-zcalusic-sysinfo-devel to the mock environment, then I can approve that it was possible to build RPM from source RPM of yggdrasil-worker-package-manager

mock -r fedora-39-x86_64 --rebuild ./golang-github-zcalusic-sysinfo-0.9.5-1.fc38.src.rpm

mock --no-clean -r fedora-39-x86_64 --install /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/RPMS/golang-github-zcalusic-sysinfo-devel-0.9.5-1.fc39.noarch.rpm

mock --no-clean -r fedora-39-x86_64 --rebuild ./yggdrasil-worker-package-manager-0.2.0-1.fc39.src.rpm

Comment 6 Mark E. Fuller 2023-06-11 17:33:55 UTC
I'm unfamiliar with this header on the spec file - you mind explaining why it's necessary?:

## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

also, I would recommend using %autochangelog, but that can be personal preference

Nothing else jumps out at me - here's the formal review checklist:

Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. Licenses found: "Unknown or generated". 17 files
     have unknown license. Detailed output of licensecheck in
     /var/lib/copr-rpmbuild/results/yggdrasil-worker-package-
     manager/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/share/dbus-1/system-
     services, /usr/share/dbus-1
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[x]: Reviewer should test that the package builds in mock.
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in golang-
     github-redhatinsights-yggdrasil-worker-package-manager-devel
[ ]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[ ]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[ ]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[ ]: Packages should try to preserve timestamps of original installed
     files.
[ ]: Spec use %global instead of %define unless justified.
     Note: %define requiring justification: %define autorelease(e:s:pb:n)
     %{?-p:0.}%{lua:
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.



Rpmlint is clean

Comment 7 Link Dupont 2023-06-20 17:07:58 UTC
(In reply to Mark E. Fuller from comment #6)
> I'm unfamiliar with this header on the spec file - you mind explaining why
> it's necessary?:
> 
> ## START: Set by rpmautospec
> ## (rpmautospec version 0.3.5)
> ## RPMAUTOSPEC: autorelease, autochangelog
> %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
>     release_number = 1;
>     base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
>     print(release_number + base_release_number - 1);
> }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
> ## END: Set by rpmautospec
> 
> also, I would recommend using %autochangelog, but that can be personal
> preference
> 

It's the content that gets inserted into the spec file by the %autorelease macro. If you look at the spec file https://linkdupont.fedorapeople.org/yggdrasil-worker-package-manager.spec, you can see it uses both %autorelease and %autochangelog. Since those macros are srpm macros (not rpm macros), they operate on the spec file that generates the src.rpm. The spec file that will live in dist-git is the one that uses %autorelease and %autochangelog.

Comment 8 Fedora Admin user for bugzilla script actions 2023-06-20 17:08:49 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/yggdrasil-worker-package-manager

Comment 9 Fedora Update System 2023-06-20 17:41:49 UTC
FEDORA-2023-8ededddb01 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-8ededddb01

Comment 10 Fedora Update System 2023-06-20 17:42:06 UTC
FEDORA-2023-8ededddb01 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


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