Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
drinkcat opened this issue Mar 3, 2025 · 3 comments · Fixed by #7385
Closed

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

drinkcat opened this issue Mar 3, 2025 · 3 comments · Fixed by #7385

Comments

@drinkcat
Copy link
Contributor

drinkcat commented Mar 3, 2025

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 <[email protected]>
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

@dezgeg
Copy link
Contributor

dezgeg commented Mar 3, 2025

Ah, so something is blocking proc_info from compiling by default so CI doesn't catch it. #7385 should fix it at least.

@dezgeg
Copy link
Contributor

dezgeg commented Mar 3, 2025

But ideally something needs to change in CI to include that into build.

@drinkcat
Copy link
Contributor Author

drinkcat commented Mar 3, 2025

I think we just need to add --workspace to the cargo test command.

drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 3, 2025
From cargo test documentation, this options "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).
drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 3, 2025
From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).
drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 3, 2025
From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).
sylvestre pushed a commit to drinkcat/coreutils that referenced this issue Mar 4, 2025
From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).
drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 4, 2025
Add a new Linux build that runs without `cross`, and adds
`--workspace` to the cargo test command.

From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).

Fixes uutils#7392.
drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 4, 2025
Add a new Linux build that runs without `cross`, and adds
`--workspace` to the cargo test command.

From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).

Fixes uutils#7392.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants