Skip to content

Fix data symlink permission handling#3069

Merged
messense merged 1 commit into
PyO3:mainfrom
messense:issue-2068-data-symlink
Mar 8, 2026
Merged

Fix data symlink permission handling#3069
messense merged 1 commit into
PyO3:mainfrom
messense:issue-2068-data-symlink

Conversation

@messense

@messense messense commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary

  • resolve data symlink targets relative to the symlink location
  • copy file contents and executable bits from the symlink target instead of the symlink
  • add a regression test covering relative symlink targets and permissions

Closes #2068

Testing

  • cargo test module_writer --lib

@messense messense force-pushed the issue-2068-data-symlink branch from b0c6bfc to 68c4836 Compare March 8, 2026 07:37
@messense messense requested a review from Copilot March 8, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes how data directory symlinks are handled when building wheels by resolving relative symlink targets from the symlink’s directory and reading permissions from the symlink target, plus adds a regression test.

Changes:

  • Resolve relative symlink targets relative to the symlink’s parent directory.
  • Use the symlink target’s metadata (contents + executable bit) when adding files.
  • Add a Unix-only regression test for relative symlinks and permission propagation.

Comment thread src/module_writer/mod.rs
Comment thread src/module_writer/mod.rs
Comment thread src/module_writer/mod.rs
Comment thread src/module_writer/mod.rs
Comment thread src/module_writer/mod.rs
@messense messense merged commit e9747a1 into PyO3:main Mar 8, 2026
48 of 49 checks passed
@messense messense deleted the issue-2068-data-symlink branch March 8, 2026 08:20
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Apr 14, 2026
https://build.opensuse.org/request/show/1346282
by user mia + dimstar_suse
- Update to version 1.13.1
  * fix: fall back to placeholder for abi3 when found interpreters
    are too old
    gh#PyO3/maturin#3126
- Changes in version 1.13.0:
  * Sync legacy_py.rs with upstream PyPI warehouse legacy.py
    gh#PyO3/maturin#3053
  * Fix --strip conflicting with --include-debuginfo in develop
    gh#PyO3/maturin#3057
  * Fix abi3 wheel producing version-specific tags for CPython
    below minimum
    gh#PyO3/maturin#3061
  * Fix data symlink permission handling
    gh#PyO3/maturin#3069
  * fix: correct bugs in audit.rs typo and module_writer
    gh#PyO3/maturin#3070
  * perf: use lazy-initialized regexes instead of per-call
    compilation
    gh#PyO3/maturin#3071
  * fix: skip legacy manylinux aliases not in PyPI allow-list
    gh#PyO3/maturin#3078
  * fix: auto-generat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data always set file permission as executable

2 participants