Bug 2305400 - Review Request: rust-termsize - Retrieves terminal size
Summary: Review Request: rust-termsize - Retrieves terminal size
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Fabio Valentini
QA Contact: Fedora Extras Quality Assurance
URL: https://crates.io/crates/termsize
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-08-17 08:05 UTC by Alessio
Modified: 2024-09-22 00:15 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-09-13 14:35:48 UTC
Type: ---
Embargoed:
decathorpe: fedora-review+


Attachments (Terms of Use)

Description Alessio 2024-08-17 08:05:12 UTC
Spec URL: https://alciregi.fedorapeople.org/rustrpm/rust-termsize.spec
SRPM URL: https://alciregi.fedorapeople.org/rustrpm/rust-termsize-0.1.9-1.fc40.src.rpm
Description: Termsize is a rust crate providing a multi-platform interface for resolving your terminal's current size in rows and columns. On most unix systems, this is similar invoking the stty(1) program, requesting the terminal size.
Fedora Account System Username: alciregi

Comment 1 Alessio 2024-08-17 08:06:21 UTC
Need it in order to build zeitfetch https://github.com/nidnogg/zeitfetch
SPEC file created using rust2rpm without any modification.

Comment 2 Fabio Valentini 2024-09-08 12:02:55 UTC
This fails to build for me with test failures:

```
running 2 tests
test tests::test_get ... FAILED
stty: /dev/stderr: Permission denied
test imp::tests::test_shell ... FAILED
failures:
---- tests::test_get stdout ----
thread 'tests::test_get' panicked at src/lib.rs:41:9:
assertion failed: get().is_some()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- imp::tests::test_shell stdout ----
thread 'imp::tests::test_shell' panicked at src/nix.rs:75:9:
assertion failed: output.status.success()
failures:
    imp::tests::test_shell
    tests::test_get
```

Looks like the tests expect to be able to open /dev/stdout and /dev/stderr?
I'm not sure they're available in mock environments.
Do the tests pass when you just run "cargo test" on your machine?

Comment 3 Alessio 2024-09-09 14:20:57 UTC
Whoops. I didn't perform a scratch build. Obviously koji fails as well.

Using rpmbuild locally, tests pass.

Comment 4 Alessio 2024-09-09 14:21:53 UTC
And also cargo test locally works.

$ cargo test
    Updating crates.io index
     Locking 5 packages to latest compatible versions
   Compiling libc v0.2.158
   Compiling termsize v0.1.9 (/home/alessio/temp/termsize)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 1.58s
     Running unittests src/lib.rs (target/debug/deps/termsize-38aae41a71dcf77c)

running 2 tests
test tests::test_get ... ok
test imp::tests::test_shell ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests termsize

running 1 test
test src/lib.rs - (line 7) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s

Comment 5 Fabio Valentini 2024-09-10 16:13:12 UTC
> Using rpmbuild locally, tests pass.

By that, you mean "rpmbuild -bb rust-termsize.spec" and not "mock *.src.rpm"?

Comment 6 Alessio 2024-09-10 18:21:14 UTC
(In reply to Fabio Valentini from comment #5)
> > Using rpmbuild locally, tests pass.
> 
> By that, you mean "rpmbuild -bb rust-termsize.spec" and not "mock *.src.rpm"?

Yes, exactly.

Comment 7 Fabio Valentini 2024-09-10 18:26:03 UTC
(In reply to Alessio from comment #6)
> (In reply to Fabio Valentini from comment #5)
> > > Using rpmbuild locally, tests pass.
> > 
> > By that, you mean "rpmbuild -bb rust-termsize.spec" and not "mock *.src.rpm"?
> 
> Yes, exactly.

Just to temper expectations - this is not a supported way to build packages for Rust crates. Please use mock instead.

In this case, I think it's clear that the build environment doesn't present all the TTY things the tests expect, so I would recommend to just skip the tests that fail.

Comment 9 Fedora Review Service 2024-09-12 00:32:11 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8010412
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2305400-rust-termsize/fedora-rawhide-x86_64/08010412-rust-termsize/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 Fabio Valentini 2024-09-12 10:20:47 UTC
This looks good to me. Please just add a comment alongside the disabled bcond that documents *why* the tests are disabled.

For example:

```rpmspec
# tests can only be run when a real TTY is available
%bcond_with check
```

You can also automate this for future versions with a rust2rpm.toml config file that contains this snippet:

```toml
[tests]
run = ["none"]
comments = ["tests can only be run when a real TTY is available"]
```

===

Package was generated with rust2rpm, simplifying the review.

✅ package contains only permissible content
✅ package builds and installs without errors on rawhide
🫤 test suite is run and all unit tests pass (please document why the tests are disabled before importing)
✅ latest version of the crate is packaged
✅ license matches upstream specification and is acceptable for Fedora
✅ license file is included with %license in %files
✅ package complies with Rust Packaging Guidelines

Package APPROVED.

===

Recommended post-import rust-sig tasks:

- set up package on release-monitoring.org:
  project: $crate
  homepage: https://crates.io/crates/$crate
  backend: crates.io
  version scheme: semantic
  version filter: alpha;beta;rc;pre
  distro: Fedora
  Package: rust-$crate

- add @rust-sig with "commit" access as package co-maintainer
  (should happen automatically)

- set bugzilla assignee overrides to @rust-sig (optional)

- track package in koschei for all built branches
  (should happen automatically once rust-sig is co-maintainer)

Comment 11 Fedora Admin user for bugzilla script actions 2024-09-13 14:19:57 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-termsize

Comment 12 Fedora Update System 2024-09-13 14:31:28 UTC
FEDORA-2024-822129ad77 (rust-termsize-0.1.9-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-822129ad77

Comment 13 Fedora Update System 2024-09-13 14:35:48 UTC
FEDORA-2024-822129ad77 (rust-termsize-0.1.9-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-09-13 14:46:06 UTC
FEDORA-2024-2de27f3d17 (rust-termsize-0.1.9-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-2de27f3d17

Comment 15 Fedora Update System 2024-09-14 02:29:47 UTC
FEDORA-2024-2de27f3d17 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-2de27f3d17 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-2de27f3d17

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2024-09-22 00:15:26 UTC
FEDORA-2024-2de27f3d17 (rust-termsize-0.1.9-1.fc41) has been pushed to the Fedora 41 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.