Implement a more robust way of locating rust-analyzer
When bundled, we will retrieve it out of the `Resources` folder. Locally, we're expected to run `script/download-rust-analyzer` and put `vendor/bin` in our $PATH.
This commit is contained in:
+8
-2
@@ -2,6 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
export BUNDLE=true
|
||||
|
||||
# Install cargo-bundle 0.5.0 if it's not already installed
|
||||
cargo install cargo-bundle --version 0.5.0
|
||||
|
||||
@@ -11,10 +13,14 @@ cargo bundle --release --target x86_64-apple-darwin
|
||||
popd > /dev/null
|
||||
|
||||
# Build the binary for aarch64 (Apple M1)
|
||||
cargo build --release --target aarch64-apple-darwin
|
||||
# cargo build --release --target aarch64-apple-darwin
|
||||
|
||||
# Replace the bundle's binary with a "fat binary" that combines the two architecture-specific binaries
|
||||
lipo -create target/x86_64-apple-darwin/release/Zed target/aarch64-apple-darwin/release/Zed -output target/x86_64-apple-darwin/release/bundle/osx/Zed.app/Contents/MacOS/zed
|
||||
# lipo -create target/x86_64-apple-darwin/release/Zed target/aarch64-apple-darwin/release/Zed -output target/x86_64-apple-darwin/release/bundle/osx/Zed.app/Contents/MacOS/zed
|
||||
|
||||
# Bundle rust-analyzer
|
||||
cp vendor/bin/rust-analyzer-x86_64-apple-darwin target/x86_64-apple-darwin/release/bundle/osx/Zed.app/Contents/Resources/
|
||||
cp vendor/bin/rust-analyzer-aarch64-apple-darwin target/x86_64-apple-darwin/release/bundle/osx/Zed.app/Contents/Resources/
|
||||
|
||||
# Sign the app bundle with an ad-hoc signature so it runs on the M1. We need a real certificate but this works for now.
|
||||
if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then
|
||||
|
||||
Reference in New Issue
Block a user