Bug 2415111 - .md files don't exist but are expected by /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs
Summary: .md files don't exist but are expected by /usr/share/cargo/registry/jiff-0.2....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rust-jiff
Version: 43
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Ben Beasley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-14 21:50 UTC by Jan Pazdziora
Modified: 2025-11-25 02:35 UTC (History)
3 users (show)

Fixed In Version: rust-jiff-0.2.16-2.fc44 rust-jiff-0.2.16-2.fc43 rust-jiff-0.2.16-2.el10_2 rust-jiff-0.2.16-2.fc42 rust-jiff-0.2.16-2.el10_1 rust-jiff-0.2.16-2.el9
Clone Of:
Environment:
Last Closed: 2025-11-15 00:07:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2025-11-14 21:50:20 UTC
I try to package some Rust project as Fedora rpm. It happens to use jiff. However, when compiling, I get errors like

   Compiling jiff v0.2.15 (/usr/share/cargo/registry/jiff-0.2.15)
error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../COMPARE.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:786:13
    |
786 |     #[doc = include_str!("../COMPARE.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../DESIGN.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:788:13
    |
788 |     #[doc = include_str!("../DESIGN.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../PLATFORM.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:790:13
    |
790 |     #[doc = include_str!("../PLATFORM.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../CHANGELOG.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:792:13
    |
792 |     #[doc = include_str!("../CHANGELOG.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Reproducible: Always

Steps to Reproduce:

1. Run fresh environment, for example
   $ podman run --rm -ti registry.fedoraproject.org/fedora:43

The next steps are then run in this container:

2. # dnf install -y cargo rust-jiff-devel
3. # cargo new test-jiff
4. # cd test-jiff
5. Edit Cargo.toml to contain

[package]
name = "test-jiff"
version = "0.1.0"
edition = "2024"

[dependencies]
# We add the lines below to test the jiff as packaged by Fedora
jiff = " = 0.2.15"

[patch.crates-io]
jiff = { path = "/usr/share/cargo/registry/jiff-0.2.15" }

6. # cargo build --verbose

Actual Results:

    Updating crates.io index
     Locking 9 packages to latest Rust 1.91.0 compatible versions
  Downloaded log v0.4.28
  Downloaded serde_core v1.0.228
  Downloaded serde v1.0.228
  Downloaded 3 crates (193.3KiB) in 0.19s
   Compiling jiff v0.2.15 (/usr/share/cargo/registry/jiff-0.2.15)
     Running `rustc --crate-name jiff --edition=2021 /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=126 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="perf-inline"' --cfg 'feature="std"' --cfg 'feature="tz-fat"' --cfg 'feature="tz-system"' --cfg 'feature="tzdb-bundle-platform"' --cfg 'feature="tzdb-concatenated"' --cfg 'feature="tzdb-zoneinfo"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "logging", "perf-inline", "serde", "std", "tz-fat", "tz-system", "tzdb-bundle-platform", "tzdb-concatenated", "tzdb-zoneinfo"))' -C metadata=c626418480a7ffb5 -C extra-filename=-d775969445647e5f --out-dir /test-jiff/target/debug/deps -C incremental=/test-jiff/target/debug/incremental -L dependency=/test-jiff/target/debug/deps`
error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../COMPARE.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:786:13
    |
786 |     #[doc = include_str!("../COMPARE.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../DESIGN.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:788:13
    |
788 |     #[doc = include_str!("../DESIGN.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../PLATFORM.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:790:13
    |
790 |     #[doc = include_str!("../PLATFORM.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: couldn't read `/usr/share/cargo/registry/jiff-0.2.15/src/../CHANGELOG.md`: No such file or directory (os error 2)
   --> /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs:792:13
    |
792 |     #[doc = include_str!("../CHANGELOG.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[ some warnings that we don't care about right now ]

warning: `jiff` (lib) generated 12 warnings
error: could not compile `jiff` (lib) due to 4 previous errors; 12 warnings emitted

