You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to read python.rs when installing RustPython from source #4117
∴ cargo build
Compiling rustpython-parser v0.1.2 (https://github.com/RustPython/RustPython.git?rev=f1c7aebfad707526602c8162c8094a67129b6731#f1c7aebf)
error: couldn't read /Users/crmarsh/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/f1c7aeb/parser/src/../python.rs: No such file or directory (os error 2)
--> /Users/crmarsh/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/f1c7aeb/parser/src/python.rs:3:1
|
3 | include!("../python.rs");
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
The following warnings were emitted during compilation:
warning: python.rs doesn't exist. regenerate.
error: could not compile `rustpython-parser` due to previous error
Is this a user error? I know this is a recent change as my project built without error on dff916d45c5d13074d21ad329a5ab68a6499426a.
As of about 2 days ago, I'm also having problems compiling rustpython-parser / python.rs. If I do a fresh git clone https://github.com/RustPython/RustPython.git and in it do cargo build --release, after compiling most of the crates I eventually get:
The following warnings were emitted during compilation:
warning: python.rs doesn't exist. regenerate.
error: failed to run custom build command for `rustpython-parser v0.1.2 (/home/ecpost/dev/temp/RustPython/compiler/parser)`
Caused by:
process didn't exit successfully: `/home/ecpost/dev/temp/RustPython/target/release/build/rustpython-parser-acbe8425df4f499f/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=python.lalrpop
cargo:warning=python.rs doesn't exist. regenerate.
--- stderr
thread 'main' panicked at 'try: cargo build --manifest-path=compiler/parser/Cargo.toml --features=lalrpop', compiler/parser/build.rs:80:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm getting this in different MacOS and Linux systems, so I don't think it's an issue with my environment.
BTW, a few days ago I had a different failure that suggested I "please install lalrpop", which I did, and that resolved that issue at the time. But that doesn't seem to be relevant here. (The MacOS system has it installed, the Linux does not, both get the same error.)
P.S. I had also tried the alternate dependency mentioned above, but it didn't help: rustpython-parser = { features=["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "f1c7aebfad707526602c8162c8094a67129b6731" }
@imotai Could you please share the head of python.rs file your build generated? The file is compiler/parser/python.rs in RustPython directory.
If you installed lalrpop binary, lalrpop -v will be also helpful.
But here is the cryptic error message, could not find any ressources on the net to fix it.
The following warnings were emitted during compilation:
warning: python.rs doesn't exist. regenerate.
error: failed to run custom build command for `rustpython-parser v0.1.2 (/home/williamdes/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/683e5af/compiler/parser)`
Caused by:
process didn't exit successfully: `/tmp/cargo-installuFeYFo/release/build/rustpython-parser-ad7268f1df42728a/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=python.lalrpop
cargo:warning=python.rs doesn't exist. regenerate.
--- stderr
thread 'main' panicked at 'try: cargo build --manifest-path=compiler/parser/Cargo.toml --features=lalrpop', compiler/parser/build.rs:80:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `rustpython v0.1.2 (https://github.com/RustPython/RustPython#683e5aff)`, intermediate artifacts can be found at `/tmp/cargo-installuFeYFo`
The originally missing `parser/src/../python.rs` lalrpop include is gone: RustPython no longer has that parser crate and uses the ruff-based parser. Closing the original install failure.
Activity
youknowone commentedon Aug 21, 2022
I am sorry, this is my fault. I will fix it soon.
youknowone commentedon Aug 21, 2022
I want to make it easier, but it will take time. Could you try this for now?
charliermarsh commentedon Aug 21, 2022
That worked! Thank you.
charliermarsh commentedon Aug 21, 2022
(Feel free to close if you'd like.)
ecpost commentedon Aug 23, 2022
As of about 2 days ago, I'm also having problems compiling rustpython-parser / python.rs. If I do a fresh
git clone https://github.com/RustPython/RustPython.gitand in it docargo build --release, after compiling most of the crates I eventually get:I'm getting this in different MacOS and Linux systems, so I don't think it's an issue with my environment.
BTW, a few days ago I had a different failure that suggested I "please install lalrpop", which I did, and that resolved that issue at the time. But that doesn't seem to be relevant here. (The MacOS system has it installed, the Linux does not, both get the same error.)
P.S. I had also tried the alternate dependency mentioned above, but it didn't help:
rustpython-parser = { features=["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "f1c7aebfad707526602c8162c8094a67129b6731" }charliermarsh commentedon Aug 23, 2022
Does it resolve the issue if you run
lalrpop python.lalrpopin./RustPython/compiler/parserprior tocargo build?ecpost commentedon Aug 23, 2022
Yes! (In both my MacOS and, after installing lalrpop, my Linux.)
imotai commentedon Sep 8, 2022
still the same
youknowone commentedon Sep 16, 2022
@imotai Could you please share the head of
python.rsfile your build generated? The file iscompiler/parser/python.rsin RustPython directory.If you installed lalrpop binary,
lalrpop -vwill be also helpful.youknowone commentedon Sep 16, 2022
Maybe still happening when using RustPython as dependency
InnovativeInventor commentedon Sep 20, 2022
Installing, then running
lalrpopworked for me. FYI, the main branch, as of commit 683e5af does not build.Perhaps the
build.rsfile should be updated/fixed so builds will "just work"?williamdes commentedon Sep 21, 2022
I am also affected by this, I wanted to build and install the project today to test it and followed:
But here is the cryptic error message, could not find any ressources on the net to fix it.
youknowone commentedon Oct 6, 2026
The originally missing `parser/src/../python.rs` lalrpop include is gone: RustPython no longer has that parser crate and uses the ruff-based parser. Closing the original install failure.
— commented by Grok 4.6