Skip to content

Add getpass to libc build - #27605

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:getpass-noderawfs
Aug 25, 2026
Merged

Add getpass to libc build#27605
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:getpass-noderawfs

Conversation

@sbc100

@sbc100 sbc100 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Include getpass.c in libc and ensure getpass() works correctly
at least under Node.js.

This includes two bugfixes needed to make getpass() work:

  1. In libtty.js: In canonical mode (ICANON), make read return as
    soon as a newline character (\n) is encountered.
  2. In libnoderawfs.js: Properly mark TTY streams as non-seekable when
    opened via FS.open, and remove hardcoded seekable: false from
    standard stream creation.

See: #27583

@sbc100
sbc100 force-pushed the getpass-noderawfs branch from b1b8124 to 4352afd Compare August 24, 2026 21:23
@sbc100 sbc100 changed the title [noderawfs] Add getpass to libc build Add getpass to libc build Aug 24, 2026
@sbc100
sbc100 requested a review from kripken August 24, 2026 21:25
@sbc100
sbc100 force-pushed the getpass-noderawfs branch from 4352afd to a43242b Compare August 24, 2026 21:37
@sbc100
sbc100 requested a review from dschuff August 24, 2026 22:23
@sbc100
sbc100 force-pushed the getpass-noderawfs branch 2 times, most recently from 52ec517 to b7d479c Compare August 24, 2026 22:56
@sbc100 sbc100 changed the title Add getpass to libc build [noderawfs] Add getpass to libc build Aug 24, 2026
@sbc100 sbc100 changed the title [noderawfs] Add getpass to libc build Add getpass to libc build Aug 24, 2026
Comment thread src/lib/libtty.js Outdated
@kripken

kripken commented Aug 25, 2026

Copy link
Copy Markdown
Member

This is deprecated in libc - is it worth supporting?

@sbc100

sbc100 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

This is deprecated in libc - is it worth supporting?

Well, we were asked to at least stub it out in #27583, plus the related fixes here are actually useful/good.

Compiling it in doesn't really have any cost here I think.

@kripken kripken left a comment

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.

lgtm % comment

Include `getpass.c` in libc and ensure `getpass()` works correctly
at least under Node.js.

This includes two bugfixes needed to make `getpass()` work:
1. In `libtty.js`: In canonical mode (`ICANON`), make `read` return as
   soon as a newline character (`\n`) is encountered.
2. In `libnoderawfs.js`: Properly mark TTY streams as non-seekable when
   opened via `FS.open`, and remove hardcoded `seekable: false` from
   standard stream creation.

See: emscripten-core#27583
@sbc100
sbc100 force-pushed the getpass-noderawfs branch from aa81368 to 959d0ee Compare August 25, 2026 18:47
@sbc100
sbc100 merged commit aa76826 into emscripten-core:main Aug 25, 2026
21 of 22 checks passed
@sbc100
sbc100 deleted the getpass-noderawfs branch August 25, 2026 19:21
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