Bug 2398191

Summary: Review Request: checkmake - Linter/analyzer for Makefiles
Product: [Fedora] Fedora Reporter: W. Michael Petullo <mike>
Component: Package ReviewAssignee: Mikel Olasagasti Uranga <mikel>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: madam, mikel, package-review
Target Milestone: ---Flags: mikel: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-09-29 02:13:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description W. Michael Petullo 2025-09-25 16:01:20 UTC
Spec URL: https://www.flyn.org/SRPMS/checkmake.spec
SRPM URL: https://www.flyn.org/SRPMS/checkmake-0.2.2-1.fc43.src.rpm
Description: Linter/analyzer for Makefiles
Fedora Account System Username: mikep

Comment 1 Fedora Review Service 2025-09-25 16:03:27 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/9601075
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2398191-checkmake/fedora-rawhide-x86_64/09601075-checkmake/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 2 W. Michael Petullo 2025-09-25 16:14:48 UTC
I patched out the use of git in checkmate's Makefile, since using git to gather a name and email address in the context of the Fedora build system does not work.

Comment 3 Mikel Olasagasti Uranga 2025-09-25 21:32:30 UTC
> Patch0:         checkmake-0.2.2-remove-git-from-makefile.patch
> (...)
> make

You could just skip this and export GO_LDFLAGS and use regular %gobuild. Something like:

export GO_LDFLAGS="-X main.version=%{version} \
                   -X main.buildTime=$(date -u -d@$SOURCE_DATE_EPOCH +"%Y-%m-%dT%H:%M:%SZ") \
                   -X main.builder=Fedora"
%gobuild -o %{gobuilddir}/bin/checkmake ./cmd/checkmake

The main.goversion GO_LDFLAG would be missing in that proposal, but I don't have time at the moment to check the correct way to set it.

You would miss the pandoc part, but would to manually run this Makefile rule:

%.1: man/man1/%.1.md
	sed "s/REPLACE_DATE/$(BUILDDATE)/" $< | pandoc -s -t man -o $@

> %doc man/man1/checkmake.1.md

If you require pandoc to create the manpage, it would make sense to install it and not the md file

Comment 4 W. Michael Petullo 2025-09-25 23:53:24 UTC
Spec URL: https://www.flyn.org/SRPMS/checkmake.spec
SRPM URL: https://www.flyn.org/SRPMS/checkmake-0.2.2-1.fc43.src.rpm

Adjusted according to Mikel's suggestions.

Comment 5 Fedora Review Service 2025-09-25 23:57:28 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/9601952
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2398191-checkmake/fedora-rawhide-x86_64/09601952-checkmake/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 6 Michael Adam 2025-09-26 10:59:01 UTC
(In reply to W. Michael Petullo from comment #2)
> I patched out the use of git in checkmate's Makefile, since using git to
> gather a name and email address in the context of the Fedora build system
> does not work.


Right, good observation:  this anti-pattern generally breaks the build from release tarballs instead of building from a git checkout.
To make things worse, git is additionally   used to determine the version.


The upstream Makefile should be changed to work outside a git checkout.

Comment 7 Michael Adam 2025-09-26 11:04:13 UTC
 (In reply to W. Michael Petullo from comment #4)
> Spec URL: https://www.flyn.org/SRPMS/checkmake.spec
> SRPM URL: https://www.flyn.org/SRPMS/checkmake-0.2.2-1.fc43.src.rpm
> 
> Adjusted according to Mikel's suggestions.


Trying to locally rebuild fails and I see this:


RPM build warnings:
    File listed twice: /usr/share/licenses/checkmake

RPM build errors:
    Empty %files file /home/obnox/rpmbuild/BUILD/checkmake-0.2.2-build/checkmake-0.2.2/debugsourcefiles.list

Comment 8 Michael Adam 2025-09-26 11:40:44 UTC
(In reply to Michael Adam from comment #7)
> Trying to locally rebuild fails and I see this:
> 
> 
> RPM build warnings:
>     File listed twice: /usr/share/licenses/checkmake
> 
> RPM build errors:
>     Empty %files file
> /home/obnox/rpmbuild/BUILD/checkmake-0.2.2-build/checkmake-0.2.2/
> debugsourcefiles.list


This failure only happens when I use rpmbuild directly.

running 'mock --rebuild',  it builds just fine.

And the resulting rpm installs and works without problems.

Comment 9 Mikel Olasagasti Uranga 2025-09-28 09:36:40 UTC
Golang Package Review
==============

This package was generated using go2rpm and Go Vendor Tools, which simplifies
the review.

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


- [x] The latest version is packaged or packaging an earlier version is justified.
- [x] The License tag reflects the package contents and uses the correct identifiers.
- [x] The package builds successfully in mock.
- [x] Package is installable (checked by fedora-review).
- [x] There are no relevant rpmlint errors.
- [x] The package runs tests in %check.
- [x] `%goipath` is set correctly.
- [x] The package's binaries don't conflict with binaries already in the distribution. (Some Go projects include utility binaries with very generic names)
- [x] There are no `%{_bindir}/*` wildcards in %files. (go2rpm includes these by default)
- [x] The package does not use `%gometa -f` if it has dependents that still build for %ix86.
- [x] The package complies with the Golang and general Packaging Guidelines.
- [x] GO_LDFLAGS are set correctly.

Package approved! On import, don't forget to do the following:

- [ ] Add the package to release-monitoring.org
- [ ] Give go-sig privileges (at least commit) on the package
- [ ] Close the review bug by referencing its ID in the rpm changelog and the Bodhi ticket.
- [ ] Consider configuring Packit service to help with maintenance

Comment 10 Fedora Admin user for bugzilla script actions 2025-09-29 01:56:11 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/checkmake

Comment 11 Fedora Update System 2025-09-29 02:10:03 UTC
FEDORA-2025-93a7121cfc (checkmake-0.2.2-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-93a7121cfc

Comment 12 Fedora Update System 2025-09-29 02:13:30 UTC
FEDORA-2025-93a7121cfc (checkmake-0.2.2-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.