Generated stand-in crate uses global_asm!, which the workspaces forbid(unsafe_code) rejects
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
Research direction
Reproduce with the issue's commands to see the global_asm! lint error. Locate where rustd invokes cargo for stand-in crates and ensure --cap-lints allow is passed or workspace unsafe_code lints are stripped. Done when cargo rustd build -p nanocode-cli --bin nanocode succeeds.
Written by the indexing model from the issue text.
Description
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
cargo rustd build -p nanocode-cli --bin nanocode
Expected: rustd builds the bin. Plain cargo builds it in 24 s.
Actual: it fails in 0.8 s:
error: rustd does not build `nanocode`: what stands in for it does not build:
error: usage of `core::arch::global_asm`
--> target/debug/.rustd-units/nanocode-09d0f3fa57332cc6/…/nanocode-09d0f3fa57332cc6.rustd.rs:20:1
20 | core::arch::global_asm!(".weak main", "main:");
= note: requested on the command line with `-F unsafe-code`
nanocode sets unsafe_code = "forbid" in [workspace.lints], and cargo passes that to every crate, including rustd's stand-in. forbid can't be overridden from inside the crate, so code rustd generates should be built without the workspace's lint flags (or with --cap-lints allow).
- Dominant language
- Rust
- Stars
- 248
- Forks
- 13
- Avg merge
- 7h 52m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DioxusLabs/rustd
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
DioxusLabs/rustd#15 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
DioxusLabs/rustd#28 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
DioxusLabs/rustd#27 ·
Maintainers usually reply within 1 day
-
Workspace fails to load: rquickjs types give layout of …: HasErrorType, and rustd never falls backOpen
Difficulty 4/5 3-5 days Newbie friendliness 25/100
DioxusLabs/rustd#26 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
DioxusLabs/rustd#25 ·
Maintainers usually reply within 1 day
All issues in DioxusLabs/rustd
Similar issues
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
oxc-project/oxc-htmlish-parser#34 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/nsh#2541 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100