Skip to content

a move towards better type and memory saftey (no-libc) - #18287

Closed
philocalyst wants to merge 8 commits into
nushell:mainfrom
philocalyst:anti-libc
Closed

philocalyst wants to merge 8 commits into
nushell:mainfrom
philocalyst:anti-libc

Conversation

@philocalyst

Copy link
Copy Markdown
Contributor

Description

  • In this PR, I removed as many calls to libc as I could! This includes a few unsafe blocks. Most of this was done by relying more on the (already present) sysinfo dependency. The one regression as a result of this was the loss of openbsd sysinfo functionality (will still compile, but until this is closed we are waiting).
  • Another huge simplification was using the uzers crate to handle user logic!
  • Changed some of the terminal restoration guards to use abort instead of unsafe exits.
  • Moved some other things around to reduce libc calls and structure.
  • Should be a great basis and reference for other simplifications and removal of unsafe code going forward :)
  • There's only one libc call remaining!
  • The one clippy issue isn't from this code.
  • Probably should be pretty closely reviewed, taking the word of these crates, and I bet a lot of this is hard to test.

User-facing changes (Release notes)

Additional notes

@philocalyst philocalyst changed the title umask: use u32 instead of platform-dependent mode_t a move towards better type and memory saftey May 26, 2026
@philocalyst philocalyst changed the title a move towards better type and memory saftey a move towards better type and memory saftey (no-libc) May 26, 2026
@fdncred

fdncred commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

My question about this PR is why is it needed? I'm not following.

@philocalyst

Copy link
Copy Markdown
Contributor Author

I'm not the biggest believer in it myself, I sort of just did it because I saw there were some deps that weren't fully utilized, and then I just went all the way. If you see any pieces you think are reasonable, please take them, but I shouldn't have marked this as for review, focused on that other PR really.

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