sapling/distutils_rust
Jun Wu fb45633a19 distutils_rust: use atomic replace to install the .so file
Summary:
Python loads .so using mmap. Rewriting a .so in-place when there is a Python
process with that .so mmap-ed could crash that Python process. Therefore
let's avoid rewriting the destination .so in-place.

This was discovered by a txnclose Python hook I used to keep binaries
up-to-date. It caused segfault after building the Rust extensions currently
loaded by the Python process running the hook.

Test Plan: `hg push` triggering that txnclose hook won't crash on the remote.

Reviewers: durham, #sourcecontrol

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6686739

Signature: 6686739:1515532516:24c0b7066ff15a39a7bd824e779569f4a886d7df
2018-01-09 13:05:51 -08:00
..
__init__.py distutils_rust: use atomic replace to install the .so file 2018-01-09 13:05:51 -08:00