`cargo doc` and doc tests fail on Windows because `scripts/rustdoc` is a bash script
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- build-system, testing
Direzione di ricerca
Read .cargo/config.toml and scripts/rustdoc to confirm how the custom rustdoc command is configured. Then inspect doc examples in the listed crates, starting with the two laravel-rust-cache examples and the 200 failures that use laravel::… paths; run the workspace doc tests without the script to check the changes. Done means Windows can run cargo doc and doc tests, with the workspace examples passing across platforms.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
.cargo/config.toml sets build.rustdoc = "scripts/rustdoc", and scripts/rustdoc is a bash script. Windows can't execute it, so every rustdoc run in this repository fails there: cargo doc and all doc tests.
> cargo doc --no-deps -p laravel-rust
Documenting laravel-rust v0.1.6 (C:\...\rust-framework)
error: could not document `laravel-rust`
Caused by:
could not execute process `C:\...\rust-framework\scripts/rustdoc --edition=2024 ...`
Caused by:
%1 is not a valid Win32 application. (os error 193)
cargo test --workspace reports the same error as a doc test failure for 23 crates, although no doc test ran. CI runs on ubuntu-latest only, so it doesn't show up there. Applications that depend on laravel-rust aren't affected, since they don't read this config.
A way to drop the script
The script only points laravel at the facade for the internal crates' doc tests. An example can do the same with a hidden line, using the laravel_facade dev-dependency the crates already have:
/// ```
/// # use laravel_facade as laravel;
/// use laravel::{Application, cache::{MemoryStore, CacheManager}};
///
/// Application::configure().booted(|app| async move {
/// app.resolve::<CacheManager>().await?.add_store("sessions", MemoryStore::default());
/// Ok(())
/// });
/// ```
With that line in its 2 examples that reach outside the crate, laravel-rust-cache passes all 21 of its doc tests with RUSTDOC=rustdoc, so without the script.
Across the workspace, running the doc tests without the script, 1,038 pass and 200 fail. All 200 fail to resolve a laravel::… path outside their crate (laravel::model, laravel::http, laravel::prelude, …), so they are the examples that would take the line: 64 in database, 40 in http, 32 in core, 23 in schedule, 15 in search, and 26 across 7 other crates.
The script and the build.rustdoc setting could then go. A new example that forgets the line would fail in CI on every platform, rather than only on Windows.
Renaming the dev-dependency to laravel instead doesn't work: rustc then gets two laravel crates and fails with E0464: multiple candidates for rlib dependency laravel found, which I guess is why the script exists.
The cost is one hidden line in about 200 examples. If you'd rather keep the script, a .cmd counterpart would also work, but Cargo has no per-platform build.rustdoc, so Windows contributors would have to set RUSTDOC themselves.
I'm happy to send a PR for either.
Tested on Windows 11 with Rust 1.100.1, on 0.x at 213c0c6e.
- Lingua principale
- Rust
- Stelle
- 847
- Fork
- 174
- Merge medio
- 5h 40m
- PR unite (30g)
- 167
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di laravel/rust-framework
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
laravel/rust-framework#864 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
laravel/rust-framework#876 ·
I maintainer di solito rispondono entro 1 giorno
-
Case-sensitive contains, starts_with and ends_with that match % and _ literally on every databaseAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Unicode case-insensitive like and contains on SQLite (or a hook to register SQLite functions)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
laravel/rust-framework#873 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#872 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di laravel/rust-framework
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
neuralmagic/crucible#579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
eclipse-score/kyron#249 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
seanmonstar/reqwest#3157 ·
I maintainer di solito rispondono entro 2 giorni