Skip to content

update nushell to use coreutils v0.2.2 crates - #16737

Merged
fdncred merged 9 commits into
nushell:mainfrom
fdncred:update_coreutils_to_022
Sep 24, 2025
Merged

fdncred merged 9 commits into
nushell:mainfrom
fdncred:update_coreutils_to_022

Conversation

@fdncred

@fdncred fdncred commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor

This is a follow up to #15896 and #15932 and updates nushell to use the coreutils crates v0.2.2. We should try to stay on the latest coreutils version as much as possible.

Coreutils has reverted the main problem we had which was the need to have a PROJECT_NAME_FOR_VERSION_STRING environment variable.
For reference,
https://github.com/uutils/coreutils/blob/5287738e9c408cf665e5a87c4df03bdc1685bb8f/docs/src/release-notes/0.2.0.md?plain=1#L528
uutils/coreutils#8360

Release notes summary - What our users need to know

N/A

Tasks after submitting

N/A

@132ikl

132ikl commented Sep 23, 2025

Copy link
Copy Markdown
Member

I'd really prefer to not have regressions to our errors, at least not without a better understanding as to what the cause is. I would vote to postpone this unless there's a specific fix we are hoping to integrate by upgrading.

We know there are systemic issues with uutils error reporting as Piet described in uutils/coreutils#7269, but this seems to be a different issue

@fdncred is it just these two errors, or did you notice more?

@132ikl 132ikl added the X:controversial There's disagreement over if/how this should be implemented. PRs implementing this may not be merged label Sep 23, 2025
@fdncred

fdncred commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor Author

I'd really prefer to not have regressions to our errors, at least not without a better understanding as to what the cause is. I would vote to postpone this unless there's a specific fix we are hoping to integrate by upgrading.

It's kind of a trade-off here. Do we want to have all the fixes that have been added to the coreutils or have less than optimal errors? I vote for the bug fixes myself because bugs in mv & cp (primarily) are generally important.

Just a quick look at the change log uutils/coreutils@0.0.30...0.2.2 and searching for crate names in the title, there seem to be quite a few commits.

  • 20 commits for mv
  • 53 for cp
  • 16 for mkdir
  • 8 for mktemp
  • 7 for touch
  • 3 for whoami
  • 6 for uname
  • 132 for uucore (helper crate)

We know there are systemic issues with uutils error reporting as Piet described in uutils/coreutils#7269, but this seems to be a different issue

@fdncred is it just these two errors, or did you notice more?

@132ikl You can see in the diff tests section that it's 3 errors in umv, which at least give you some more information, and a one in ucp which gives you a one hyphenated word error that is somewhat discriptive but none of these are "nushell caliber" error messages.

To be 100% clear and honest, there may be an "easy" way to get to the errors that I'm too stupid to figure out. This could be a me problem but without posting this and getting more eyes on it, I wasn't sure how to figure that out. I welcome any help in tracking this down.

@fdncred

fdncred commented Sep 24, 2025 •

Copy link
Copy Markdown
Contributor Author

It looksl like there's a way to get the error messages but I couldn't get it to work.
https://github.com/uutils/coreutils/blob/5eb8144606e711808253d6456e8ea04066601853/src/uucore/src/lib/mods/locale.rs#L491-L525

@tertsdiepraam any tips on how to get errors out of the uu_cp/uu_mv crates with errors like cp-error-same-file? I tried calling uucore::translate!(error) but it just outputs cp-error-same-file.

@fdncred

fdncred commented Sep 24, 2025

Copy link
Copy Markdown
Contributor Author

I may have tripped over how to use it. It seems you may have to do something like this first? Testing now.

localized_help_template("cp");

@fdncred

fdncred commented Sep 24, 2025

Copy link
Copy Markdown
Contributor Author

yipee! I fixed the errors, so they are the same as before.

@tertsdiepraam

Copy link
Copy Markdown
Contributor

@tertsdiepraam any tips on how to get errors out of the uu_cp/uu_mv crates with errors like cp-error-same-file? I tried calling uucore::translate!(error) but it just outputs cp-error-same-file.

Hi @fdncred! I'm not really involved much anymore, so I might not be the best person to ask. If you need more help I can ask the other maintainers to chime in though! Looks like you got it all sorted. Nice!

@fdncred

fdncred commented Sep 24, 2025

Copy link
Copy Markdown
Contributor Author

Hi @fdncred! I'm not really involved much anymore, so I might not be the best person to ask. If you need more help I can ask the other maintainers to chime in though! Looks like you got it all sorted. Nice!

ok, thanks terts! appreciate you responding. i think i got it sorted.

@132ikl

132ikl commented Sep 24, 2025

Copy link
Copy Markdown
Member

yipee! I fixed the errors, so they are the same as before.

perfect, thanks for looking into this! sounds good to me

@132ikl 132ikl added X:blessed This was previously controversial, but we have now agreed on a path forward and removed X:controversial There's disagreement over if/how this should be implemented. PRs implementing this may not be merged labels Sep 24, 2025
Comment thread Cargo.lock

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a bit surprised at the increase here.. hopefully this doesn't increase compile time too much

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I originally tried to cherry-pick the appropriate deps because cargo update -p is stupid sometimes. However, once I started fiddling with them manually, there were tons of "I need this, not that" problems which kept pulling in more and more crates. So, I just decided to let cargo update do its thing and run with it. At least then it compiles.

@fdncred fdncred Sep 24, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also, a lot of the new crates are related to the fluent crate which they appear to be using for internationalization. This is now one of the cornerstones to their error messages. I wouldn't be surprised if these errors appear in different languages based on locales since that's the intention of the translate!() macro that i'm calling here to get the "real" error message.

we could put a pin in this here too toward the future internationalization of nushell error messages.

@fdncred
fdncred merged commit 4eb43a0 into nushell:main Sep 24, 2025
@github-actions github-actions Bot added this to the v0.108.0 milestone Sep 24, 2025
@fdncred
fdncred deleted the update_coreutils_to_022 branch September 24, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X:blessed This was previously controversial, but we have now agreed on a path forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants