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 (or cargo build -p rustpython-pylib).
- Observe the build error related to the
py_freeze! macro not finding the Lib directory.
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
main at 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.
Bug Description
The workspace fails to build on Windows (and possibly other platforms) due to a path error in
crates/pylib/src/lib.rs. Thepy_freeze!macro is invoked withdir = "../Lib", but since thepylibcrate is insidecrates/pylib/, this resolves tocrates/Libinstead of the repository root'sLib/directory. This causes the build to fail for the entire workspace.Steps to Reproduce
cargo build --workspace(orcargo build -p rustpython-pylib).py_freeze!macro not finding theLibdirectory.Expected Behavior
The
py_freeze!macro should correctly find theLib/directory at the repository root, and the build should succeed.Actual Behavior
Build fails with an error indicating that the directory
../Libcannot be found or is empty.Environment
rustc --version)mainat the time of reporting)Possible Solution
Change the path in
crates/pylib/src/lib.rsfrom"../Lib"to"../../Lib"so that it correctly points to the rootLib/directory. Alternatively, useCARGO_MANIFEST_DIRto construct an absolute path.Additional Context
This issue was discovered while running a full workspace build on Windows. All other crates reference
Lib/correctly; onlypylibseems to have this broken relative path.