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

date: fix error message when opening file #4544

Merged
merged 10 commits into from
May 10, 2023

Conversation

leon3s
Copy link
Contributor

@leon3s leon3s commented Mar 18, 2023

Closes #4540

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

@@ -1,5 +1,7 @@
extern crate regex;

use std::os::unix::prelude::PermissionsExt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to make that line Unix specific - will fail on Windows

@leon3s leon3s requested a review from sylvestre March 19, 2023 13:52
@leon3s
Copy link
Contributor Author

leon3s commented Mar 19, 2023

Sadly i cannot really test the behavior on window so maybe i enable the test on unix only ?

@sylvestre
Copy link
Contributor

yeah, unix only is fine

@sylvestre
Copy link
Contributor

Fails on mac:


    Checking uu_du v0.0.17 (/Users/runner/work/coreutils/coreutils/src/uu/du)
error[E0599]: no method named `map_err_context` found for struct `Error` in the current scope
   --> src/uu/date/src/date.rs:229:36
    |
229 |                     return Err(err.map_err_context(|| path.display().to_string()));
    |                                    ^^^^^^^^^^^^^^^ method not found in `Error`
    |
   ::: /Users/runner/work/coreutils/coreutils/src/uucore/src/lib/mods/error.rs:468:8
    |
468 |     fn map_err_context(self, context: impl FnOnce() -> String) -> T;
    |        --------------- the method is available for `std::io::Error` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
11  | use uucore::error::FromIo;
    |

For more information about this error, try `rustc --explain E0599`.

@leon3s leon3s force-pushed the fix-date-file-error-message branch from 5f6eaee to a6cebed Compare March 25, 2023 12:52
@leon3s
Copy link
Contributor Author

leon3s commented Mar 25, 2023

It's look like the failing tests aren't related to the pull request itself now

@tertsdiepraam
Copy link
Member

tertsdiepraam commented Mar 25, 2023

I just realized we have some duplicate work going on between this PR and #4572. I think the latter is a bit more comprehensive. But maybe we can add the test from this PR to the other one?

And yes the failures are due to this: #4634 (I'm working on fixing it)

@leon3s
Copy link
Contributor Author

leon3s commented Mar 25, 2023

So i draft this one maybe and when #4572 is ready i add the test to it ?

@tertsdiepraam
Copy link
Member

Sounds like a good plan :)

@leon3s leon3s marked this pull request as draft March 25, 2023 17:48
@uutils uutils deleted a comment from github-actions bot Mar 28, 2023
@cakebaker
Copy link
Contributor

So i draft this one maybe and when #4572 is ready i add the test to it ?

@leon3s just fyi, #4572 has been merged a while ago

@leon3s leon3s marked this pull request as ready for review April 23, 2023 11:29
@sylvestre sylvestre merged commit d8f1f1c into uutils:main May 10, 2023
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 this pull request may close these issues.

date -f /root is panicking
4 participants