Bug 2272140 - Review Request: cosmic-term - Terminal emulator for the COSMIC desktop environment
Summary: Review Request: cosmic-term - Terminal emulator for the COSMIC desktop enviro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/pop-os/cosmic-term
Whiteboard:
Depends On:
Blocks: COSMICDesktopPackageReviews
TreeView+ depends on / blocked
 
Reported: 2024-03-29 02:00 UTC by Ryan Brue
Modified: 2025-02-27 03:08 UTC (History)
2 users (show)

Fixed In Version: cosmic-term-1.0.0~alpha.2-1.fc42, cosmic-term-1.0.0~alpha.2-1.fc41
Clone Of:
Environment:
Last Closed: 2025-02-27 03:08:34 UTC
Type: ---
Embargoed:
carl: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 7231032 to 7799159 (4.06 KB, patch)
2024-07-28 16:35 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 8010447 to 8086900 (2.39 KB, patch)
2024-09-28 05:19 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 8086900 to 8095166 (2.85 KB, patch)
2024-10-01 06:17 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 8095166 to 8106705 (693 bytes, patch)
2024-10-04 00:23 UTC, Fedora Review Service
no flags Details | Diff

Comment 4 Carl George 🤠 2024-06-15 00:41:59 UTC
Sorry for the delay in getting to this review.  Here are the improvements I was able to spot so far.

================================================================================

The cargo_install_lib macro is used to prevent %cargo_install from installing library sources.  Since you aren't using %cargo_install, you can remove this macro definition.

================================================================================

Since you're using vendored dependencies, the licenses for your sources is likely the same for your binaries.  In this scenario, you should just omit the SourceLicense tag entirely, as it's purpose is to indicate that the license of the sources differs from the binaries.  I understand this was part of what rust2rpm generated, so I submitted an improvement to not do that in the future.  For now we still need to remove it from this spec file.

https://pagure.io/fedora-rust/rust2rpm/pull-request/277

================================================================================

The package is installing a .desktop file, but isn't installing it with desktop-file-install or running desktop-file-validate on it during %check.  Since this is being put in place by the justfile, the latter approach of validating would be a cleaner solution.

    desktop-file-validate %{buildroot}%{_datadir}/applications/com.system76.CosmicTerm.desktop

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_desktop_file_install_usage

================================================================================

Minor style thing, you are defining a ver macro, but it's only used in one place.  I personally would avoid the macro and just use the value directly.

================================================================================

Your snapshot notation in the Version tag is not correct per the guidelines.  You are correct to use a tilde to sort lower than 0.1.0 (in case upstream releases the first version as 0.1.0) but the snapshot information must also start with a caret.  Your commitdate is also too long, it should be in the YYYYMMDD format.  If you want to keep the date and SCM type, the date must come first.  Alternatively, you can drop the date and just use an integer that you increment each time you do a new snapshot.  Personally, I find the integer approach more appealing, since it gives you simple control of the sorting without overloading the version with extra information.  The date and SCM type simply aren't relevant for upgrade path sorting.  Here are some examples you could use that follow the guidelines (macros expanded for clarity).

    0.1.0~^20240529.634a247
    0.1.0~^20240529git634a247
    0.1.0~^1.634a247           <-- my favorite for simplicity
    0.1.0~^1.git634a247

https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots

================================================================================

You are using a mix of unnumbered and numbered sources.  For predictability and to avoid accidentally reusing a number, I would stick with one style or the other.

================================================================================

You have a build requirement on git-core, but I don't see that used anywhere in the spec file, or in the upstream justfile.  If this is just for creation of the vendor tarball, you can leave it out as that takes place outside of the build process.

================================================================================

%cargo_prep accepts a -v flag to specfiy the vendor directory, but it isn't being used here.  I'm not sure how this is working without that, but I know the rust guidelines are fairly new so this might not be a problem.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_using_vendor_tarballs

================================================================================

It's probably overkill to list out every icon in %files.  This would be an appropriate use of a wildcard, which will also prevent build failures if upstream adds more resolutions.

%{_datadir}/icons/hicolor/*/apps/com.system76.CosmicTerm.svg

It's also a bit weird that upstream is installing svgs in these directories.  Most applications use pngs of the stated resolution, and place their svg in a scalable directory.  This is probably worth bringing to upstream's attention, but isn't a blocker for the review.

================================================================================

Speaking of the icon files, they are resulting in unowned directories.  These directories are provided by the hicolor-icon-theme package, so the easiest fix is to just add a requires on that package.

https://docs.fedoraproject.org/en-US/packaging-guidelines/UnownedDirectories/

================================================================================

One more optional stylistic tip, you're using the string com.system76.CosmicTerm quite a bit.  That is something called reverse domain name notation.  In my spec files I'll usually define an rdnn macro at the top of the spec file, then use %{rdnn} for each instance instead of typing out the full thing.  That also helps if upstream ever changes that string (unlikely, but quite possible).

https://en.wikipedia.org/wiki/Reverse_domain_name_notation
https://src.fedoraproject.org/rpms/butt/blob/rawhide/f/butt.spec


================================================================================

There are a few rpmlint errors/warnings that should be clearable.

cosmic-term.spec:76: W: macro-in-comment %{SOURCE2}
cosmic-term.spec:80: W: macro-in-comment %{SOURCE2}

You can resolve these by using a double percent sign to "escape" the macro.

================================================================================

cosmic-term.x86_64: E: invalid-desktopfile /usr/share/applications/com.system76.CosmicTerm.desktop value "COSMIC;System;TerminalEmulator;" for key "Categories" in group "Desktop Entry" contains an unregistered value "COSMIC"; values extending the format should start with "X-"

It seems like you can fix this one by patching the .desktop file to change COSMIC to X-COSMIC.  That would also be a good patch to send upstream.

================================================================================

cosmic-term.x86_64: W: unused-direct-shlib-dependency /usr/bin/cosmic-term /lib64/libxkbcommon.so.0
cosmic-term-debugsource.x86_64: E: files-duplicated-waste 841807

I actually don't know how to resolve these two for a rust application.  It would be worth bringing up in the Fedora Rust Matrix channel to see if there is a known way to resolve them.

https://docs.fedoraproject.org/en-US/package-maintainers/CommonRpmlintIssues/#unused_direct_shlib_dependency

Comment 6 Fedora Review Service 2024-07-28 16:35:46 UTC
Created attachment 2040651 [details]
The .spec file difference from Copr build 7231032 to 7799159

Comment 7 Fedora Review Service 2024-07-28 16:35:48 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/7799159
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2272140-cosmic-term/fedora-rawhide-x86_64/07799159-cosmic-term/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
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 Carl George 🤠 2024-08-05 04:19:04 UTC
The guidelines state that the desktop file must be validated.  Only validating on Fedora releases higher than 40 is insufficient.  Instead of conditionalizing the check, it would be better to just set the minimum version of desktop-file-utils required to build.

    BuildRequires:  desktop-file-utils >= 0.27-2

If you really need to ship this package on Fedora 40, and you don't think the desktop-file-utils maintainer will backport the category there, then you could instead use a condition in %install to modify the desktop file with desktop-file-install to make it compliant.

    %if %{defined fedora} && 0%{?fedora} < 41
    desktop-file-install \
        --remove-category COSMIC \
        --add-category X-COSMIC \
        --delete-original \
        --dir %{buildroot}%{_datadir}/applications \
        %{buildroot}%{_datadir}/applications/com.system76.CosmicTerm.desktop
    %endif

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_desktop_file_install_usage

================================================================================

Your snapshot notation is still not quite right.  The guidelines state that the first part can be either the date as YYYYMMDD or a simple number.  You have the commitdate macro in the format of YYYYMMDD.HHMMSS, which is not permitted.  My guess is that you wanted to include this to ensure proper sorting if you had to release multiple upstream snapshots in one day.  If that is a concern, then it would be better to just switch to using the simple number approach.  Each time you take a snapshot from upstream you would just increase the integer.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots

================================================================================

I see you switched to using a URL for Source0.  There is a recommend format in the guidelines that should be used.

Source0:        https://github.com/pop-os/cosmic-term/archive/%{commit}/cosmic-term-%{shortcommit}.tar.gz

https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_commit_revision

I would also recommend including the shortcommit in the filename of Source1.  The contents of that archive is likely to change with each new version/snapshot, and it will be confusing for the file name to remain the same.  The lookaside cache technically allows that by storing files in directories named after the file's checksum, but I wouldn't want to rely on that mechanism if I don't have to.

Comment 11 Carl George 🤠 2024-08-07 17:13:57 UTC
The spec file is looking pretty good, but fedora-review flagged an issue.

Source checksums
----------------
https://github.com/pop-os/cosmic-term/archive/be808b56cf24d03fc99cf44b0885078a81a16523/cosmic-term-be808b5.tar.gz :
  CHECKSUM(SHA256) this package     : 1c3e00022b83b969dc075461272b42348643b3528c940f55bbb139bf4305b979
  CHECKSUM(SHA256) upstream package : 24b3a607b4f684dd0006ef9fd33a77ecfcfe0bf32b57c89c14a4fbd499da0afa
diff -r also reports differences

The tarball used in the SRPM has to match the checksum when you download the tarball from that URL.  Did you generate the tarball some other way?

Comment 12 Ryan Brue 2024-08-07 17:22:05 UTC
> The tarball used in the SRPM has to match the checksum when you download the tarball from that URL. Did you generate the tarball some other way?

Yeah, I did. I git cloned the repo, and did the vendoring steps on that cloned repo, and then made a tarball from it. I can modify my script to just reclone it at the end and use that instead of the repo I'm using to generate the vendor stuff

Comment 15 Fedora Review Service 2024-09-12 01:35:19 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8010447
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2272140-cosmic-term/fedora-rawhide-x86_64/08010447-cosmic-term/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
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 17 Fedora Review Service 2024-09-28 05:19:56 UTC
Created attachment 2049236 [details]
The .spec file difference from Copr build 8010447 to 8086900

Comment 18 Fedora Review Service 2024-09-28 05:19:58 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8086900
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2272140-cosmic-term/fedora-rawhide-x86_64/08086900-cosmic-term/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
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 19 Carl George 🤠 2024-09-30 03:24:02 UTC
Now that the version corresponds to an upstream git tag, that should be used for the tarball.

-Source0:        https://github.com/pop-os/cosmic-term/archive/%{commit}/cosmic-term-%{shortcommit}.tar.gz
+Source0:        https://github.com/pop-os/cosmic-term/archive/epoch-%{version_no_tilde}/cosmic-term-%{version_no_tilde}.tar.gz

-%autosetup -n %{crate}-%{commit} -p1 -a1
+%autosetup -n cosmic-term-epoch-%{version_no_tilde} -p1 -a1

================================================================================

The vendor tarball and config can also use the same reference.

-# * cargo vendor > vendor-config-%%{shortcommit}.toml
-# * tar -pczf vendor-%%{shortcommit}.tar.gz vendor
-Source1:        vendor-%{shortcommit}.tar.gz
-# * mv vendor-config-%%{shortcommit}.toml ..
-Source2:        vendor-config-%{shortcommit}.toml
+# * cargo vendor > vendor-config-%%{version_no_tilde}.toml
+# * tar -pczf vendor-%%{version_no_tilde}.tar.gz vendor
+Source1:        vendor-%{version_no_tilde}.tar.gz
+# * mv vendor-config-%%{version_no_tilde}.toml ..
+Source2:        vendor-config-%{version_no_tilde}.toml

================================================================================

The commitdate macro is not being used, and after the changes above the shortcommit macro will not be used either.  They can be removed.  Per our conversation in the chat, building this software still requires setting the VERGEN_GIT_* environment variables, so it makes sense to keep the commit and commitdatestring macros.  To avoid confusion for other packagers that might need to modify this spec file in the future, I recommend adding a comment above those macros explaining why they are needed in spite of using a tag for the version.

+# While our version corresponds to an upstream tag, we still need to define
+# these macros in order to set the VERGEN_GIT_SHA and VERGEN_GIT_COMMIT_DATE
+# environment variables in multiple sections of the spec file.
 %global commit 2e2a2376dfe0c6959e4e7d115f7b7d19405737ad
-%global shortcommit %{sub %{commit} 1 7}
 %global commitdatestring 2024-09-24 09:25:39 -0600
-%global commitdate 20240924

================================================================================

The license string has a few duplicates that need to be combined.

(Apache-2.0 OR MIT)
(Apache-2.0  OR  MIT)
(MIT OR Apache-2.0)

(MIT OR Apache-2.0 OR Zlib)
(MIT OR Zlib OR Apache-2.0)
(Zlib OR Apache-2.0 OR MIT)

It may help to keep this string sorted to keep an eye on duplicates like this.

Comment 21 Fedora Review Service 2024-10-01 06:17:56 UTC
Created attachment 2049748 [details]
The .spec file difference from Copr build 8086900 to 8095166

Comment 22 Fedora Review Service 2024-10-01 06:17:58 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8095166
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2272140-cosmic-term/fedora-rawhide-x86_64/08095166-cosmic-term/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
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 23 Carl George 🤠 2024-10-02 04:20:37 UTC
The license string looks good now.

version_no_tilde is not a macro you need to define yourself, it's part of rust-srpm-macros and the value is derived from the Version tag.  It's useful here because the result is the format of the upstream tag (aside from the epoch- prefix), which should be used directly in the Source0 URL for the tarball instead of the commit.  There is also a cosmic_minver macro defined that isn't being used anywhere I can see.


--- cosmic-term.spec	2024-10-01 23:00:58.451068682 -0500
+++ cosmic-term.spec.new	2024-10-01 23:03:52.112627495 -0500
@@ -9,9 +9,7 @@
 # these macros in order to set the VERGEN_GIT_SHA and VERGEN_GIT_COMMIT_DATE
 # environment variables in multiple sections of the spec file.
 %global commit 2e2a2376dfe0c6959e4e7d115f7b7d19405737ad
-%global version_no_tilde 1.0.0~alpha.2
 %global commitdatestring 2024-09-24 09:25:39 -0600
-%global cosmic_minver 1.0.0~alpha.2
 
 Name:           cosmic-term
 Version:        1.0.0~alpha.2
@@ -22,7 +20,7 @@
 
 URL:            https://github.com/pop-os/cosmic-term
 
-Source0:        https://github.com/pop-os/cosmic-term/archive/%{commit}/cosmic-term-%{version_no_tilde}.tar.gz
+Source0:        https://github.com/pop-os/cosmic-term/archive/epoch-%{version_no_tilde}/cosmic-term-%{version_no_tilde}.tar.gz
 # To create the below sources:
 # * git clone https://github.com/pop-os/cosmic-term at the specified commit
 # * cargo vendor > vendor-config-%%{version_no_tilde}.toml
@@ -48,7 +46,7 @@
 %description %{_description}
 
 %prep
-%autosetup -n %{crate}-%{commit} -p1 -a1
+%autosetup -n cosmic-term-epoch-%{version_no_tilde} -p1 -a1
 %cargo_prep -N
 # Check if .cargo/config.toml exists
 if [ -f .cargo/config.toml ]; then

Comment 25 Fedora Review Service 2024-10-04 00:23:29 UTC
Created attachment 2050316 [details]
The .spec file difference from Copr build 8095166 to 8106705

Comment 26 Fedora Review Service 2024-10-04 00:23:31 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8106705
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2272140-cosmic-term/fedora-rawhide-x86_64/08106705-cosmic-term/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
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 27 Carl George 🤠 2024-10-04 04:23:54 UTC
The Source0 and %autosetup lines are still using the commit instead of tag, but it's not worth holding up the review for those adjustments.  Besides, from our conversation in matrix those will need to be made in the custom template and shell script generation tools in the cosmic-packaging repo, so they can be used on all COSMIC spec files.

Package is APPROVED.


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

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

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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package does not contain any libtool archives (.la)
[x]: Package contains no static executables.
[x]: Rpath absent or only used for internal libs.

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.
[x]: License file installed when any subpackage combination is installed.
[x]: If the package is under multiple licenses, the licensing breakdown
     must be documented in the spec.
[x]: Package must own all directories that it creates.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: 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.
[-]: 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.
[x]: Package complies to the Packaging Guidelines
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
[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]: Package contains desktop file if it is a GUI application.
[x]: Package installs a %{name}.desktop using desktop-file-install or
     desktop-file-validate if there is such a file.
[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 742 bytes in 1 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

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

Generic:
[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).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: SourceX tarball generation or download is documented.
     Note: Package contains tarball without URL, check comments
[-]: 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.
[x]: %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]: 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]: Spec use %global instead of %define unless justified.

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

Generic:
[x]: Rpmlint is run on debuginfo package(s).
[x]: Rpmlint is run on all installed packages.
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.

Comment 28 Fedora Admin user for bugzilla script actions 2024-10-04 17:24:16 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/cosmic-term


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