From 5f810745bc5b27943c951d32191ad58f12e42534 Mon Sep 17 00:00:00 2001 From: GoodNotesCI Date: Sat, 25 Nov 2023 19:49:16 +0800 Subject: [PATCH 01/35] Run build command --- .../generate-xcframework-maccatalyst.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/generate-xcframework-maccatalyst.yml diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml new file mode 100644 index 0000000000000..9fd3891a82684 --- /dev/null +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -0,0 +1,38 @@ +name: "Build XCFramework for MacCatalyst" + +on: + workflow_dispatch: + branches: [main, develop] + +jobs: + build_macabi_xcf: + runs-on: macos-latest + steps: + - name: check Xcode version + run: /usr/bin/xcodebuild -version + + - name: checkout repository + uses: actions/checkout@v3 + + - name: install protoc + run : | + mkdir -p $HOME/Downloads + cd $HOME/Downloads + curl +https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip +--output $HOME/Downloads/protoc-21.12.zip + unzip protoc-21.12-osx-universal_binary.zip + mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 + mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ + + - name: create directory to store the library + run: mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320 + + - name: create release build + run: python tools/ci_build/github/apple/build_macabi_framework.py --config Release +--build_dir +$HOME/onnxlibrary/macabi_release_v20230327_2320 --include_ops_by_config +tools/ci_build/github/apple/hws_mobile_package.required_operators.config --path_to_protoc_exe +/usr/local/bin/protoc-3.21.12.0 +tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json + From 3735ac55c9ef6f36a274cde4e1a92775f6613f08 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 19:57:05 +0800 Subject: [PATCH 02/35] Multiline command --- .../generate-xcframework-maccatalyst.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 9fd3891a82684..ee4d5d44f1711 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -2,7 +2,10 @@ name: "Build XCFramework for MacCatalyst" on: workflow_dispatch: - branches: [main, develop] + push: + #workflow_dispatch: + # branches: [main, develop] + jobs: build_macabi_xcf: @@ -29,10 +32,8 @@ https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.1 run: mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320 - name: create release build - run: python tools/ci_build/github/apple/build_macabi_framework.py --config Release ---build_dir -$HOME/onnxlibrary/macabi_release_v20230327_2320 --include_ops_by_config -tools/ci_build/github/apple/hws_mobile_package.required_operators.config --path_to_protoc_exe -/usr/local/bin/protoc-3.21.12.0 -tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json + run: python tools/ci_build/github/apple/build_macabi_framework.py --config Release \ + --build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \ + --include_ops_by_config tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ + --path_to_protoc_exe /usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 2280b8bd8065dafdd500ef35b804553b8aa76712 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:02:15 +0800 Subject: [PATCH 03/35] Multiline command --- .github/workflows/generate-xcframework-maccatalyst.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index ee4d5d44f1711..1210abb206ecc 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -21,9 +21,7 @@ jobs: run : | mkdir -p $HOME/Downloads cd $HOME/Downloads - curl -https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip ---output $HOME/Downloads/protoc-21.12.zip + curl https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip --output $HOME/Downloads/protoc-21.12.zip unzip protoc-21.12-osx-universal_binary.zip mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ @@ -36,4 +34,3 @@ https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.1 --build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe /usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json - From a4cd5f7c1621316dce57e558150c56110f79e22e Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:06:48 +0800 Subject: [PATCH 04/35] Fix curl command --- .github/workflows/generate-xcframework-maccatalyst.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 1210abb206ecc..08e1611e89b8f 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -21,7 +21,8 @@ jobs: run : | mkdir -p $HOME/Downloads cd $HOME/Downloads - curl https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip --output $HOME/Downloads/protoc-21.12.zip + curl -k https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip --output +$HOME/Downloads/protoc-21.12.zip unzip protoc-21.12-osx-universal_binary.zip mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ From d8ea8887bb83a7fe22af4fee443d9174a332673e Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:12:32 +0800 Subject: [PATCH 05/35] Fix output file path --- .github/workflows/generate-xcframework-maccatalyst.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 08e1611e89b8f..1d623a450dd78 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -21,8 +21,7 @@ jobs: run : | mkdir -p $HOME/Downloads cd $HOME/Downloads - curl -k https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip --output -$HOME/Downloads/protoc-21.12.zip + curl -k https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip unzip protoc-21.12-osx-universal_binary.zip mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ From b1a34d49fe05811ec9f9ed553ebd9b059df00707 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:29:31 +0800 Subject: [PATCH 06/35] Use LJO in curl --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 1d623a450dd78..4ee5c8ee79bbf 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -21,7 +21,7 @@ jobs: run : | mkdir -p $HOME/Downloads cd $HOME/Downloads - curl -k https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip + curl -LJO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip unzip protoc-21.12-osx-universal_binary.zip mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ From 08a288422ff9f4829ad6a4ffb623698084b17216 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:38:00 +0800 Subject: [PATCH 07/35] Unzip to destination folder --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 4ee5c8ee79bbf..623f1aab9cb83 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -22,7 +22,7 @@ jobs: mkdir -p $HOME/Downloads cd $HOME/Downloads curl -LJO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip - unzip protoc-21.12-osx-universal_binary.zip + unzip protoc-21.12-osx-universal_binary.zip -d protoc-21.12-osx-universal_binary mv protoc-21.12-osx-universal_binary/bin/protoc /usr/local/bin/protoc-3.21.12.0 mv protoc-21.12-osx-universal_binary/include/* /usr/local/include/ From 7f04420243f0a85e1fb5ff100d7113ba3e059337 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:40:10 +0800 Subject: [PATCH 08/35] Use Python 3 --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 623f1aab9cb83..4845e691b6313 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -30,7 +30,7 @@ jobs: run: mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320 - name: create release build - run: python tools/ci_build/github/apple/build_macabi_framework.py --config Release \ + run: python3 tools/ci_build/github/apple/build_macabi_framework.py --config Release \ --build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe /usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 5f5e915015a4d5826f155970fd7af279da4e89d0 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 20:52:35 +0800 Subject: [PATCH 09/35] Correct indendation of multiline command --- .github/workflows/generate-xcframework-maccatalyst.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 4845e691b6313..a757cd94d2604 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -30,7 +30,7 @@ jobs: run: mkdir -p $HOME/onnxlibrary/macabi_release_v20230327_2320 - name: create release build - run: python3 tools/ci_build/github/apple/build_macabi_framework.py --config Release \ - --build_dir $HOME/onnxlibrary/macabi_release_v20230327_2320 \ - --include_ops_by_config tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ - --path_to_protoc_exe /usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json + run: | + python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ + --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ + --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 0bf94adbce4ec4c013d33dc3ad5ebac53881eaed Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:01:54 +0800 Subject: [PATCH 10/35] Install package fromm requirements.txt --- .github/workflows/generate-xcframework-maccatalyst.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index a757cd94d2604..4e967d843bac7 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -11,8 +11,10 @@ jobs: build_macabi_xcf: runs-on: macos-latest steps: - - name: check Xcode version - run: /usr/bin/xcodebuild -version + - name: check Xcode version and Python 3 + run: | + /usr/bin/xcodebuild -version + python3 --version - name: checkout repository uses: actions/checkout@v3 @@ -31,6 +33,7 @@ jobs: - name: create release build run: | + pip3 install -r tools/ci_build/requirements.txt python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 65fc1685835abefb8371a735a56e26701ebed1c8 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:07:50 +0800 Subject: [PATCH 11/35] Fix distutils in Python 3.12 --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 4e967d843bac7..81aaa90217923 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -34,6 +34,8 @@ jobs: - name: create release build run: | pip3 install -r tools/ci_build/requirements.txt + # Since Python 3.12, distutils is removed + pip3 install setuptools python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 8caaffa90fd14ca73cfcef6a9010a544b5fd00a8 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:10:35 +0800 Subject: [PATCH 12/35] Fix distutils in Python 3.12 --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 81aaa90217923..4357b73f46580 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -33,9 +33,9 @@ jobs: - name: create release build run: | - pip3 install -r tools/ci_build/requirements.txt # Since Python 3.12, distutils is removed pip3 install setuptools + pip3 install -r tools/ci_build/requirements.txt python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From d1be4f8bfbb9dcabcffe80f0bdc3c0b59fd3a9d7 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:16:43 +0800 Subject: [PATCH 13/35] Downgrade Python --- .github/workflows/generate-xcframework-maccatalyst.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 4357b73f46580..f37b947145b34 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,6 +14,8 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version + brew uninstall --ignore-dependencies python@3.10 + brew install python@3.10 python3 --version - name: checkout repository @@ -34,7 +36,7 @@ jobs: - name: create release build run: | # Since Python 3.12, distutils is removed - pip3 install setuptools + # pip3 install setuptools pip3 install -r tools/ci_build/requirements.txt python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From 9260ae133881ac493991fc72bb49079dbff5475f Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:20:48 +0800 Subject: [PATCH 14/35] brew install python3 --- .github/workflows/generate-xcframework-maccatalyst.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index f37b947145b34..0f136ffe29bbe 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,8 +14,8 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - brew uninstall --ignore-dependencies python@3.10 - brew install python@3.10 + brew uninstall --ignore-dependencies python3@3.10 + brew install python3@3.10 python3 --version - name: checkout repository From d1e9b49977861bc31fab675e17411b11fbf876dc Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:23:13 +0800 Subject: [PATCH 15/35] Remove python from system --- .github/workflows/generate-xcframework-maccatalyst.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 0f136ffe29bbe..1b51565ac9f1c 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,8 +14,9 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - brew uninstall --ignore-dependencies python3@3.10 - brew install python3@3.10 + brew uninstall --ignore-dependencies python@3.10 + brew install python@3.10 + brew install python3 python3 --version - name: checkout repository From c3db51824447d62b96182318a46319adb9672005 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:27:11 +0800 Subject: [PATCH 16/35] Show python version --- .github/workflows/generate-xcframework-maccatalyst.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 1b51565ac9f1c..c5dfaab370876 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -18,6 +18,7 @@ jobs: brew install python@3.10 brew install python3 python3 --version + python --version - name: checkout repository uses: actions/checkout@v3 From c3dc25c942d1b8e14649205e22130b6ec1bc556d Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:32:43 +0800 Subject: [PATCH 17/35] Change python alias --- .../workflows/generate-xcframework-maccatalyst.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index c5dfaab370876..0960363474b1b 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,9 +14,11 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - brew uninstall --ignore-dependencies python@3.10 - brew install python@3.10 - brew install python3 + #brew uninstall --ignore-dependencies python@3.10 + #brew install python@3.10 + #brew install python3 + alias python3=/opt/homebrew/bin/python3 + alias python=/opt/homebrew/bin/python3 python3 --version python --version @@ -39,7 +41,7 @@ jobs: run: | # Since Python 3.12, distutils is removed # pip3 install setuptools - pip3 install -r tools/ci_build/requirements.txt - python3 tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ + pip install -r tools/ci_build/requirements.txt + python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 5a550bc91bf13054a8e262b1a345678d7ded8ec5 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:35:22 +0800 Subject: [PATCH 18/35] Change python alias --- .github/workflows/generate-xcframework-maccatalyst.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 0960363474b1b..59bf86f955fe3 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,9 +14,9 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - #brew uninstall --ignore-dependencies python@3.10 - #brew install python@3.10 - #brew install python3 + brew uninstall --ignore-dependencies python@3.10 + brew install python@3.10 + brew install python3 alias python3=/opt/homebrew/bin/python3 alias python=/opt/homebrew/bin/python3 python3 --version From 6162fea44162e49cdf892299d896c16d584b33a2 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:41:30 +0800 Subject: [PATCH 19/35] Change python alias --- .github/workflows/generate-xcframework-maccatalyst.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 59bf86f955fe3..cda982014ce3a 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -16,9 +16,9 @@ jobs: /usr/bin/xcodebuild -version brew uninstall --ignore-dependencies python@3.10 brew install python@3.10 - brew install python3 - alias python3=/opt/homebrew/bin/python3 - alias python=/opt/homebrew/bin/python3 + #brew install python3 + alias python3=/usr/local/bin/python3.10 + alias python=/usr/local/bin/python3.10 python3 --version python --version From aedd660b238cfc8383ed520386d0f3f438338fbd Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:51:31 +0800 Subject: [PATCH 20/35] List all python --- .github/workflows/generate-xcframework-maccatalyst.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index cda982014ce3a..80d1113d7ee20 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -17,6 +17,9 @@ jobs: brew uninstall --ignore-dependencies python@3.10 brew install python@3.10 #brew install python3 + ls /usr/local/bin/python* + echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc + echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc alias python3=/usr/local/bin/python3.10 alias python=/usr/local/bin/python3.10 python3 --version From fce64aef6515e3d9c9a45282fef06a5388bf4784 Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 21:57:10 +0800 Subject: [PATCH 21/35] List all python --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 80d1113d7ee20..bfe44f31a8ae8 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -14,7 +14,7 @@ jobs: - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - brew uninstall --ignore-dependencies python@3.10 + brew uninstall --ignore-dependencies python brew install python@3.10 #brew install python3 ls /usr/local/bin/python* From 80244b2876f9fdf4d9ccd9e26805e2daa3cb993b Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 22:03:47 +0800 Subject: [PATCH 22/35] Overwrite link --- .github/workflows/generate-xcframework-maccatalyst.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index bfe44f31a8ae8..b1f439eb7bb60 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -22,6 +22,7 @@ jobs: echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc alias python3=/usr/local/bin/python3.10 alias python=/usr/local/bin/python3.10 + brew link --overwrite python@3.10 python3 --version python --version From 887d6eee0f855ab03d8a7f207e5306b4d73f482e Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 22:08:15 +0800 Subject: [PATCH 23/35] brew uninstall new version of Pythons --- .github/workflows/generate-xcframework-maccatalyst.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index b1f439eb7bb60..06f784f08a970 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -15,11 +15,14 @@ jobs: run: | /usr/bin/xcodebuild -version brew uninstall --ignore-dependencies python + brew uninstall --ignore-dependencies python@3.11 + brew uninstall --ignore-dependencies python@3.12 brew install python@3.10 #brew install python3 ls /usr/local/bin/python* echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc + source ~/.zshrc alias python3=/usr/local/bin/python3.10 alias python=/usr/local/bin/python3.10 brew link --overwrite python@3.10 From e8d6ea4340bf0fef38024f2d8c3377af81eaa08d Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 22:12:14 +0800 Subject: [PATCH 24/35] brew switch python --- .../generate-xcframework-maccatalyst.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 06f784f08a970..de85e67775a76 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -15,16 +15,18 @@ jobs: run: | /usr/bin/xcodebuild -version brew uninstall --ignore-dependencies python - brew uninstall --ignore-dependencies python@3.11 - brew uninstall --ignore-dependencies python@3.12 + #brew uninstall --ignore-dependencies python@3.11 + #brew uninstall --ignore-dependencies python@3.12 brew install python@3.10 #brew install python3 ls /usr/local/bin/python* - echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc - echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc - source ~/.zshrc - alias python3=/usr/local/bin/python3.10 - alias python=/usr/local/bin/python3.10 + #echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc + #echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc + #source ~/.zshrc + #alias python3=/usr/local/bin/python3.10 + #alias python=/usr/local/bin/python3.10 + brew unlink python + brew switch python 3.10 brew link --overwrite python@3.10 python3 --version python --version From acd01fd4acf17e2e8d80e309b248f7c88a0738fe Mon Sep 17 00:00:00 2001 From: Paco Wong Date: Sat, 25 Nov 2023 22:18:20 +0800 Subject: [PATCH 25/35] Use rm to remove python link --- .github/workflows/generate-xcframework-maccatalyst.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index de85e67775a76..0461bb202443c 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -20,16 +20,18 @@ jobs: brew install python@3.10 #brew install python3 ls /usr/local/bin/python* + rm /usr/local/bin/python /usr/local/bin/python3 #echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc #echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc #source ~/.zshrc - #alias python3=/usr/local/bin/python3.10 - #alias python=/usr/local/bin/python3.10 - brew unlink python - brew switch python 3.10 + alias python3=/usr/local/bin/python3.10 + alias python=/usr/local/bin/python3.10 + #brew unlink python + #brew switch python 3.10 brew link --overwrite python@3.10 python3 --version python --version + which python3 - name: checkout repository uses: actions/checkout@v3 From 8bb42cbf7cc884121840e2a58941771165ce484c Mon Sep 17 00:00:00 2001 From: pacowong Date: Sat, 25 Nov 2023 22:23:57 +0800 Subject: [PATCH 26/35] Cannot remove python --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 0461bb202443c..397c81eebec2b 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -20,7 +20,7 @@ jobs: brew install python@3.10 #brew install python3 ls /usr/local/bin/python* - rm /usr/local/bin/python /usr/local/bin/python3 + rm /usr/local/bin/python3 #echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc #echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc #source ~/.zshrc From c1b421325e52dde6fc95d2718da04ee2d39acf2f Mon Sep 17 00:00:00 2001 From: pacowong Date: Sat, 25 Nov 2023 23:19:59 +0800 Subject: [PATCH 27/35] Use setup-python --- .../generate-xcframework-maccatalyst.yml | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 397c81eebec2b..3cb48d8306e89 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -11,24 +11,14 @@ jobs: build_macabi_xcf: runs-on: macos-latest steps: + - name: install Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: check Xcode version and Python 3 run: | /usr/bin/xcodebuild -version - brew uninstall --ignore-dependencies python - #brew uninstall --ignore-dependencies python@3.11 - #brew uninstall --ignore-dependencies python@3.12 - brew install python@3.10 - #brew install python3 - ls /usr/local/bin/python* - rm /usr/local/bin/python3 - #echo "alias python=/usr/local/bin/python3.10" >> ~/.zshrc - #echo "alias python3=/usr/local/bin/python3.10" >> ~/.zshrc - #source ~/.zshrc - alias python3=/usr/local/bin/python3.10 - alias python=/usr/local/bin/python3.10 - #brew unlink python - #brew switch python 3.10 - brew link --overwrite python@3.10 python3 --version python --version which python3 From 0c4df604590e1d09b8eb2ad8dd8cd4cb83820fdb Mon Sep 17 00:00:00 2001 From: pacowong Date: Sat, 25 Nov 2023 23:36:56 +0800 Subject: [PATCH 28/35] Run build command in github.workspace --- .github/workflows/generate-xcframework-maccatalyst.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 3cb48d8306e89..b8a7dd9013320 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -42,6 +42,7 @@ jobs: run: | # Since Python 3.12, distutils is removed # pip3 install setuptools + cd ${{ github.workspace }} pip install -r tools/ci_build/requirements.txt python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From 1d2a7cf52c4f35f88d6882b7cfea4ac4a3462ef3 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 00:01:27 +0800 Subject: [PATCH 29/35] cd tools/python --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index b8a7dd9013320..47b7c10b9bffc 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -42,7 +42,7 @@ jobs: run: | # Since Python 3.12, distutils is removed # pip3 install setuptools - cd ${{ github.workspace }} + cd ${{ github.workspace }}/tools/python pip install -r tools/ci_build/requirements.txt python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From ea0401b10b42e4264ae1c1e3040dca2d67c1efa8 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 00:06:25 +0800 Subject: [PATCH 30/35] Update generate-xcframework-maccatalyst.yml --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 47b7c10b9bffc..8340e0841bb19 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -43,7 +43,7 @@ jobs: # Since Python 3.12, distutils is removed # pip3 install setuptools cd ${{ github.workspace }}/tools/python - pip install -r tools/ci_build/requirements.txt + pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From efbab19e8a39fc2df0395461d9c643c8d0e5f389 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 00:15:34 +0800 Subject: [PATCH 31/35] Add PYTHONPATH --- .github/workflows/generate-xcframework-maccatalyst.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 8340e0841bb19..6ba3688851504 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -42,7 +42,7 @@ jobs: run: | # Since Python 3.12, distutils is removed # pip3 install setuptools - cd ${{ github.workspace }}/tools/python + export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From 26c53a58a8a07f14173b6c903f1c5e0b83fa2a09 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 00:26:46 +0800 Subject: [PATCH 32/35] Update absolute path --- .github/workflows/generate-xcframework-maccatalyst.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 6ba3688851504..40a0e923da853 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -43,7 +43,8 @@ jobs: # Since Python 3.12, distutils is removed # pip3 install setuptools export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH + cd ${{ github.workspace }}/tools/python pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt - python tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ - --include_ops_by_config=tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ - --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json + python ${{ github.workspace }}/tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ + --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ + --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 ${{ github.workspace }}/tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json From 6bbff3cf92bbf0543eb7bae387142dbe90d93522 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 00:37:02 +0800 Subject: [PATCH 33/35] ls ${{ github.workspace }}/tools/python --- .github/workflows/generate-xcframework-maccatalyst.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 40a0e923da853..0a0bdd4d139d7 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -44,6 +44,7 @@ jobs: # pip3 install setuptools export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH cd ${{ github.workspace }}/tools/python + ls ${{ github.workspace }}/tools/python pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt python ${{ github.workspace }}/tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From 489b11a4cddec01b195448ea9a3b36fe27d83916 Mon Sep 17 00:00:00 2001 From: pacowong Date: Sun, 26 Nov 2023 22:50:03 +0800 Subject: [PATCH 34/35] Install flatbuffer --- .github/workflows/generate-xcframework-maccatalyst.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 0a0bdd4d139d7..8d0b9ebe6c78a 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -45,6 +45,7 @@ jobs: export PYTHONPATH=${{ github.workspace }}/tools/python:$PYTHONPATH cd ${{ github.workspace }}/tools/python ls ${{ github.workspace }}/tools/python + pip install -r ${{ github.workspace }}/requirements-dev.txt pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt python ${{ github.workspace }}/tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ From 3c8f36ac9242f8fc0c5526701c6a147c48f84199 Mon Sep 17 00:00:00 2001 From: pacowong Date: Mon, 27 Nov 2023 00:15:25 +0800 Subject: [PATCH 35/35] Deal with missing lSystem: change LIBRARY_PATH --- .github/workflows/generate-xcframework-maccatalyst.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/generate-xcframework-maccatalyst.yml b/.github/workflows/generate-xcframework-maccatalyst.yml index 8d0b9ebe6c78a..c19b9a2e3d432 100644 --- a/.github/workflows/generate-xcframework-maccatalyst.yml +++ b/.github/workflows/generate-xcframework-maccatalyst.yml @@ -47,6 +47,10 @@ jobs: ls ${{ github.workspace }}/tools/python pip install -r ${{ github.workspace }}/requirements-dev.txt pip install -r ${{ github.workspace }}/tools/ci_build/requirements.txt + #Deal with lSystem + export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) + export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib" + #Build command python ${{ github.workspace }}/tools/ci_build/github/apple/build_macabi_framework.py --config=Release --build_dir=$HOME/onnxlibrary/macabi_release_v20230327_2320 \ --include_ops_by_config=${{ github.workspace }}/tools/ci_build/github/apple/hws_mobile_package.required_operators.config \ --path_to_protoc_exe=/usr/local/bin/protoc-3.21.12.0 ${{ github.workspace }}/tools/ci_build/github/apple/default_full_macabi_framework_build_settings.json