diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3aa4980..6813806 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ on: env: ONNXRUNTIME_VERSION: |- # releaseタグ名か、workflow_dispatchでのバージョン名が入る。無指定なら適当なバージョン - ${{ github.event.release.tag_name || github.event.inputs.version || '1.16.3' }} + ${{ github.event.release.tag_name || github.event.inputs.version || '1.17.0' }} RELEASE: |- # releaseタグ名か、workflow_dispatchでのreleaseフラグがあればリリースする ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} @@ -68,8 +68,8 @@ jobs: release_config: Release - artifact_name: onnxruntime-linux-armhf os: ubuntu-20.04 - cc_version: "9" - cxx_version: "9" + cc_version: "10" + cxx_version: "10" linux_cross_arch: arm-linux-gnueabihf symlink_workaround: true build_opts: --arm --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=armv7l --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib @@ -77,8 +77,8 @@ jobs: release_config: Release - artifact_name: onnxruntime-linux-arm64 os: ubuntu-20.04 - cc_version: "9" - cxx_version: "9" + cc_version: "10" + cxx_version: "10" linux_cross_arch: aarch64-linux-gnu symlink_workaround: true build_opts: --arm64 --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=aarch64 --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib @@ -106,19 +106,19 @@ jobs: release_config: Release - artifact_name: onnxruntime-ios-arm64 os: macos-12 - build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --ios_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 16.0 + build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphoneos --osx_arch arm64 --apple_deploy_target 16.0 build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc result_dir: build/Release release_config: Release-iphoneos - artifact_name: onnxruntime-ios-sim-arm64 os: macos-12 - build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --ios_sysroot iphonesimulator --osx_arch arm64 --apple_deploy_target 16.0 + build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch arm64 --apple_deploy_target 16.0 build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc result_dir: build/Release release_config: Release-iphonesimulator - artifact_name: onnxruntime-ios-sim-x86_64 os: macos-12 - build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --ios_sysroot iphonesimulator --osx_arch x86_64 --apple_deploy_target 16.0 + build_opts: --config Release --parallel --compile_no_warning_as_error --update --build --build_shared_lib --skip_tests --use_xcode --ios --apple_sysroot iphonesimulator --osx_arch x86_64 --apple_deploy_target 16.0 build_opts_workaround_protoc: --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc result_dir: build/Release release_config: Release-iphonesimulator @@ -132,10 +132,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Version check (semver) run: | VERSION="${{ env.ONNXRUNTIME_VERSION }}" @@ -147,11 +147,19 @@ jobs: fi - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: microsoft/onnxruntime submodules: true ref: v${{ env.ONNXRUNTIME_VERSION }} + - name: Checkout builder + uses: actions/checkout@v4 + with: + path: builder + + - name: Apply patch + run: | + git apply --ignore-whitespace --reject --whitespace=fix --verbose ./builder/1_17_0_android_arm64_build.patch - name: Dump matrix context env: @@ -258,6 +266,12 @@ jobs: echo "CC=${{ env.ARCH_PREFIX }}gcc-${{ matrix.cc_version }}" >> "$GITHUB_ENV" echo "CXX=${{ env.ARCH_PREFIX }}g++-${{ matrix.cxx_version }}" >> "$GITHUB_ENV" + - name: Configure to use latest Android NDK + if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && startsWith(matrix.artifact_name, 'onnxruntime-android') + run: | + # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md#environment-variables-2 + echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> "$GITHUB_ENV" + - name: Build ONNX Runtime if: steps.cache-build-result.outputs.cache-hit != 'true' run: | diff --git a/1_17_0_android_arm64_build.patch b/1_17_0_android_arm64_build.patch new file mode 100644 index 0000000..2484f67 --- /dev/null +++ b/1_17_0_android_arm64_build.patch @@ -0,0 +1,22 @@ +diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py +index 31f242cce..c42ba9386 100644 +--- a/tools/ci_build/build.py ++++ b/tools/ci_build/build.py +@@ -987,6 +987,8 @@ def generate_build_tree( + disable_optional_type = "optional" in types_to_disable + disable_sparse_tensors = "sparsetensor" in types_to_disable + ++ is_x86_64_build = not (args.android or args.ios or args.build_wasm or args.arm or args.arm64 or args.arm64ec) ++ + cmake_args += [ + "-Donnxruntime_RUN_ONNX_TESTS=" + ("ON" if args.enable_onnx_tests else "OFF"), + "-Donnxruntime_GENERATE_TEST_REPORTS=ON", +@@ -1569,7 +1571,7 @@ def generate_build_tree( + "-pipe", + "-ggdb3", + ] +- if is_linux() and platform.machine() == "x86_64": ++ if is_linux() and is_x86_64_build: + # The following flags needs GCC 8 and newer + cflags += ["-fstack-clash-protection", "-fcf-protection"] + cxxflags = cflags.copy()