Bug 2364625

Summary: Review Request: rust-virtual-terminal - Virtual terminal
Product: [Fedora] Fedora Reporter: solomoncyj
Component: Package ReviewAssignee: Ben Beasley <code>
Status: RELEASE_PENDING --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, package-review
Target Milestone: ---Flags: code: fedora-review+
solomoncyj: needinfo-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://crates.io/crates/virtual-terminal
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2364626, 2350507, 2365816    
Bug Blocks: 2359652    

Comment 1 Fedora Review Service 2025-05-07 05:38:33 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/9006514
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2364625-rust-virtual-terminal/fedora-rawhide-x86_64/09006514-rust-virtual-terminal/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 Ben Beasley 2025-05-18 13:01:31 UTC
With the dependencies rust-triggered and rust-bmart provided, this FTBFS with a number of errors. The first one is:

error[E0433]: failed to resolve: could not find `termios` in `rustix`
   --> src/lib.rs:195:30
    | 
195 |                 .set(rustix::termios::InputModes::IUTF8, true);
    |                              ^^^^^^^ could not find `termios` in `rustix`
    |
note: found an item that was configured out
   --> /usr/share/cargo/registry/rustix-1.0.7/src/lib.rs:300:9
    | 
300 | pub mod termios;
    |         ^^^^^^^
note: the item is gated behind the `termios` feature
   --> /usr/share/cargo/registry/rustix-1.0.7/src/lib.rs:298:7
    |
298 | #[cfg(feature = "termios")]
    |       ^^^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `termios` in `rustix`

Now, the error makes sense: the `termios` feature in `rustix` is supposed to be needed for `rustix::termios::*`[1], and `virtual-terminal` doesn’t ask for it[2]. However, I can’t reproduce the problem in a git checkout.

So I tried "cargo tree -e features | less -RS" in the git checkout, and I found:

├── rustix-openpty feature "default"
│   └── rustix-openpty v0.2.0
│       ├── rustix feature "alloc" (*)
│       ├── rustix feature "fs"
│       │   └── rustix v1.0.7 (*)
│       ├── rustix feature "process"
│       │   ├── rustix v1.0.7 (*)
│       │   └── linux-raw-sys feature "prctl"
│       │       └── linux-raw-sys v0.9.4
│       ├── rustix feature "pty"
│       │   ├── rustix v1.0.7 (*)
│       │   └── rustix feature "fs" (*)
│       ├── rustix feature "stdio"
│       │   └── rustix v1.0.7 (*)
│       └── rustix feature "termios"
│           └── rustix v1.0.7 (*)

So that kind of makes sense: Rust feature unification means the feature will be enabled if it is requested anywhere in the dependency tree, and rustix-openpty 0.2.0 requires rustix/termios for its default features. We still have rust-rustix-openpty 0.1.1 in Fedora, and while I haven’t taken time to check, it’s likely that this changed in 0.2.0.

In the dev-dependencies, there is an indirect dependency on rustix with the termios feature,

├── terminal_size feature "default"
│   └── terminal_size v0.4.2
│       ├── rustix feature "default" (*)
│       └── rustix feature "termios" (*)

but per [3], “Dev-dependencies do not activate features unless building a Cargo target that needs them (like tests or examples).”

You should send upstream a PR to directly require the "termios" feature in the rustix dependency, since virtual-terminal uses rustix::termios APIs; you can then patch it into Cargo.toml using "rust2rpm -p".

I tried the above, and I still encountered more errors. The first is:

error[E0308]: mismatched types
   --> src/lib.rs:185:54
    |
185 |         let pty = rustix_openpty::openpty(None, Some(&win_size))?;
    |                                                 ---- ^^^^^^^^^ expected `&winsize`, found `&Winsize`
    |                                                 |
    |                                                 arguments to this enum variant are incorrect
    |
    = note: expected reference `&linux_raw_sys::general::winsize`
               found reference `&Winsize`
help: the type constructed contains `&Winsize` due to the type of the argument passed
   --> src/lib.rs:185:49
    |
185 |         let pty = rustix_openpty::openpty(None, Some(&win_size))?;
    |                                                 ^^^^^---------^
    |                                                      |
    |                                                      this argument influences the type of `Some`
note: tuple variant defined here
   --> /builddir/build/BUILD/rust-1.86.0-build/rustc-1.86.0-src/library/core/src/option.rs:580:5

I’m not taking time to dig into this deeply, but I am pretty sure it will turn out to mean that patching the rustix-openpty dependency to allow 0.1 was not correct, and this package actually does require the update to rustix-openpty 0.2, bug 2350507.

[1] https://github.com/bytecodealliance/rustix/blob/92466d9860d95aa15b8ad0a5ea4cb88b39ccc63f/Cargo.toml#L152-L153
[2] https://github.com/roboplc/virtual-terminal/blob/967e6c9dea5455c7f7f3b9276b88abb445009a3a/Cargo.toml#L17
[3] https://doc.rust-lang.org/cargo/reference/features.html#feature-resolver-version-2

Comment 3 solomoncyj 2025-05-18 14:35:38 UTC
for `rustix-openpty` i have  PR [1] But atm its blocked by ruat-alacrity_terminal which is still on 1.0 and cannot be build when bumping versions

[1] https://src.fedoraproject.org/rpms/rust-rustix-openpty/pull-request/1

Comment 4 solomoncyj 2025-07-20 02:14:41 UTC
@code updates have peen pushed to the blocking libaries, review may continue

Comment 5 Ben Beasley 2025-07-21 10:38:00 UTC
The package is approved, with a suggestion to better document the Cargo.toml patch.

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

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

The spec is generated by rust2rpm, greatly simplifying the review.


