Nix / NixOS support
メンテナーはふだん 1 日以内に返信
@myuron がすでに取り組んでいます。
2026年10月5日 から。
評価
この issue はまだ評価されていません。
説明
We're packaging vp (vite-plus 0.2.1) for nixpkgs (built from source). The core CLI works well, but several features fail or degrade under Nix, especially in "pure" Nix environments (NixOS, Nix build sandboxes, containers) that don't follow the FHS (no /lib64/ld-linux-*.so, no system libs in standard paths). Filing this so the Nix story can be tracked long-term. We are not asking to fix all of this now.
Environment
- vite-plus 0.2.1; Rust
vpbuilt from source, JS toolchain installed from npm. - macOS (aarch64-darwin) and Linux (x86_64 / aarch64) on a pure-Nix store.
1. Managed Node.js runtime doesn't execute on pure-Nix Linux (+ misleading success)
vp downloads a prebuilt Node.js from nodejs.org into ~/.vite-plus/js_runtime/node/<version>/bin/node. On pure-Nix Linux this generic glibc/musl binary can't run because its ELF interpreter (/lib64/ld-linux-x86-64.so.2 / ld-linux-aarch64.so.1) doesn't exist:
$ vp env use 26
Installing Node.js v26.3.1...
Using Node.js v26.3.1 (resolved from 26) # reports success, marks 26 "current"
$ vp env exec node --version
... cannot run: Dynamic loader not found: /lib64/ld-linux-x86-64.so.2 # exit 255
-
macOS is unaffected (the downloaded macOS node runs via dyld).
-
This affects everything that provisions/uses a managed node:
vp env use/install/exec/pin, and implicitlyvp create,vp run,vp install,vp dev/build/test, etc. -
Misleading UX:
vp env useexits 0 andvp env lsshows the version "current" even though the runtime can't execute; the failure only surfaces later as a raw loader error. A post-install "can this runtime actually exec?" check would help. -
Workaround that works under Nix:
vp env off(system-first) makesvpuse anodefromPATH(e.g. the Nix-provided nodejs), which runs, but it ignores per-project version requirements:$ vp env off && vp env exec node --version v24.15.0 # uses the system/Nix node; works -
Possible directions: an opt-in "use the runtime on PATH / bring-your-own-runtime" mode; or detecting a non-FHS environment and preferring a system runtime. (Nix-side mitigations like
nix-ldor an FHS env exist, but a vp-native option would be cleaner.) -
Update (nixpkgs default): the nixpkgs package now defaults to system-first (patches the default
ShimMode), sovpuses the Nix-provided node out of the box. Two follow-ups this surfaces: (a) in system-first mode,vp env use <v>/vp env install <v>still report success but are no-ops (the active runtime stays the system node), so the command should signal when switching has no effect; (b) under Nix,vp env usenever changes the shell'snoderegardless (there's no vp shim on PATH), so version management is effectively delegated to the Nix environment.
2. Managed package managers (pnpm, …)
Same download-and-run model. pnpm executes via the managed node, so it inherits the failure above on pure-Nix Linux; any natively-distributed package-manager binary would hit the FHS-loader issue directly.
3. fspy filesystem tracing (LD_PRELOAD) requires nightly Rust
fspy's preload cdylib uses the nightly-only c_variadic feature, so it can't be built with the stable rustc nixpkgs uses. We ship a stub, so fspy's filesystem tracing is non-functional in the Nix build, degrading anything that relies on it (e.g. task input/output tracking).
- Possible direction: build the preload cdylib on stable Rust (avoid
c_variadic/ nightly gates), or make fspy optional with graceful degradation.
4. fspy downloads macOS helper binaries during build.rs
On macOS, fspy's build.rs downloads oils-for-unix and coreutils from GitHub releases at build time and embeds them. Hermetic/sandboxed builds (nixpkgs, and generally any offline build) can't fetch during the build, so we stub them, degrading vp's hermetic shell-task execution on macOS.
- Possible direction: let these helpers be supplied via env/path (point at pre-fetched binaries) instead of downloading inside
build.rs.
5. JS toolchain native bindings are prebuilt-only (FYI)
@voidzero-dev/vite-plus-*, @oxlint/binding-*, @oxfmt/binding-*, etc. ship only as prebuilt napi binaries. Under Nix (Linux) they require autoPatchelf to fix the interpreter/rpath; statically-linked ones are skipped. This works but is fragile and offers no source-build path. Mostly an FYI for downstream packaging.
What works vs. not under Nix (vite-plus 0.2.1, nixpkgs build)
- Works:
vp --version/--help, the Rust CLI, JS-command loading; on macOS, the full managed-runtime flow (vp env use,vp create, …). - Fails on pure-Nix Linux: executing any downloaded managed runtime/tool (
vp env use+run,vp create,vp run, …). Workaround:vp env off. - Degraded in the Nix build: fspy tracing (stub) everywhere; fspy macOS shell helpers (stub) on macOS.
- 主要言語
- Rust
- スター
- 6k
- フォーク
- 271
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 198
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-plus のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
voidzero-dev/vite-plus#2970 ·
メンテナーはふだん 1 日以内に返信
-
PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` fails対応中かも @fengmk2 が 2 日前に担当しました。 オープンbug pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
voidzero-dev/vite-plus#2934 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Skip the `vpr` hint when the script runs the same built-in対応中かも @kshanxs が今日担当しました。 オープンpending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
voidzero-dev/vite-plus#2892 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
voidzero-dev/vite-plus#2882 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
`lazyPlugins` docs: dynamic import of a local module still slows down config loading対応中かも @kshanxs が今日担当しました。 オープンdocumentation pending triage
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
voidzero-dev/vite-plus#2875 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/vite-plus の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
chroma-core/chroma#7879 ·
メンテナーはふだん 1 日以内に返信
-
priority middle
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
KATO-Hiro/AtCoderClans#12838 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信