Caused by:
  process didn't exit successfully: `rustc --crate-name jiff --edition=2021 /usr/share/cargo/registry/jiff-0.2.15/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=126 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="perf-inline"' --cfg 'feature="std"' --cfg 'feature="tz-fat"' --cfg 'feature="tz-system"' --cfg 'feature="tzdb-bundle-platform"' --cfg 'feature="tzdb-concatenated"' --cfg 'feature="tzdb-zoneinfo"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "logging", "perf-inline", "serde", "std", "tz-fat", "tz-system", "tzdb-bundle-platform", "tzdb-concatenated", "tzdb-zoneinfo"))' -C metadata=c626418480a7ffb5 -C extra-filename=-d775969445647e5f --out-dir /test-jiff/target/debug/deps -C incremental=/test-jiff/target/debug/incremental -L dependency=/test-jiff/target/debug/deps` (exit status: 1)


Expected Results:

No error, compilation passing.


Additional Information:

The content of the directory is

# ls -la /usr/share/cargo/registry/jiff-0.2.15
total 36
drwxr-xr-x. 4 root root 4096 Nov 14 21:39 .
drwxr-xr-x. 3 root root 4096 Nov 14 21:39 ..
-rw-r--r--. 1 root root   26 Jul 25 00:00 .cargo-checksum.json
-rw-r--r--. 1 root root  126 Jul 24  2006 COPYING
-rw-r--r--. 1 root root 2899 Jul 25 00:00 Cargo.toml
-rw-r--r--. 1 root root 1081 Jul 24  2006 LICENSE-MIT
-rw-r--r--. 1 root root 1211 Jul 24  2006 UNLICENSE
drwxr-xr-x. 7 root root 4096 Nov 14 21:39 src
drwxr-xr-x. 2 root root 4096 Nov 14 21:39 tests

When I comment out the patch.crates-io section and rerun cargo build --verbose, I can see that that crane directory has the .md files:

# ls -la /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jiff-0.2.15
total 256
drwxr-xr-x.  4 root root  4096 Nov 14 21:46 .
drwxr-xr-x. 11 root root  4096 Nov 14 21:46 ..
-rw-r--r--.  1 root root     7 Nov 14 21:46 .cargo-ok
-rw-r--r--.  1 root root    94 Jan  1  1970 .cargo_vcs_info.json
-rw-r--r--.  1 root root 50969 Jul 24  2006 CHANGELOG.md
-rw-r--r--.  1 root root 49264 Jul 24  2006 COMPARE.md
-rw-r--r--.  1 root root   126 Jul 24  2006 COPYING
-rw-r--r--.  1 root root 24252 Jan  1  1970 Cargo.lock
-rw-r--r--.  1 root root  4342 Jan  1  1970 Cargo.toml
-rw-r--r--.  1 root root 12422 Jul 24  2006 Cargo.toml.orig
-rw-r--r--.  1 root root 33734 Jul 24  2006 DESIGN.md
-rw-r--r--.  1 root root  1081 Jul 24  2006 LICENSE-MIT
-rw-r--r--.  1 root root 21904 Jul 24  2006 PLATFORM.md
-rw-r--r--.  1 root root  7752 Jul 24  2006 README.md
-rw-r--r--.  1 root root  1211 Jul 24  2006 UNLICENSE
drwxr-xr-x.  7 root root  4096 Nov 14 21:46 src
drwxr-xr-x.  2 root root  4096 Nov 14 21:46 tests

Comment 1 Ben Beasley 2025-11-14 22:18:23 UTC
In general, Fedora’s rust-*-devel crate library packages are really intended to be suitable for building application RPM packages in mock or koji, and not necessarily to be usable for plugging into Rust projects being built directly with cargo.

Nevertheless, I don’t think that what you tried should have failed in the way that it failed. I suspect that what is happening here is that your container is configured not to install documentation files by default, and all of these Markdown files are marked as documentation (%doc) by rust2rpm. That’s normally the right thing to do, and they really are documentation, but there also exists a rule that files *marked* as documentation must not be required at runtime or affect the functioning of a package in any way. Clearly, since these files are included in the jiff sources as (documentation) strings and are required to build the crate, this rule isn’t satisfied in this case.

/// Longer form documentation for Jiff.
pub mod _documentation {
    #[doc = include_str!("../COMPARE.md")]
    pub mod comparison {}
    #[doc = include_str!("../DESIGN.md")]
    pub mod design {}
    #[doc = include_str!("../PLATFORM.md")]
    pub mod platform {}
    #[doc = include_str!("../CHANGELOG.md")]
    pub mod changelog {}
}

Nobody has noticed this before because people normally don’t use rust-*-devel packages this way, and documentation files do get installed when doing builds in mock/koji. I think that what you’ve pointed out is a real defect, and I think the correct thing to do is just to ensure that these four files are still installed, but are not marked as documentation. I’ll work on that.

Comment 2 Jan Pazdziora 2025-11-14 22:37:31 UTC
Thanks for your superquick response. You are spot on that the container has

[main]
tsflags=nodocs

in /etc/dnf/dnf.conf so the reason for those .md files missing is this setting.

When I install the crane in the container using

# dnf install -y --setopt=tsflags= rust-jiff-devel

the cargo build command then passes just fine. This gives me a workaround for the work where I hit the issue.

I'm aware that Fedora-packaged cranes are not supposed to be used this way -- this was just a minified reproducer of the investigation I do for packaging https://github.com/EdgeTX/rs-dfu/ as rpm.

Comment 3 Ben Beasley 2025-11-14 23:33:12 UTC
Thank you for the report. I’m building what should be a fix for this in Rawhide right now. I’ll ship it to stable relases in a day or two, after jiff-0.2.16 updates now in testing reach stable.

Comment 4 Fedora Update System 2025-11-15 00:05:19 UTC
FEDORA-2025-b4b135bee0 (rust-jiff-0.2.16-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-b4b135bee0

Comment 5 Fedora Update System 2025-11-15 00:07:27 UTC
FEDORA-2025-b4b135bee0 (rust-jiff-0.2.16-2.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2025-11-15 10:09:23 UTC
FEDORA-2025-28a51a28b4 (rust-jiff-0.2.16-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-28a51a28b4

Comment 7 Jan Pazdziora 2025-11-15 10:17:10 UTC
I confirm that when I do

dnf install https://kojipkgs.fedoraproject.org//packages/rust-jiff/0.2.16/2.fc43/noarch/rust-jiff-devel-0.2.16-2.fc43.noarch.rpm

and change the version in Cargo.toml to 0.2.16, the cargo build --verbose in the container passes.

Thank you!

Comment 8 Fedora Update System 2025-11-16 01:39:42 UTC
FEDORA-2025-28a51a28b4 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-28a51a28b4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-28a51a28b4

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

Comment 9 Fedora Update System 2025-11-16 08:27:12 UTC
FEDORA-2025-7e52b09dc8 (rust-jiff-0.2.16-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-7e52b09dc8

Comment 10 Fedora Update System 2025-11-16 08:40:01 UTC
FEDORA-EPEL-2025-cbc9735fea (rust-jiff-0.2.16-2.el10_2) has been submitted as an update to Fedora EPEL 10.2.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-cbc9735fea

Comment 11 Fedora Update System 2025-11-16 09:25:27 UTC
FEDORA-EPEL-2025-b8bae6efda (rust-jiff-0.2.16-2.el10_1) has been submitted as an update to Fedora EPEL 10.1.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-b8bae6efda

Comment 12 Fedora Update System 2025-11-16 09:59:54 UTC
FEDORA-EPEL-2025-3007e72f8a (rust-jiff-0.2.16-2.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-3007e72f8a

Comment 13 Fedora Update System 2025-11-17 03:47:19 UTC
FEDORA-EPEL-2025-cbc9735fea has been pushed to the Fedora EPEL 10.2 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-cbc9735fea

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

Comment 14 Fedora Update System 2025-11-17 03:50:08 UTC
FEDORA-EPEL-2025-3007e72f8a has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-3007e72f8a

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

Comment 15 Fedora Update System 2025-11-17 03:52:56 UTC
FEDORA-EPEL-2025-b8bae6efda has been pushed to the Fedora EPEL 10.1 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-b8bae6efda

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

Comment 16 Fedora Update System 2025-11-17 04:01:47 UTC
FEDORA-2025-7e52b09dc8 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-7e52b09dc8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-7e52b09dc8

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

Comment 17 Fedora Update System 2025-11-24 01:24:57 UTC
FEDORA-2025-28a51a28b4 (rust-jiff-0.2.16-2.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2025-11-25 01:23:03 UTC
FEDORA-EPEL-2025-cbc9735fea (rust-jiff-0.2.16-2.el10_2) has been pushed to the Fedora EPEL 10.2 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2025-11-25 01:38:47 UTC
FEDORA-2025-7e52b09dc8 (rust-jiff-0.2.16-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2025-11-25 02:28:18 UTC
FEDORA-EPEL-2025-b8bae6efda (rust-jiff-0.2.16-2.el10_1) has been pushed to the Fedora EPEL 10.1 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2025-11-25 02:35:55 UTC
FEDORA-EPEL-2025-3007e72f8a (rust-jiff-0.2.16-2.el9) has been pushed to the Fedora EPEL 9 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.