Bug 2154218 - Review Request: harec - Hare compiler
Summary: Review Request: harec - Hare compiler
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Timothée Floure
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2154506 (view as bug list)
Depends On:
Blocks: 2154514
TreeView+ depends on / blocked
 
Reported: 2022-12-16 10:08 UTC by Benson Muite
Modified: 2022-12-30 08:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-30 08:34:49 UTC
Type: Bug
Embargoed:
timothee.floure: fedora-review+


Attachments (Terms of Use)

Description Benson Muite 2022-12-16 10:08:13 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-x86_64/05148431-harec/harec.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-x86_64/05148431-harec/harec-0%5Egita1aa5039-0.fc38.src.rpm

Fedora Account System Username: fed500

Description: This is a Hare compiler written in C11 for POSIX-compatible systems.


One of the dependencies required for Hare https://harelang.org/installation/

Comment 1 Benson Muite 2022-12-17 11:11:36 UTC
*** Bug 2154506 has been marked as a duplicate of this bug. ***

Comment 2 Timothée Floure 2022-12-19 09:01:13 UTC
Package Review
==============

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

* Can you include the content of the docs/ directory?
* Please add the following before your call to configure, as these flags do not
  seem to be evaluated afterwards:

	export CFLAGS='%{optflags}'
	export LDFLAGS='%{build_ldflags}'

* Please replace your call to configure with the following:

	# Note: we do not use the configure macro since it set some flags which are not
	# supported by upstream's script.
	./configure \
	    --prefix=%{_prefix} \
	    --bindir=%{_bindir} \
	    --sysconfdir=%{_sysconfdir} \
	    --libdir=%{_libdir} \
	    --mandir=%{_mandir}

* I would suggest to use the '<date>.<revision>' versioning scheme (as per
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots)
  to have both human-readable and sort-able verions.
* I'd also use the new %autochangelog macro to generate the changelog from git
  history, once imported in dist-git (see
  https://fedoraproject.org/wiki/Changes/rpmautospec#The_%autochangelog_macro).
* It's mostly cosmetic, but could you set the summary to 'Hare bootstrap
  compiler'? It would be less confusing so - harec is not intended for
  production use.


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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

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: "Unknown or generated", "*No copyright* Mozilla Public License
     2.0". 144 files have unknown license. Detailed output of licensecheck
     in /home/fnux/2154218-harec/licensecheck.txt
[-]: License file installed when any subpackage combination is installed.
[!]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[!]: 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.
[-]: 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.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[-]: 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 10240 bytes in 1 files.
[!]: 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]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[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]: 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).
[x]: 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.
[x]: %check is present and all tests pass.
[-]: 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]: Fully versioned dependency in subpackages if applicable.
[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.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== 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.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
[...]

harec.x86_64: W: position-independent-executable-suggested /usr/bin/harec
harec.x86_64: W: no-manual-page-for-binary harec
harec.x86_64: W: incoherent-version-in-changelog 0^gita1aa5039-1 ['0^gita1aa5039-0.fc38', '0^gita1aa5039-0']
harec.spec:26: W: configure-without-libdir-spec

Comment 3 Benson Muite 2022-12-19 18:33:19 UTC
Thanks for your suggestions. Will use regular changelog for now.

Updated call to configure as suggested.

Have used <date><scm><revision>. Hope that is ok.

The default flags seem to be added according to the build log:
https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-aarch64/05155824-harec/builder-live.log.gz

but maybe am missing the reason for adding: 

export CFLAGS='%{optflags}'
export LDFLAGS='%{build_ldflags}'

The ldflags change in particular prevents the build from completing.

The warning position-independent-executable-suggested does not appear:
https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-aarch64/05155824-harec/fedora-review/review.txt

Can update to a later commit.

spec: https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-aarch64/05155824-harec/harec.spec
srpm: https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-rawhide-aarch64/05155824-harec/harec-0%5E20221126gita1aa5039-2.fc38.src.rpm

Comment 4 Timothée Floure 2022-12-21 14:28:59 UTC
> The default flags seem to be added according to the build log:
> https://download.copr.fedorainfracloud.org/results/fed500/harec/fedora-
> rawhide-aarch64/05155824-harec/builder-live.log.gz

They are added to the %build section, while this specific configure script evaluate them in the %prep section (they're written to .build/config.mk, which is then used by the makefile in %build - environment set in %build is ignored).

> but maybe am missing the reason for adding: 
> 
> export CFLAGS='%{optflags}'
> export LDFLAGS='%{build_ldflags}'
> 
> The ldflags change in particular prevents the build from completing.

It builds on both F37 [1] and rawhide [2] - I'd rather use the current and future Fedora build flags rather than manually pick -fPIE so that rpmlint is happy.

[1] https://koji.fedoraproject.org/koji/taskinfo?taskID=95589739
[2] https://koji.fedoraproject.org/koji/taskinfo?taskID=95589451

Comment 6 Timothée Floure 2022-12-22 18:52:03 UTC
Yes, since these flags are set in %build by default. Ideally, I would like to propose a patch to upstream so that these flags are also evaluated at build time.

I don't understand why you don't want to follow my recommendation, though. The configure stage belongs to the prep section for me - I want it there before I accept this review. My proposition is the following:

Spec URL: https://paste.sr.ht/blob/a93621d391ed73a7043e7a48f51edf89d69ea9d3
SPRM URL: https://kojipkgs.fedoraproject.org//work/tasks/4049/95614049/harec-0%5E20221126gita1aa5039-4.fc38.src.rpm

Do you have anything against it? Sorry for the nitpicking.

Comment 7 Fabio Valentini 2022-12-22 19:01:24 UTC
Note that calling stuff like configure will likely be forbidden by Packaging Guidelines in the near future: https://pagure.io/packaging-committee/issue/1159

Comment 8 Fabio Valentini 2022-12-22 19:02:12 UTC
*calling stuff like configure *in %prep* (sorry, copy-paste issue)

Comment 9 Timothée Floure 2022-12-22 19:30:54 UTC
Oh, I think mostly/always saw configure in prep - my bad! Thanks for the tip, Fabio. We're good, then.

Comment 11 Kevin Fenzi 2022-12-24 00:56:32 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/harec


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