Build error in rustpython-pylib: py_freeze! macro resolves wrong Lib path
Bug Description
The workspace fails to build on Windows (and possibly other platforms) due to a path error in crates/pylib/src/lib.rs. The py_freeze! macro is invoked with dir = "../Lib", but since the pylib crate is inside crates/pylib/, this resolves to crates/Lib instead of the repository root's Lib/ directory. This causes the build to fail for the entire workspace.
Steps to Reproduce
- Clone the repository on a Windows machine (or any machine where relative path resolution matters).
- Run
cargo build --workspace(orcargo build -p rustpython-pylib). - Observe the build error related to the
py_freeze!macro not finding theLibdirectory.
Expected Behavior
The py_freeze! macro should correctly find the Lib/ directory at the repository root, and the build should succeed.
Actual Behavior
Build fails with an error indicating that the directory ../Lib cannot be found or is empty.
Environment
- OS: Windows (also likely affects other OSes depending on Cargo's working directory)
- Rust version: (output of
rustc --version) - RustPython commit: (latest
mainat the time of reporting)
Possible Solution
Change the path in crates/pylib/src/lib.rs from "../Lib" to "../../Lib" so that it correctly points to the root Lib/ directory. Alternatively, use CARGO_MANIFEST_DIR to construct an absolute path.
Additional Context
This issue was discovered while running a full workspace build on Windows. All other crates reference Lib/ correctly; only pylib seems to have this broken relative path.