Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Crashes with arm64-darwin #135

Open
ankane opened this issue Jan 22, 2023 · 4 comments
Open

Crashes with arm64-darwin #135

ankane opened this issue Jan 22, 2023 · 4 comments

Comments

@ankane
Copy link
Contributor

ankane commented Jan 22, 2023

Hey @ianks,

Users are reporting crashes when loading the precompiled extension on arm64-darwin with two different projects, and was wondering if you've seen this in any of your projects or had any additional thoughts on how to debug.

If not, no worries.

@ankane
Copy link
Contributor Author

ankane commented Jan 22, 2023

Looks like it was due to the strip option breaking code signing.

[profile.release]
strip = true

Ref: ankane/tokenizers-ruby#10 (comment)

@ianks
Copy link
Contributor

ianks commented Jan 23, 2023

Good find. We do not strip binaries at Shopify ATM, mostly because it breaks profilers (such as perf). So I disabled the stripping that RCD was doing by default in favor of allowing users to specify it in Cargo.toml. But given that strip = true in Cargo.toml is breaking things, would be nice to find a fix for that...

@ianks ianks reopened this Jan 23, 2023
@ankane
Copy link
Contributor Author

ankane commented Jan 23, 2023

From what I can tell, the only way to fix is to re-sign (more info). I tried creating a wrapper for strip:

#!/usr/bin/env bash

/opt/osxcross/target/bin/aarch64-apple-darwin-strip $@
codesign -f -s - "${@: -1}"

However, the Docker images don't have the codesign binary. It might be possible to use an alternative like this, but haven't tried it.

@ankane
Copy link
Contributor Author

ankane commented Jan 23, 2023

I think ideally Rust would call codesign after strip (it calls it in another place), but it won't really help this situation.

Edit: Nevermind, think this is specific to the Docker images. Compiling for aarch64-apple-darwin on a x86_64-apple-darwin host doesn't have this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants