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

libstdbuf: remove crash macro #5565

Merged
merged 9 commits into from
Nov 30, 2023

Conversation

cswn
Copy link
Contributor

@cswn cswn commented Nov 21, 2023

This PR is related to issue: #5487
Removes the crash! macro from libstdbuf

@uutils uutils deleted a comment from github-actions bot Nov 21, 2023
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

This is however a bit of a tricky crate. Since this crate is injected into processes, I think it might actually best if this doesn't rely on uucore. In this case I think we should just check what error messages GNU gives and just use eprintln! and std::process::exit to match that.

@sylvestre do you agree?

Edit: Actually, I think we should probably only print a warning if we fail to parse the value.

src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs Outdated Show resolved Hide resolved
@cswn
Copy link
Contributor Author

cswn commented Nov 23, 2023

Added some changes, including no longer relying on uucore and printing the same error messages as GNU, I believe.

@cakebaker cakebaker force-pushed the libstdbuf-remove-crash-macro branch from 1761a7d to 0db8fbb Compare November 24, 2023 09:05
Copy link

GNU testsuite comparison:

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

@cswn cswn requested a review from tertsdiepraam November 27, 2023 14:25
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Great! Just one small question

src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs Outdated Show resolved Hide resolved
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Great! Let's also remove the uucore dependency in src/uu/stdbuf/src/libstdbuf/Cargo.toml!

src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs Show resolved Hide resolved
@cswn
Copy link
Contributor Author

cswn commented Nov 28, 2023

Ah right, thanks :D

@uutils uutils deleted a comment from github-actions bot Nov 29, 2023
@uutils uutils deleted a comment from github-actions bot Nov 29, 2023
@cswn cswn requested a review from tertsdiepraam November 30, 2023 08:52
Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Great! Thanks!

@tertsdiepraam tertsdiepraam merged commit 9061b2b into uutils:main Nov 30, 2023
49 of 53 checks passed
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.

2 participants