Skip to content

cargo test --package uucore --all-features float fails #7383

@drinkcat

Description

@drinkcat

Was trying to rerun tests for the uucore package with:
cargo test --package uucore --all-features float
(not 100% sure if this is the right way to run uucore tests, but that's what I've been doing)

And they now started to fail:

error[E0433]: failed to resolve: use of undeclared crate or module `uucore`
   --> src/uucore/src/lib/features/proc_info.rs:431:33
    |
431 |         let main_tid = unsafe { uucore::libc::gettid() };
    |                                 ^^^^^^ use of undeclared crate or module `uucore`
    |
help: there is a crate or module with a similar name
    |
431 |         let main_tid = unsafe { core::libc::gettid() };
    |                                 ~~~~
help: consider importing one of these crates
    |
366 +     use crate::libc;
    |
366 +     use nix::libc;
    |
help: if you import `libc`, refer to it directly
    |
431 -         let main_tid = unsafe { uucore::libc::gettid() };
431 +         let main_tid = unsafe { libc::gettid() };
    |
error[E0433]: failed to resolve: use of undeclared crate or module `uucore`
   --> src/uucore/src/lib/features/proc_info.rs:441:43
    |
441 |             let new_thread_tid = unsafe { uucore::libc::gettid() };
    |                                           ^^^^^^ use of undeclared crate or module `uucore`
    |
help: there is a crate or module with a similar name
    |
441 |             let new_thread_tid = unsafe { core::libc::gettid() };
    |                                           ~~~~
help: consider importing one of these crates
    |
366 +     use crate::libc;
    |
366 +     use nix::libc;
    |
help: if you import `libc`, refer to it directly
    |
441 -             let new_thread_tid = unsafe { uucore::libc::gettid() };
441 +             let new_thread_tid = unsafe { libc::gettid() };
    |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `uucore` (lib test) due to 2 previous errors

Bisection blames this:

commit 16c174d82684a83f76167889305650370f9ce3ce (HEAD)
Author: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Date:   Mon Feb 24 12:00:45 2025 +0200

    uucore: Sync thread_ids() method from procps

 src/uucore/src/lib/features/proc_info.rs | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

Reverting that and 339a6d4 on main fixes the issue.

@dezgeg FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions