Bug 2142363 - Review Request: zig-srpm-macros - RPM macros for building Zig packages
Summary: Review Request: zig-srpm-macros - RPM macros for building Zig packages
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Benson Muite
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2142334
TreeView+ depends on / blocked
 
Reported: 2022-11-13 12:29 UTC by Jan Drögehoff
Modified: 2025-01-23 10:42 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-01-23 10:42:22 UTC
Type: Bug
Embargoed:
benson_muite: fedora-review+


Attachments (Terms of Use)

Comment 1 Benson Muite 2023-06-22 07:54:13 UTC
Package Review
==============

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



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

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[ ]: 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.
[ ]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. No licenses found. Please check the source files for
     licenses manually.
[ ]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/lib/rpm/macros.d,
     /usr/lib/rpm
[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.
[-]: Development files must be in a -devel package
[ ]: Package uses nothing in %doc for runtime.
[ ]: Package consistently uses macros (instead of hard-coded directory
     names).
[ ]: 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.
[-]: Package contains systemd file(s) if in need.
[ ]: Package is not known to require an ExcludeArch tag.
[ ]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[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]: 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]: 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]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

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

Generic:
[!]: 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).
[ ]: Package functions as described.
[ ]: 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.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[ ]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[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]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: zig-srpm-macros-1-1.fc39.noarch.rpm
          zig-srpm-macros-1-1.fc39.src.rpm
======================================================= rpmlint session starts =======================================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpjgceaw0q')]
checks: 31, packages: 2

zig-srpm-macros.noarch: W: only-non-binary-in-usr-lib
zig-srpm-macros.noarch: W: no-documentation
zig-srpm-macros.spec: W: no-%build-section
======================== 2 packages and 0 specfiles checked; 0 errors, 3 warnings, 0 badness; has taken 1.2 s ========================




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 1

zig-srpm-macros.noarch: W: only-non-binary-in-usr-lib
zig-srpm-macros.noarch: W: no-documentation
 1 packages and 0 specfiles checked; 0 errors, 2 warnings, 0 badness; has taken 0.1 s 



Requires
--------
zig-srpm-macros (rpmlib, GLIBC filtered):



Provides
--------
zig-srpm-macros:
    rpm_macro(zig_arches)
    zig-srpm-macros



Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review -b 2142363
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic
Disabled plugins: Ocaml, PHP, Perl, Python, C/C++, R, Haskell, Ruby, Java, fonts, SugarActivity
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comments:
a) Can the source be put on Pagure or some other forge? See for example:
https://pagure.io/go-rpm-macros/blob/master/f/rpm/macros.d/macros.go-srpm
Python and Lua seems not to use another forge:
https://src.fedoraproject.org/rpms/python-rpm-macros
https://src.fedoraproject.org/rpms/lua-rpm-macros
b) Please add a license file
c) Can %{_rpmmacrodir} be used instead of %{_rpmconfigdir}/macros.d ?
d) Maybe the name should just be zig-rpm-macros with the srpm marcos as a subpackage?

Comment 2 Jan Drögehoff 2023-06-23 17:33:51 UTC
(In reply to Benson Muite from comment #1)
> Comments:
> a) Can the source be put on Pagure or some other forge? See for example:
> https://pagure.io/go-rpm-macros/blob/master/f/rpm/macros.d/macros.go-srpm
> Python and Lua seems not to use another forge:
> https://src.fedoraproject.org/rpms/python-rpm-macros
> https://src.fedoraproject.org/rpms/lua-rpm-macros

the plan was to put it on src.fedoraproject.org, like python and lua do it.
But for that I'd need the package approved so I can put in the request.

> b) Please add a license file

With the answer to a) this would implicitly put all macros under MIT (just like the python macros), but I can add one explicitly if thats desired.

> c) Can %{_rpmmacrodir} be used instead of %{_rpmconfigdir}/macros.d ?
Can do

> d) Maybe the name should just be zig-rpm-macros with the srpm marcos as a
> subpackage?

That would probably be better, I'll have to work out which macro would be best for each package.

Comment 3 Benson Muite 2023-06-23 17:58:59 UTC
Had not seen:
https://bugzilla.redhat.com/show_bug.cgi?id=2142334
Suggests separate srpm macros, not sure if a sub package with no main package dependency would work.

Comment 4 Aleksei Bavshin 2023-10-24 05:40:13 UTC
(In reply to Jan Drögehoff from comment #2)
> > b) Please add a license file
> 
> With the answer to a) this would implicitly put all macros under MIT (just
> like the python macros), but I can add one explicitly if thats desired.
 
MIT requires that the copyright notice is always distributed along with the sources. This might not be always enforced, but it is the right thing to do.
lua-rpm-macros and pyproject-rpm-macros are good recent examples.

> > d) Maybe the name should just be zig-rpm-macros with the srpm marcos as a
> > subpackage?
> 
> That would probably be better, I'll have to work out which macro would be
> best for each package.

IMO, it would be more convenient to keep the %zig_build family of macros along with the compiler package and lock the versions (e.g. do `Requires: (zig-rpm-macros = %{version} if zig-rpm-macros)` in the main `zig` package). As 0.11.0 has shown, these macros may require backward-incompatible changes.
Nonetheless, a standalone zig-rpm-macros package is totally safe with a correct versioning and dependencies. So that's just a matter of your preference.

