Open
Description
Bug Description
https://github.com/PyO3/maturin/blob/main/src/module_writer.rs#L1342
will use mode from symlink, not the linked source file. it should be read permission again from source
file.
Even after this, L1341 looks buggy to me. It tries to read parent of the source, which is usually a directory. Maybe I'm just wrong, but would like to ask devs to review.
Your maturin version (maturin --version
)
main branch
Your Python version (python -V
)
Python 3.10.0
Your pip version (pip -V
)
N/A
What bindings you're using
None
Does cargo build
work?
- Yes, it works
If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /
)?
- Yes
Steps to Reproduce
data="data"
in pyproject.toml- mkdir -p data/data
- cd data/data; ln -s ../../README.md
RUST_LOG=DEBUG maturin build
shows:
🐍 Found CPython 3.12 at /usr/bin/python3
📡 Using build options profile, features from pyproject.toml
2024-05-04T06:35:48.649561Z DEBUG maturin::compile: Setting PYO3_PYTHON to /usr/bin/python3
2024-05-04T06:35:48.649566Z DEBUG maturin::compile: Running env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.12-64bit" PYO3_PYTHON="/usr/bin/python3" PYTHON_SYS_EXECUTABLE="/usr/bin/python3" "cargo" "rustc" "--profile" "release" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/home/blmarket/proj/llm-daemon/bihyung/Cargo.toml" "--lib"
Finished `release` profile [optimized] target(s) in 0.06s
2024-05-04T06:35:48.795601Z DEBUG maturin::module_writer: Adding bihyung-0.2.10.dist-info/METADATA
2024-05-04T06:35:48.795654Z DEBUG maturin::module_writer: Adding bihyung-0.2.10.dist-info/WHEEL
2024-05-04T06:35:48.795688Z DEBUG maturin::module_writer: Adding bihyung/__init__.py
2024-05-04T06:35:48.795719Z DEBUG maturin::module_writer: Adding bihyung/bihyung.cpython-312-x86_64-linux-gnu.so from /home/blmarket/proj/llm-daemon/target/release/maturin/libbihyung.so
2024-05-04T06:35:49.082972Z DEBUG maturin::module_writer: Adding data from /home/blmarket/proj/llm-daemon/bihyung/data/data
2024-05-04T06:35:49.082999Z DEBUG maturin::module_writer: Adding data/data/README.md from ../..
💥 maturin failed
Caused by: Failed to include data from /home/blmarket/proj/llm-daemon/bihyung/data
Caused by: Failed to read ../..
Caused by: failed to read from file `../..`
Caused by: Is a directory (os error 21)