Skip to content

Commit

Permalink
Shared libraries also need executable bit (#110)
Browse files Browse the repository at this point in the history
* Shared libraries also need executable bit

Shared libraries on Linux, macOS, and other Unix-like operating systems
require the executable bit, too.

Fixes: #109
Signed-off-by: Christian Heimes <[email protected]>

* Add changelog entry

Signed-off-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored Feb 11, 2021
1 parent eac6ce1 commit 131c9c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Respect `PYO3_PYTHON` and `PYTHON_SYS_EXECUTABLE` environment variables if set. [#96](https://github.com/PyO3/setuptools-rust/pull/96)
- Add runtime dependency on setuptools >= 46.1. [#102](https://github.com/PyO3/setuptools-rust/pull/102)
- Append to, rather than replace, existing RUSTFLAGS when building. [#103](https://github.com/PyO3/setuptools-rust/pull/103)
- Set executable bit on shared library. [#110](https://github.com/PyO3/setuptools-rust/pull/110)

## 0.11.6 (2020-12-13)

Expand Down
10 changes: 5 additions & 5 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ def build_extension(self, ext):
except subprocess.CalledProcessError as e:
pass

# executables and win32(cygwin)-dll's need X bits
if executable or sys.platform == "win32" or sys.platform == "cygwin":
mode = os.stat(ext_path).st_mode
mode |= (mode & 0o444) >> 2 # copy R bits to X
os.chmod(ext_path, mode)
# executables, win32(cygwin)-dll's, and shared libraries on
# Unix-like operating systems need X bits
mode = os.stat(ext_path).st_mode
mode |= (mode & 0o444) >> 2 # copy R bits to X
os.chmod(ext_path, mode)

def run(self):
if not self.extensions:
Expand Down

0 comments on commit 131c9c1

Please sign in to comment.