diff --git a/.github/actions/install-skia-dependencies/action.yaml b/.github/actions/install-skia-dependencies/action.yaml new file mode 100644 index 00000000000..239be64880a --- /dev/null +++ b/.github/actions/install-skia-dependencies/action.yaml @@ -0,0 +1,23 @@ +# Copyright © SixtyFPS GmbH +# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 + +--- +name: Install Skia dependencies +description: Set up dependencies needed to build Skia + +runs: + using: composite + steps: + - name: Install Ninja + if: runner.os == 'macOS' + run: brew install ninja + shell: bash + - name: Upgrade LLVM for Skia build on Windows + if: runner.os == 'Windows' + run: choco upgrade llvm + shell: bash + # See https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#caveats + - name: Remove GNU link.exe from GH actions + if: runner.os == 'Windows' + run: rm /usr/bin/link + shell: bash diff --git a/.github/actions/setup-rust/action.yaml b/.github/actions/setup-rust/action.yaml index 2c2603ddb18..1839e5c2610 100644 --- a/.github/actions/setup-rust/action.yaml +++ b/.github/actions/setup-rust/action.yaml @@ -40,10 +40,10 @@ runs: run: | git config --system core.longpaths true shell: powershell - - name: Move cargo home to the same drive as the build, so that relative paths from build to cargo source are without drive letter + - name: Move cargo home close to the target/$profile directory, so that relative paths from build to cargo source are without drive letter if: runner.os == 'Windows' run: | - echo "CARGO_HOME=\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "CARGO_HOME=${{ runner.workspace }}\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: powershell - name: Install Rust ${{ inputs.toolchain }} uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 504e0718563..94c4708fba7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,6 +53,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/install-linux-dependencies + - uses: ./.github/actions/install-skia-dependencies + - uses: ilammy/msvc-dev-cmd@v1 - uses: actions/setup-python@v5 with: python-version: '3.10' @@ -69,9 +71,6 @@ jobs: - name: Install gstreamer and libunwind (Linux) if: runner.os == 'Linux' run: sudo apt-get install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good - - name: Upgrade LLVM for Skia build on Windows - if: runner.os == 'Windows' - run: choco upgrade llvm - name: Setup headless display uses: pyvista/setup-headless-display-action@v3 - uses: ./.github/actions/setup-rust @@ -116,9 +115,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/install-linux-dependencies - - name: Upgrade LLVM for Skia build on Windows - if: runner.os == 'Windows' - run: choco upgrade llvm + - uses: ./.github/actions/install-skia-dependencies - name: Setup headless display uses: pyvista/setup-headless-display-action@v3 - uses: actions/setup-node@v4 diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index fc3805d9533..9646f93884c 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -58,10 +58,6 @@ jobs: - name: Prepare licenses run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild working-directory: api/cpp/ - # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - uses: ilammy/msvc-dev-cmd@v1 - name: Select MSVC (windows) run: | diff --git a/.github/workflows/nightly_snapshot.yaml b/.github/workflows/nightly_snapshot.yaml index 4a2020c5d3c..2feed59d71f 100644 --- a/.github/workflows/nightly_snapshot.yaml +++ b/.github/workflows/nightly_snapshot.yaml @@ -124,10 +124,6 @@ jobs: target: x86_64-apple-darwin - name: Install cargo-bundle run: cargo install --version=0.6.0 cargo-bundle - # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - name: Build Main LSP Bundle working-directory: tools/lsp run: cargo bundle --release --features ${{ env.SLINT_BINARY_FEATURES }} @@ -151,10 +147,6 @@ jobs: - uses: ./.github/actions/setup-rust with: target: aarch64-apple-darwin - # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - name: Build AArch64 LSP run: cargo build --target aarch64-apple-darwin --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp - name: Create artifact directory diff --git a/.github/workflows/publish_npm_package.yaml b/.github/workflows/publish_npm_package.yaml index 6b8727d0f9f..0717448cea2 100644 --- a/.github/workflows/publish_npm_package.yaml +++ b/.github/workflows/publish_npm_package.yaml @@ -69,9 +69,11 @@ jobs: - os: windows-2022 rust-target: x86_64-pc-windows-msvc napi-rs-target: win32-x64-msvc + msvc-arch: x64 - os: windows-2022 rust-target: i686-pc-windows-msvc napi-rs-target: win32-ia32-msvc + msvc-arch: x86 needs: determine_version runs-on: ${{ matrix.os }} steps: @@ -79,16 +81,14 @@ jobs: - uses: ./.github/actions/install-linux-dependencies with: old-ubuntu: true + - uses: ./.github/actions/install-skia-dependencies + - uses: ilammy/msvc-dev-cmd@v1 + if: runner.os == 'Windows' + with: + arch: ${{ matrix.msvc-arch }} - uses: ./.github/actions/setup-rust with: target: ${{ matrix.rust-target }} - - name: Upgrade LLVM for Skia build on Windows - if: runner.os == 'Windows' - run: choco upgrade llvm - # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - - uses: actions/setup-python@v5 - with: - python-version: '3.12' # Setup .npmrc file to publish to npm - uses: actions/setup-node@v4 with: diff --git a/.github/workflows/slint_tool_binary.yaml b/.github/workflows/slint_tool_binary.yaml index 9c7bf8a3211..d38365962e1 100644 --- a/.github/workflows/slint_tool_binary.yaml +++ b/.github/workflows/slint_tool_binary.yaml @@ -158,10 +158,6 @@ jobs: - uses: ./.github/actions/setup-rust with: target: aarch64-apple-darwin - # Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed. - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - uses: baptiste0928/cargo-install@v3 with: crate: cargo-about diff --git a/docker/Dockerfile.torizon-demos b/docker/Dockerfile.torizon-demos index d7a3b12ceb4..214425f6899 100644 --- a/docker/Dockerfile.torizon-demos +++ b/docker/Dockerfile.torizon-demos @@ -26,7 +26,7 @@ ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc # Install Slint build dependencies (libxcb, etc.) RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH && \ + DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH ninja-build && \ rm -rf /var/lib/apt/lists/* # Don't require font-config when the compiler runs diff --git a/internal/renderers/skia/Cargo.toml b/internal/renderers/skia/Cargo.toml index 7ce519159a5..c02b7c95608 100644 --- a/internal/renderers/skia/Cargo.toml +++ b/internal/renderers/skia/Cargo.toml @@ -41,7 +41,7 @@ pin-weak = "1" scoped-tls-hkt = "0.1" raw-window-handle = { version = "0.6", features = ["std"] } -skia-safe = { version = "0.78.0", features = ["textlayout", "gl"] } +skia-safe = { version = "0.82.0", features = ["textlayout", "gl"] } glow = { workspace = true } unicode-segmentation = { workspace = true } @@ -58,7 +58,7 @@ bytemuck = { workspace = true } [target.'cfg(target_family = "windows")'.dependencies] windows = { version = "0.58.0", features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] } -skia-safe = { version = "0.78.0", features = ["d3d"] } +skia-safe = { version = "0.82.0", features = ["d3d"] } [target.'cfg(target_vendor = "apple")'.dependencies] objc2 = { version = "0.6.0" } @@ -89,11 +89,11 @@ objc2-app-kit = { version = "0.3.0", default-features = false, features = [ objc2-core-foundation = { version = "0.3.0", default-features = false, features = [ "CFCGTypes" ] } -skia-safe = { version = "0.78.0", features = ["metal"] } +skia-safe = { version = "0.82.0", features = ["metal"] } raw-window-metal = "1.0" [target.'cfg(not(any(target_vendor = "apple", target_family = "windows")))'.dependencies] -skia-safe = { version = "0.78.0", features = ["gl"] } +skia-safe = { version = "0.82.0", features = ["gl"] } [build-dependencies] cfg_aliases = { workspace = true }