Issues:
=======
- Package does not contain duplicates in %files.
  Note: warning: File listed twice: /usr/share/cargo/registry/virtual-
  terminal-0.1.4/LICENSE
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/#_duplicate_files

  OK; this is not a serious problem and is due to reasonable design decisions
  in rust2rpm.

- It would be better to add a spec-file comment explaining what the Cargo.toml
  patch does and why,
  https://docs.fedoraproject.org/en-US/packaging-guidelines/PatchUpstreamStatus/.

  You could use a rust2rpm.toml like this:

    [package]
    cargo-toml-patch-comments = [
        "Allow rustix-openpty 0.1, until 0.2 reaches stable in all stable releases",
    ]

  The result would be:

    # Manually created patch for downstream crate metadata changes
    # * Allow rustix-openpty 0.1, until 0.2 reaches stable in all stable releases
    Patch:          virtual-terminal-fix-metadata.diff

===== 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: "Unknown or generated", "MIT License". 9 files have unknown
     license. Detailed output of licensecheck in
     /home/ben/fedora/review/20250720/2364625-rust-virtual-
     terminal/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[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.
[x]: 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]: Package is not known to require an ExcludeArch tag.
[x]: 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: No rpmlint messages.
[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 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]: 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).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in rust-
     virtual-terminal-devel , rust-virtual-terminal+default-devel
[?]: Package functions as described.

     The crate contains no tests that can be run when building the package.

[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[!]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.

     As noted in Issues, the Cargo.toml patch should have a comment explaining
     what it does and why it does it.

[-]: 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.

     https://koji.fedoraproject.org/koji/taskinfo?taskID=135067760

[x]: %check is present and all tests pass.

     The %check section is correctly implemented, but the crate contains no
     tests that can be run.

[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]: 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:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)

     OK: differences are due solely to expansion of rpmautospec macros.

[x]: Rpmlint is run on all installed packages.
     Note: No rpmlint messages.


Rpmlint
-------
Checking: rust-virtual-terminal-devel-0.1.4-1.fc43.noarch.rpm
          rust-virtual-terminal+default-devel-0.1.4-1.fc43.noarch.rpm
          rust-virtual-terminal-0.1.4-1.fc43.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.13/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/tmpskde23vb')]
checks: 32, packages: 3

 3 packages and 0 specfiles checked; 0 errors, 0 warnings, 13 filtered, 0 badness; has taken 0.4 s 




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.14/site-packages/rpmlint/configdefaults.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: 2

 2 packages and 0 specfiles checked; 0 errors, 0 warnings, 9 filtered, 0 badness; has taken 0.0 s 



Source checksums
----------------
https://crates.io/api/v1/crates/virtual-terminal/0.1.4/download#/virtual-terminal-0.1.4.crate :
  CHECKSUM(SHA256) this package     : 22d05fcc9d883c60c84a8f36c5a53ce5d5bb92e64a2ee2702bab98db2ac7c778
  CHECKSUM(SHA256) upstream package : 22d05fcc9d883c60c84a8f36c5a53ce5d5bb92e64a2ee2702bab98db2ac7c778


Requires
--------
rust-virtual-terminal-devel (rpmlib, GLIBC filtered):
    (crate(async-channel/default) >= 2.3.0 with crate(async-channel/default) < 3.0.0~)
    (crate(bmart/default) >= 0.2.11 with crate(bmart/default) < 0.3.0~)
    (crate(libc/default) >= 0.2.0 with crate(libc/default) < 0.3.0~)
    (crate(rustix-openpty/default) >= 0.1.0 with crate(rustix-openpty/default) < 0.3.0~)
    (crate(rustix/default) >= 1.0.0 with crate(rustix/default) < 2.0.0~)
    (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0~)
    (crate(serde/derive) >= 1.0.0 with crate(serde/derive) < 2.0.0~)
    (crate(tokio/default) >= 1.0.0 with crate(tokio/default) < 2.0.0~)
    (crate(tokio/rt) >= 1.0.0 with crate(tokio/rt) < 2.0.0~)
    cargo

rust-virtual-terminal+default-devel (rpmlib, GLIBC filtered):
    cargo
    crate(virtual-terminal)



Provides
--------
rust-virtual-terminal-devel:
    crate(virtual-terminal)
    rust-virtual-terminal-devel

rust-virtual-terminal+default-devel:
    crate(virtual-terminal/default)
    rust-virtual-terminal+default-devel



Diff spec file in url and in SRPM
---------------------------------
--- /home/ben/fedora/review/20250720/2364625-rust-virtual-terminal/srpm/rust-virtual-terminal.spec	2025-07-20 20:56:44.680599981 -0400
+++ /home/ben/fedora/review/20250720/2364625-rust-virtual-terminal/srpm-unpacked/rust-virtual-terminal.spec	2025-05-06 20:00:00.000000000 -0400
@@ -1,2 +1,12 @@
+## START: Set by rpmautospec
+## (rpmautospec version 0.7.3)
+## RPMAUTOSPEC: autorelease, autochangelog
+%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
+    release_number = 1;
+    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
+    print(release_number + base_release_number - 1);
+}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
+## END: Set by rpmautospec
+
 # Generated by rust2rpm 27
 %bcond check 1
@@ -68,3 +78,6 @@
 
 %changelog
-%autochangelog
+## START: Generated by rpmautospec
+* Wed May 07 2025 John Doe <packager> - 0.1.4-1
+- Uncommitted changes
+## END: Generated by rpmautospec


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

Comment 6 solomoncyj 2025-07-24 14:34:01 UTC
Thank you for the review, Ben

Comment 7 Fedora Admin user for bugzilla script actions 2025-07-24 14:34:02 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-virtual-terminal