Skip to content

npm postinstall: glibc preflight check + clear fallback message #560

@Hmbown

Description

@Hmbown

Summary

Companion to #555 / #556. Even after we lower the build target with cargo-zigbuild, the npm wrapper currently exits successfully on install and only fails later at first launch with a runtime linker error like `libc.so.6: version 'GLIBC_2.39' not found`. The user has no clue what just happened.

Proposal

In the npm postinstall script (`npm/deepseek-tui/scripts/postinstall.js` or equivalent), after downloading the binary:

  1. Detect the host glibc version (Linux only): `ldd --version` parse, or `getconf GNU_LIBC_VERSION`.

  2. Detect the binary's required glibc: `readelf -V | grep GLIBC_` and pick the highest version.

  3. If host < required, print a clear error and direct the user to the source-build path:

    `deepseek-tui requires glibc >= 2.28 (your system has 2.17). Install from source instead: `cargo install deepseek-tui-cli``

  4. Exit non-zero so npm flags the install as failed, instead of the current "looks fine, fails later" UX.

Repro context

Reported by @20bytes on issue #555 (Ubuntu 22.04, glibc 2.35) — install succeeds, both `./node_modules/.bin/deepseek --version` and `./node_modules/.bin/deepseek-tui --version` fail at runtime with the linker error.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.8.10Targeting v0.8.10

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions