From 24478a56ef6186398ddfc206ebd78a8b2b38f16c Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Sat, 21 Dec 2024 16:37:34 +0900 Subject: [PATCH] ci: update compilers --- .github/workflows/linux-test.yml | 31 ++++++++++-------------------- .github/workflows/macos-test.yml | 12 ++++++------ .github/workflows/package.yml | 9 +++++++++ .github/workflows/windows-test.yml | 2 +- docker/linux/x86_64/Dockerfile | 28 ++++++++++++++------------- docker/windows/x86_64/Dockerfile | 10 +++++----- third_party/opencv.BUILD | 7 ++----- 7 files changed, 48 insertions(+), 51 deletions(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 103ae9f06..97b401a77 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -16,7 +16,7 @@ on: required: true jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -37,7 +37,7 @@ jobs: Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/**/*.cs Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.bytes Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.txt - key: libs-ubuntu-22.04-v1-${{ hashFiles('cache_key.txt') }} + key: libs-ubuntu-24.04-v1-${{ hashFiles('cache_key.txt') }} # Setup build tools - name: Mount bazel cache @@ -45,10 +45,10 @@ jobs: uses: actions/cache/restore@v4 with: path: "~/.cache/bazel" - key: bazel-ubuntu-22.04-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} + key: bazel-ubuntu-24.04-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} restore-keys: | - bazel-ubuntu-22.04-v1-${{ hashFiles('WORKSPACE') }}- - bazel-ubuntu-22.04-v1- + bazel-ubuntu-24.04-v1-${{ hashFiles('WORKSPACE') }}- + bazel-ubuntu-24.04-v1- - name: Remove cache_key.txt run: | @@ -63,21 +63,10 @@ jobs: - name: Install dependencies if: steps.cache-libs.outputs.cache-hit != 'true' run: | - # install GCC/G++ 11 - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update - sudo apt-get install -y --no-install-recommends gcc-11 g++-11 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 - - # install Clang 16 - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 16 - sudo ln -sf /usr/bin/clang-16 /usr/bin/clang - sudo ln -sf /usr/bin/clang++-16 /usr/bin/clang++ - sudo ln -sf /usr/bin/clang-format-16 /usr/bin/clang-format - # install NuGet + sudo apt update + sudo apt-get install -y --no-install-recommends mono-complete + sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe bash -c 'echo -e "#!/bin/bash\nmono /usr/local/bin/nuget.exe \$@" | sudo tee -a /usr/local/bin/nuget' sudo chmod +x /usr/local/bin/nuget @@ -106,7 +95,7 @@ jobs: uses: actions/cache/save@v4 with: path: ~/.cache/bazel - key: bazel-ubuntu-22.04-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} + key: bazel-ubuntu-24.04-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} test: runs-on: ${{ matrix.os }} @@ -115,7 +104,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-22.04 + - ubuntu-24.04 unityVersion: - 2022.3.34f1 - 2021.3.33f1 diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 6e01a9581..66815f193 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -16,7 +16,7 @@ on: required: true jobs: build: - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 with: @@ -37,7 +37,7 @@ jobs: Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/**/*.cs Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.bytes Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.txt - key: libs-macos-13-v1-${{ hashFiles('cache_key.txt') }} + key: libs-macos-14-v1-${{ hashFiles('cache_key.txt') }} # Setup build tools - name: Mount bazel cache @@ -45,10 +45,10 @@ jobs: uses: actions/cache/restore@v4 with: path: /private/var/tmp/_bazel_runner - key: bazel-macos-13-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} + key: bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} restore-keys: | - bazel-macos-13-v1-${{ hashFiles('WORKSPACE') }}- - bazel-macos-13-v1- + bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}- + bazel-macos-14-v1- - name: Remove cache_key.txt run: | @@ -84,7 +84,7 @@ jobs: uses: actions/cache/save@v4 with: path: /private/var/tmp/_bazel_runner - key: bazel-macos-13-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} + key: bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }} test: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index dd0b089d1..7f72b6676 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -113,6 +113,15 @@ jobs: with: ref: ${{ inputs.ref }} + - name: Install Clang 16 + run: | + brew install llvm + echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile + echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib"' >> /Users/runner/.bash_profile + echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include"' >> /Users/runner/.bash_profile + + clang --version + # Setup Python - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 5a2fe2a13..d5229b395 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -13,7 +13,7 @@ on: required: true jobs: build: - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: diff --git a/docker/linux/x86_64/Dockerfile b/docker/linux/x86_64/Dockerfile index bd82b16c9..a7baa6b8e 100644 --- a/docker/linux/x86_64/Dockerfile +++ b/docker/linux/x86_64/Dockerfile @@ -30,21 +30,11 @@ RUN apt-get update && \ wget \ zip -# Upgrade binutils (>= 2.36) -RUN curl -O https://ftp.gnu.org/gnu/binutils/binutils-2.36.tar.gz && \ - tar -xvzof binutils-2.36.tar.gz && \ - cd binutils-2.36 && \ - mkdir build && \ - cd build && \ - ../configure --prefix=/usr && \ - make && \ - make install - -# Install gcc-11 +# Install gcc-13 RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ apt-get update && \ - apt-get install -y --no-install-recommends gcc-11 g++-11 && \ - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 + apt-get install -y --no-install-recommends gcc-13 g++-13 && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13 # Install Clang 16 RUN curl https://apt.llvm.org/llvm.sh -o llvm.sh && \ @@ -54,6 +44,18 @@ RUN curl https://apt.llvm.org/llvm.sh -o llvm.sh && \ ln -sf /usr/bin/clang++-16 /usr/bin/clang++ && \ ln -sf /usr/bin/clang-format-16 /usr/bin/clang-format +# Upgrade binutils (>= 2.40) +RUN apt-get install -y --no-install-recommends bison texinfo && \ + curl -O https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz && \ + tar -xvzof binutils-2.40.tar.gz && \ + cd binutils-2.40 && \ + mkdir build && \ + cd build && \ + ../configure --prefix=/usr --enable-gold --enable-ld=default && \ + make -j `nproc` && \ + make install + + FROM base AS android WORKDIR /tmp diff --git a/docker/windows/x86_64/Dockerfile b/docker/windows/x86_64/Dockerfile index 01dff3459..49de85182 100644 --- a/docker/windows/x86_64/Dockerfile +++ b/docker/windows/x86_64/Dockerfile @@ -37,20 +37,20 @@ ARG NODE_VERSION RUN setx path "C:\msys64\usr\bin;%PATH%" -# Install Visual C++ Build Tools 2019 and WinSDK -ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel +# Install Visual C++ Build Tools 2022 and WinSDK +ARG CHANNEL_URL=https://aka.ms/vs/17/release/channel RUN curl --retry 4 --connect-timeout 10 -L https://nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%-x64.msi -o C:\TEMP\node-install.msi && ` start /wait msiexec.exe /i C:\TEMP\node-install.msi /l*vx "%TEMP%\MSI-node-install.log" /qn ADDLOCAL=ALL && ` del C:\TEMP\node-install.msi && ` curl --retry 4 --connect-timeout 10 -L %CHANNEL_URL% -o C:\TEMP\VisualStudio.chman && ` - curl --retry 4 --connect-timeout 10 -L https://aka.ms/vs/16/release/vs_buildtools.exe -o C:\TEMP\vs_buildtools.exe && ` + curl --retry 4 --connect-timeout 10 -L https://aka.ms/vs/17/release/vs_buildtools.exe -o C:\TEMP\vs_buildtools.exe && ` C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache ` - --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" ` + --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` --channelUri C:\TEMP\VisualStudio.chman ` --installChannelUri C:\TEMP\VisualStudio.chman ` --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended && ` - curl --retry 4 --connect-timeout 10 -L https://aka.ms/vs/16/release/vc_redist.x64.exe -o C:\TEMP\vc_redist.x64.exe && ` + curl --retry 4 --connect-timeout 10 -L https://aka.ms/vs/17/release/vc_redist.x64.exe -o C:\TEMP\vc_redist.x64.exe && ` start /wait C:\TEMP\vc_redist.x64.exe /install /quiet /norestart && ` del C:\TEMP\vc_redist.x64.exe diff --git a/third_party/opencv.BUILD b/third_party/opencv.BUILD index a82e1a102..ad4112f06 100644 --- a/third_party/opencv.BUILD +++ b/third_party/opencv.BUILD @@ -183,16 +183,13 @@ cmake( cache_entries = CACHE_ENTRIES, generate_args = select({ "@bazel_tools//src/conditions:windows": [ - "-G \"Visual Studio 16 2019\"", + "-G \"Visual Studio 17 2022\"", "-A x64", ], "//conditions:default": [], }), lib_source = "@opencv//:all", - out_lib_dir = select({ - "@bazel_tools//src/conditions:windows": "x64/vc16", - "//conditions:default": ".", # need to include lib/ and share/OpenCV/3rdparty/lib when building static libs - }), + out_lib_dir = ".", out_static_libs = select({ ":dbg_cmake_static_win": ["staticlib/opencv_world3416d.lib"], ":cmake_static_win": ["staticlib/opencv_world3416.lib"],