From 9be4f35aa92f4addd91f44051d1aa2b0e2abac6b Mon Sep 17 00:00:00 2001 From: Twan Wolthof Date: Thu, 25 Mar 2021 15:54:17 +0000 Subject: [PATCH 1/3] Address lint issue for newer versions of rustc/clippy Lint failure observed using `rustc 1.51.0 (2fd73fabe 2021-03-23)`. --- src/token_collector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/token_collector.rs b/src/token_collector.rs index 3225174..fa544b2 100644 --- a/src/token_collector.rs +++ b/src/token_collector.rs @@ -255,7 +255,7 @@ fn highlight_space_between_words(row: &mut [StyledToken]) { Nothing, HighlightedWord, WordSpace, - }; + } let mut found_state = FoundState::Nothing; let mut previous_token: Option<&mut StyledToken> = None; From 161a26ed4794717d4b443ab87f5c559f57a3f0cd Mon Sep 17 00:00:00 2001 From: Twan Wolthof Date: Thu, 25 Mar 2021 15:54:19 +0000 Subject: [PATCH 2/3] Release two architectures for macOS --- release.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/release.sh b/release.sh index bcbedb0..70846df 100755 --- a/release.sh +++ b/release.sh @@ -81,15 +81,18 @@ read -r -p "Press ENTER when ready: " git tag --annotate "$NEW_VERSION_NUMBER" -# Build a macOS AMD64 binary -cargo build --release --target=x86_64-apple-darwin -if ! ./target/x86_64-apple-darwin/release/riff --version | grep -E " $NEW_VERSION_NUMBER\$" > /dev/null ; then - >&2 echo "" - >&2 echo "ERROR: Version number <$NEW_VERSION_NUMBER> not found in --version output:" - ./target/x86_64-apple-darwin/release/riff --version - exit 1 -fi -cp "target/x86_64-apple-darwin/release/riff" "riff-$NEW_VERSION_NUMBER-x86_64-macos" +# Build macOS binaries +targets=(aarch64-apple-darwin x86_64-apple-darwin) +for target in $targets; do + cargo build --release "--target=$target" + if ! ./target/$target/release/riff --version | grep -E " $NEW_VERSION_NUMBER\$" > /dev/null ; then + >&2 echo "" + >&2 echo "ERROR: Version number <$NEW_VERSION_NUMBER> not found in --version output:" + ./target/$target/release/riff --version + exit 1 + fi + cp "target/$target/release/riff" "riff-$NEW_VERSION_NUMBER-x86_64-macos" +done # Build a Linux-x64 binary on macOS # From 1b455f1185db93582a752cb9f9024b5d2f5b0053 Mon Sep 17 00:00:00 2001 From: Twan Wolthof Date: Thu, 1 Apr 2021 09:25:41 +0000 Subject: [PATCH 3/3] Update release.sh Co-authored-by: Johan Walles --- release.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/release.sh b/release.sh index 10e8644..a57d8be 100755 --- a/release.sh +++ b/release.sh @@ -110,19 +110,30 @@ fi EXPECTED_VERSION_NUMBER=$(git describe --dirty=-modified) # Build macOS binaries -targets=(aarch64-apple-darwin x86_64-apple-darwin) +targets="aarch64-apple-darwin x86_64-apple-darwin" for target in $targets; do rustup target add $target - cargo build --release "--target=$target" - if ! ./target/$target/release/riff --version | grep -E " $EXPECTED_VERSION_NUMBER\$" >/dev/null; then - echo >&2 "" - echo >&2 "ERROR: Version number <$EXPECTED_VERSION_NUMBER> not found in --version output:" - ./target/$target/release/riff --version - exit 1 - fi - $LIVE && cp "target/$target/release/riff" "riff-$EXPECTED_VERSION_NUMBER-x86_64-macos" + + # From: https://stackoverflow.com/a/66875783/473672 + SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \ + MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \ + cargo build --release "--target=$target" done +# From: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary#Update-the-Architecture-List-of-Custom-Makefiles +lipo -create \ + -output target/riff-universal-apple-darwin-release \ + target/aarch64-apple-darwin/release/riff \ + target/x86_64-apple-darwin/release/riff + +if ! target/riff-universal-apple-darwin-release --version | grep -E " $EXPECTED_VERSION_NUMBER\$" >/dev/null; then + echo >&2 "" + echo >&2 "ERROR: Version number <$EXPECTED_VERSION_NUMBER> not found in --version output:" + target/riff-universal-apple-darwin-release --version + exit 1 +fi +$LIVE && cp "target/riff-universal-apple-darwin-release" "riff-$EXPECTED_VERSION_NUMBER-universal-macos" + # Build a Linux-x64 binary on macOS # # From: https://timryan.org/2018/07/27/cross-compiling-linux-binaries-from-macos.html