BTW, %_zig_version is the only macro definition that actually requires data from zig.spec, and I'm not sure if it is even useful.

(In reply to Benson Muite from comment #3)
> not sure if a sub package with no main package dependency would work.

Subpackage of `zig` is probably not a good idea for the reasons already explained in bug2142334. Subpackage of a potential `zig-rpm-macros` should be fine.

Comment 5 Jan Drögehoff 2023-10-24 18:04:50 UTC
> MIT requires that the copyright notice is always distributed along with the
> sources. This might not be always enforced, but it is the right thing to do.
> lua-rpm-macros and pyproject-rpm-macros are good recent examples.

Yeah, thats reasonable, didn't think about that.


> IMO, it would be more convenient to keep the %zig_build family of macros
> along with the compiler package and lock the versions (e.g. do `Requires:
> (zig-rpm-macros = %{version} if zig-rpm-macros)` in the main `zig` package).
> As 0.11.0 has shown, these macros may require backward-incompatible changes.
> Nonetheless, a standalone zig-rpm-macros package is totally safe with a
> correct versioning and dependencies. So that's just a matter of your
> preference.

agreed.
The only thing that is really needed for srpm generator is the exclusive arches
and to make it easier for maintainers a build-only runtime dependency can be added
Requires: (zig-rpm-macros = %{version}-%{release} if rpm-build)

> BTW, %_zig_version is the only macro definition that actually requires data
> from zig.spec, and I'm not sure if it is even useful.

Its probably best to remove it until a use case is found.

Comment 6 Jan Drögehoff 2023-10-24 18:33:13 UTC
rewrote the spec to be similar to other existing (s)rpm-macro packages.
also added a little note to the srpm macro. Others do it and I see no harm in it

copr doesn't store a copy of the spec or srpm in the build root anymore so I moved them to my own server as a short-term workaround

Spec URL: https://files.jandroegehoff.de/fedora/zig-srpm-macros-1-1/zig-srpm-macros.spec
SRPM URL: https://files.jandroegehoff.de/fedora/zig-srpm-macros-1-1/zig-srpm-macros-1-1.fc38.src.rpm

Comment 7 Fedora Review Service 2023-10-25 02:32:18 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6563215
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2142363-zig-srpm-macros/srpm-builds/06563215/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 8 Jan Drögehoff 2023-10-25 06:28:08 UTC
Odd, builds just fine on my copr https://copr.fedorainfracloud.org/coprs/sentry/zig/build/6563667/

Lets try that again [fedora-review-service-build]

Comment 9 Fedora Review Service 2023-10-25 06:35:39 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6563676
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2142363-zig-srpm-macros/fedora-rawhide-x86_64/06563676-zig-srpm-macros/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 10 Jan Drögehoff 2023-11-04 11:27:31 UTC
Checked over the above review template and outside "Reviewer should test in mock" being erroneously marked as failed all seems good.

@benson_muite all your comments appear to be addressed, could you do another review?

Comment 11 Benson Muite 2023-11-10 05:27:49 UTC
Thanks for updating this. Will need a couple more days.

Comment 12 Benson Muite 2023-11-27 17:55:42 UTC
Package Review
==============

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



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

Generic:
[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: Checking patched sources after %prep for licenses. Licenses
     found: "*No copyright* MIT License", "Unknown or generated". 1 files
     have unknown license. Detailed output of licensecheck in
     /home/fedora/2142363-zig-srpm-macros/licensecheck.txt
[!]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/lib/rpm/macros.d,
     /usr/lib/rpm
[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.
[-]: 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.
[!]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[ ]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[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]: The License field must be a valid SPDX expression.
[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]: 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]: 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]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

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

Generic:
[-]: 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).
[ ]: 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.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[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]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: zig-srpm-macros-1-1.fc40.noarch.rpm
          zig-srpm-macros-1-1.fc40.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpgai_tym1')]
checks: 31, packages: 2

zig-srpm-macros.noarch: W: only-non-binary-in-usr-lib
zig-srpm-macros.noarch: W: no-url-tag
zig-srpm-macros.src: W: no-url-tag
zig-srpm-macros.noarch: W: no-documentation
zig-srpm-macros.spec: W: no-%build-section
 2 packages and 0 specfiles checked; 0 errors, 5 warnings, 0 badness; has taken 0.2 s 




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.5.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 1

zig-srpm-macros.noarch: W: only-non-binary-in-usr-lib
zig-srpm-macros.noarch: W: no-url-tag
zig-srpm-macros.noarch: W: no-documentation
 1 packages and 0 specfiles checked; 0 errors, 3 warnings, 3 filtered, 0 badness; has taken 0.0 s 



Requires
--------
zig-srpm-macros (rpmlib, GLIBC filtered):



Provides
--------
zig-srpm-macros:
    rpm_macro(zig_arches)
    zig-srpm-macros



Generated by fedora-review 0.10.0 (e79b66b) last change: 2023-07-24
Command line :/usr/bin/fedora-review -b 2142363
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api
Disabled plugins: Ocaml, fonts, SugarActivity, C/C++, Haskell, Python, Perl, Java, PHP, R
Disabled flags: EXARCH, EPEL6, EPEL7, DISTTAG, BATCH

Comments:
a) Please add
Requires: rpm
to the spec file for directory ownership. Can be done on import.
b) Approved

Comment 13 Fedora Admin user for bugzilla script actions 2023-12-26 20:34:39 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/zig-srpm-macros


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