From 989d0b70598f9376ac74835e86e59c006e07f5ff Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 13:56:04 -0700 Subject: [PATCH 1/6] Remove Intel mac CircleCI configuration --- .circleci/config.yml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31f090e68b..05da6029c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,6 @@ executors: ubuntu: docker: - image: buildpack-deps:focal - mac: - environment: - EMSDK_NOTTY: "1" - # Without this, any `brew install` command will result in self-update of - # brew itself which takes more than 4 minutes. - HOMEBREW_NO_AUTO_UPDATE: "1" - macos: - xcode: "12.5.1" - resource_class: macos.x86.medium.gen2 mac_arm64: environment: EMSDK_NOTTY: "1" @@ -94,11 +85,6 @@ jobs: name: Install debian packages command: sudo apt-get update -q && sudo apt-get install -q cmake build-essential openjdk-8-jre-headless - run: test/test.sh - test-mac: - executor: mac - steps: - - setup-macos - - test-macos test-mac-arm64: executor: mac_arm64 steps: @@ -257,8 +243,8 @@ jobs: apt-get install -q -y bazel - run: test/test_bazel.sh - test-bazel-mac: - executor: mac + test-bazel-mac-arm64: + executor: mac_arm64 steps: - checkout - run: brew install grep @@ -301,9 +287,6 @@ workflows: test-linux-arm64: jobs: - test-linux-arm64 - test-mac: - jobs: - - test-mac test-mac-arm64: jobs: - test-mac-arm64 @@ -328,9 +311,9 @@ workflows: test-bazel-linux: jobs: - test-bazel-linux - test-bazel-mac: + test-bazel-mac-arm64: jobs: - - test-bazel-mac + - test-bazel-mac-arm64 test-bazel-windows: jobs: - test-bazel-windows From e3a58faf07826bda8070faa698f778c1bbc1e332 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 15:09:51 -0700 Subject: [PATCH 2/6] try just grep --- test/test_bazel_mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_bazel_mac.sh b/test/test_bazel_mac.sh index 4b58b502bd..3770219879 100755 --- a/test/test_bazel_mac.sh +++ b/test/test_bazel_mac.sh @@ -6,7 +6,7 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(ggrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ +VER=$(grep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ emscripten-releases-tags.json \ | sed "s/\./\\\./g") # Based on the latest version number, get the commit hash for that version. From 867b63d9ebf4a9c1114362dde5417c404a561c0c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 15:12:04 -0700 Subject: [PATCH 3/6] bogus command --- test/test_bazel_mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_bazel_mac.sh b/test/test_bazel_mac.sh index 3770219879..0066cfca7c 100755 --- a/test/test_bazel_mac.sh +++ b/test/test_bazel_mac.sh @@ -6,7 +6,7 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(grep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ +VER=$(blahgrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ emscripten-releases-tags.json \ | sed "s/\./\\\./g") # Based on the latest version number, get the commit hash for that version. From 513b74830c522184f30f4122731628c0570158da Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 15:15:40 -0700 Subject: [PATCH 4/6] split --- test/test_bazel_mac.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_bazel_mac.sh b/test/test_bazel_mac.sh index 0066cfca7c..e239f57b37 100755 --- a/test/test_bazel_mac.sh +++ b/test/test_bazel_mac.sh @@ -6,8 +6,9 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(blahgrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ - emscripten-releases-tags.json \ +VER1=$(ggrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ + emscripten-releases-tags.json) +VER=$(echo $VER1 | sed "s/\./\\\./g") # Based on the latest version number, get the commit hash for that version. HASH=$(grep "\"${VER}\"" emscripten-releases-tags.json \ From c6f380a227f9cd5bcf999c6f234c3a4d68820790 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 15:34:00 -0700 Subject: [PATCH 5/6] just use python instead of grep --- .circleci/config.yml | 1 - scripts/get_release_info.py | 25 +++++++++++++++++++++++++ test/test_bazel_mac.sh | 10 +++------- 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100755 scripts/get_release_info.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 05da6029c0..91074c9361 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -247,7 +247,6 @@ jobs: executor: mac_arm64 steps: - checkout - - run: brew install grep - run: name: install bazelisk command: | diff --git a/scripts/get_release_info.py b/scripts/get_release_info.py new file mode 100755 index 0000000000..01044cad94 --- /dev/null +++ b/scripts/get_release_info.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import json +import os +import sys + +def get_latest(tagfile): + with open(tagfile) as f: + versions = json.load(f) + print(versions['aliases']['latest']) + return 0 + + +def get_hash(tagfile, version): + with open(tagfile) as f: + versions = json.load(f) + print(versions['releases'][version]) + return 0 + + +if __name__ == '__main__': + if sys.argv[2] == 'latest': + sys.exit(get_latest(sys.argv[1])) + if sys.argv[2] == 'hash': + sys.exit(get_hash(sys.argv[1], sys.argv[3])) diff --git a/test/test_bazel_mac.sh b/test/test_bazel_mac.sh index e239f57b37..fa31103632 100755 --- a/test/test_bazel_mac.sh +++ b/test/test_bazel_mac.sh @@ -6,14 +6,10 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER1=$(ggrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ - emscripten-releases-tags.json) -VER=$(echo $VER1 - | sed "s/\./\\\./g") +VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest) + # Based on the latest version number, get the commit hash for that version. -HASH=$(grep "\"${VER}\"" emscripten-releases-tags.json \ - | grep -v latest \ - | cut -f4 -d\") +HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER}) FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!" From 7847bb7760d36af4913ade4cef86918fd51a622b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 20 Jun 2024 15:35:28 -0700 Subject: [PATCH 6/6] make Linux match --- test/test_bazel.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/test_bazel.sh b/test/test_bazel.sh index d8d40e1716..51500acee0 100755 --- a/test/test_bazel.sh +++ b/test/test_bazel.sh @@ -6,13 +6,10 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(grep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ - emscripten-releases-tags.json \ - | sed --expression "s/\./\\\./g") +VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest) + # Based on the latest version number, get the commit hash for that version. -HASH=$(grep "\"${VER}\"" emscripten-releases-tags.json \ - | grep -v latest \ - | cut -f4 -d\") +HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER}) FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!"