Workspace fails to load: rquickjs types give layout of …: HasErrorType, and rustd never falls back

オープン
#26 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
rust, ubuntu
領域
compilers

調査の方向性

Reproduce with the nanocode repo at commit 74ef4e9 and run cargo rustd build to see the workspace load failure on rquickjs types. The fix lies in rustd's frontend layout handling and its lack of fallback to cargo, unlike ra-jit. Inspect rustd's daemon workspace loading code and add a fallback path for unsupported HasErrorType layouts; verify with cargo rustd status.

索引モデルが issue の本文から書いたものです。

説明

Environment: bare-metal x86-64, 48 cores, 377 GB RAM, Ubuntu 24.04, Rust 1.99.0 with rust-src, rustd nightly release 4530fb8 from install.sh (RUSTD_VERSION=nightly).

git clone https://github.com/gakonst/nanocode && cd nanocode && git checkout 74ef4e9
echo 1.99.0 > rust-toolchain
sed -i '/^rustc-wrapper/d;/^rustc-workspace-wrapper/d' .cargo/config.toml   # drop the repo's own wrappers
# work around the forbid(unsafe_code) issue first:
sed -i -E 's/^unsafe_code *= *"forbid"/unsafe_code = "allow"/' Cargo.toml
cargo rustd build -p nanocode-cli --bin nanocode

Actual: every build fails after ~47 s, and cargo rustd status shows:

/home/ubuntu/w-rustd-nanocode: failed: the daemon could not load the workspace (exit status: 1: Error: `nanocode_code_mode_engine::native::run_worker` is not compiled by rustd: unsupported: callee `drop_in_place`: callee `drop`: callee `drop_slow`: callee `drop_in_place`: … frontend: layout of Rejection: HasErrorType)

Worker log:

6  frontend: layout of ExecutionState: HasErrorType  (e.g. nanocode_code_mode_engine::cell::send_terminal)
2  frontend: layout of Option<Persistent<Function<'static>>>: HasErrorType
1  frontend: layout of Result<String, CaughtError<'…>>
1  frontend: layout of Rejection: HasErrorType  (e.g. nanocode_code_mode_engine::native::run_worker)
13 unsupported: no rustc symbol for function  (e.g. <cell::TerminalKind as serde::Deserialize>::deserialize)

One run failed with a const-eval error instead: ConstEvalError("SIZE", … LayoutError(HasErrorType, Rejection)). The crate (crates/runtime/code-mode-engine) builds on rquickjs, which has lifetime-branded types such as Persistent<Function<'static>> and Value<'js>. rust-analyzer can't type them, and because rustd never falls back, nothing in the workspace builds. The daemon reached 27 GB RSS. ra-jit hits the same HasErrorType layouts on this crate but hands those builds to cargo.

主要言語
Rust
スター
248
フォーク
13
平均マージ
7時間 52分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DioxusLabs/rustd のほかの issue

DioxusLabs/rustd の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。