Skip to content

Commit

Permalink
Fix recompiles causing Pants to be killed on M1 machines (#11580)
Browse files Browse the repository at this point in the history
As of #11558, any recompile of Rust resulted in the Pants process being killed when the `native_engine.so` was not the same as before:

```
❯ MODE=debug ./pants --no-pantsd
Building native engine
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
[1]    82837 killed     MODE=debug ./pants --no-pantsd
```

The workaround is to delete `native_engine.so` beforehand, for some unknown reason. This automates that fix.

[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano committed Mar 12, 2021
1 parent 2649b5d commit beb51ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build-support/bin/rust/bootstrap_code.sh
Expand Up @@ -68,6 +68,9 @@ function bootstrap_native_code() {
engine_version_calculated="$(calculate_current_hash)"

# Create the native engine resource.
# NB: On Mac Silicon, for some reason, first removing the old native_engine.so is necessary to avoid the Pants
# process from being killed when recompiling.
rm -f "${NATIVE_ENGINE_RESOURCE}"
cp "${native_binary}" "${NATIVE_ENGINE_RESOURCE}"

# Create the accompanying metadata file.
Expand Down

0 comments on commit beb51ac

Please sign in to comment.