Skip to content

Commit 131c9c1

Browse files
authored
Shared libraries also need executable bit (#110)
* 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]>
1 parent eac6ce1 commit 131c9c1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Respect `PYO3_PYTHON` and `PYTHON_SYS_EXECUTABLE` environment variables if set. [#96](https://github.com/PyO3/setuptools-rust/pull/96)
66
- Add runtime dependency on setuptools >= 46.1. [#102](https://github.com/PyO3/setuptools-rust/pull/102)
77
- Append to, rather than replace, existing RUSTFLAGS when building. [#103](https://github.com/PyO3/setuptools-rust/pull/103)
8+
- Set executable bit on shared library. [#110](https://github.com/PyO3/setuptools-rust/pull/110)
89

910
## 0.11.6 (2020-12-13)
1011

setuptools_rust/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ def build_extension(self, ext):
325325
except subprocess.CalledProcessError as e:
326326
pass
327327

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

334334
def run(self):
335335
if not self.extensions:

0 commit comments

Comments
 (0)