# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
task-defaults:
    worker-type: b-linux-xlarge-gcp
    worker:
        max-run-time: 7200
    run:
        resources:
            - 'build/build-clang/build-clang.py'

linux64-clang-8.0-raw:
    description: "Clang 8.0 toolchain build"
    treeherder:
        symbol: TL(clang-8.0-raw)
    worker-type: b-linux-large-gcp
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-8.0.json'
            - 'build/build-clang/2stages.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-8.0.json'
            - 'build/build-clang/2stages.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-8.0
        toolchain:
            - linux64-toolchain-sysroot

linux64-clang-8.0:
    description: "Clang 8.0 toolchain build"
    treeherder:
        symbol: TL(clang-8.0)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias: linux64-clang-base
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-clang-8.0-raw
            - wasm32-wasi-compiler-rt-8.0

linux64-clang-14-stage1:
    description: "Clang 14 toolchain build"
    treeherder:
        symbol: TL(clang-14-stage1)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-14.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-14.json'
            - 'build/build-clang/1stage.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-14
        toolchain:
            - linux64-toolchain-sysroot

linux64-clang-14:
    description: "Clang 14 toolchain build"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TL(clang-14)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-clang-14-stage1

macosx64-clang-14-raw:
    description: "Clang 14 toolchain build"
    treeherder:
        symbol: TM(clang-14-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-14.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-14.json'
            - 'build/build-clang/1stage.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-14
        toolchain:
            - linux64-clang-14-stage1
            - macosx64-sdk-toolchain

linux64-clang-17-mingw-x86:
    description: "MinGW-Clang 17 x86 toolchain build"
    treeherder:
        symbol: TMW(clang-17-x86)
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x86'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-17
            - mingw-w64
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-17

linux64-clang-17-mingw-x64:
    description: "MinGW-Clang 17 x64 toolchain build"
    treeherder:
        symbol: TMW(clang-17-x64)
        tier: 1
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x64'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-17
            - mingw-w64
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-17

linux64-clang-17-stage1:
    description: "Clang 17 toolchain build"
    treeherder:
        symbol: TL(clang-17-stage1)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/1stage.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-toolchain-sysroot

linux64-clang-17-profile:
    description: "Clang 17 toolchain build"
    treeherder:
        symbol: TL(clang-17-profile)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        toolchain-artifact: public/build/merged.profdata
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-clang-17-stage1
            - linux64-x64-compiler-rt-17
            - linux64-toolchain-sysroot

linux64-clang-17-raw:
    description: "Clang 17 toolchain build"
    treeherder:
        symbol: TL(clang-17-raw)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-clang-17-stage1
            - linux64-clang-17-profile
            - linux64-toolchain-sysroot

linux64-clang-17:
    description: "Clang 17 toolchain build"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TL(clang-17)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - linux64-clang-17-raw
            - android-aarch64-compiler-rt-17
            - android-aarch64-libunwind-17
            - android-arm-compiler-rt-17
            - android-arm-libunwind-17
            - android-x64-compiler-rt-17
            - android-x64-libunwind-17
            - android-x86-compiler-rt-17
            - android-x86-libunwind-17
            - linux64-aarch64-compiler-rt-17
            - linux64-x64-compiler-rt-17
            - linux64-x86-compiler-rt-17
            - macosx64-aarch64-compiler-rt-17
            - macosx64-x64-compiler-rt-17
            - wasm32-wasi-compiler-rt-17
            - win32-compiler-rt-17
            - win64-compiler-rt-17

macosx64-clang-17-raw:
    description: "Clang 17 toolchain build"
    treeherder:
        symbol: TM(clang-17-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-clang-17-stage1
            - linux64-clang-17-profile
            - macosx64-sdk-toolchain
            - macosx64-x64-compiler-rt-17

macosx64-clang-17:
    description: "Clang 17 toolchain repack with MacOS Compiler RT libs"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TM(clang-17)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-clang-17-raw
            - android-aarch64-compiler-rt-17
            - android-aarch64-libunwind-17
            - android-arm-compiler-rt-17
            - android-arm-libunwind-17
            - android-x64-compiler-rt-17
            - android-x64-libunwind-17
            - android-x86-compiler-rt-17
            - android-x86-libunwind-17
            - linux64-aarch64-compiler-rt-17
            - linux64-x64-compiler-rt-17
            - linux64-x86-compiler-rt-17
            - macosx64-aarch64-compiler-rt-17
            - macosx64-x64-compiler-rt-17
            - wasm32-wasi-compiler-rt-17
            - win32-compiler-rt-17
            - win64-compiler-rt-17

macosx64-aarch64-clang-17-raw:
    description: "Clang 17 toolchain build"
    treeherder:
        symbol: TM(clang-17-aarch64-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-clang-17-stage1
            - linux64-clang-17-profile
            - macosx64-sdk-toolchain
            - macosx64-aarch64-compiler-rt-17

macosx64-aarch64-clang-17:
    description: "Clang 17 toolchain repack with MacOS Compiler RT libs"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TM(clang-17-aarch64)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-aarch64-clang-17-raw
            - android-aarch64-compiler-rt-17
            - android-aarch64-libunwind-17
            - android-arm-compiler-rt-17
            - android-arm-libunwind-17
            - android-x64-compiler-rt-17
            - android-x64-libunwind-17
            - android-x86-compiler-rt-17
            - android-x86-libunwind-17
            - linux64-aarch64-compiler-rt-17
            - linux64-x64-compiler-rt-17
            - linux64-x86-compiler-rt-17
            - macosx64-aarch64-compiler-rt-17
            - macosx64-x64-compiler-rt-17
            - wasm32-wasi-compiler-rt-17
            - win32-compiler-rt-17
            - win64-compiler-rt-17

win64-clang-17-stage1:
    description: "Clang-cl 17 toolchain build stage 1"
    treeherder:
        symbol: TW64(clang-17-stage1)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/1stage.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
        toolchain:
            - linux64-clang-17-stage1
            - vs-toolchain
            - win64-libxml2

win64-clang-17-raw:
    description: "Clang-cl 17 toolchain build"
    treeherder:
        symbol: TW64(clang-17-raw)
    worker-type: b-win2022
    worker:
        max-run-time: 9000
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-17.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-17
            - ninja
        toolchain:
            - win64-clang-17-stage1
            - win64-compiler-rt-17
            - win64-cmake
            - vs-toolchain
            - win64-libxml2

win64-clang-17:
    description: "Clang-cl 17 toolchain build"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TW64(clang-17)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - win64-clang-17-raw
            - android-aarch64-compiler-rt-17
            - android-aarch64-libunwind-17
            - android-arm-compiler-rt-17
            - android-arm-libunwind-17
            - android-x64-compiler-rt-17
            - android-x64-libunwind-17
            - android-x86-compiler-rt-17
            - android-x86-libunwind-17
            - linux64-aarch64-compiler-rt-17
            - linux64-x64-compiler-rt-17
            - linux64-x86-compiler-rt-17
            - macosx64-aarch64-compiler-rt-17
            - macosx64-x64-compiler-rt-17
            - wasm32-wasi-compiler-rt-17
            - win32-compiler-rt-17
            - win64-compiler-rt-17

linux64-clang-18-mingw-x86:
    description: "MinGW-Clang 18 x86 toolchain build"
    treeherder:
        symbol: TMW(clang-18-x86)
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x86'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-alias:
            by-project:
                toolchains: null
                default: linux64-clang-mingw-x86
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-18
            - mingw-w64
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-18

linux64-clang-18-mingw-x64:
    description: "MinGW-Clang 18 x64 toolchain build"
    treeherder:
        symbol: TMW(clang-18-x64)
        tier: 1
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x64'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-alias:
            by-project:
                toolchains: null
                default: linux64-clang-mingw-x64
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-18
            - mingw-w64
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-18

linux64-clang-18-stage1:
    description: "Clang 18 toolchain build"
    treeherder:
        symbol: TL(clang-18-stage1)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/1stage.json'
        toolchain-alias:
            by-project:
                toolchains: null
                default: linux64-clang-toolchain
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-toolchain-sysroot

linux64-clang-18-profile:
    description: "Clang 18 toolchain build"
    treeherder:
        symbol: TL(clang-18-profile)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        toolchain-artifact: public/build/merged.profdata
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-clang-18-stage1
            - linux64-x64-compiler-rt-18
            - linux64-toolchain-sysroot

linux64-clang-18-raw:
    description: "Clang 18 toolchain build"
    treeherder:
        symbol: TL(clang-18-raw)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-clang-18-stage1
            - linux64-clang-18-profile
            - linux64-toolchain-sysroot

linux64-clang-18:
    description: "Clang 18 toolchain build"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TL(clang-18)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: null
                default: linux64-clang
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - linux64-clang-18-raw
            - android-aarch64-compiler-rt-18
            - android-aarch64-libunwind-18
            - android-arm-compiler-rt-18
            - android-arm-libunwind-18
            - android-x64-compiler-rt-18
            - android-x64-libunwind-18
            - android-x86-compiler-rt-18
            - android-x86-libunwind-18
            - linux64-aarch64-compiler-rt-18
            - linux64-x64-compiler-rt-18
            - linux64-x86-compiler-rt-18
            - macosx64-aarch64-compiler-rt-18
            - macosx64-x64-compiler-rt-18
            - wasm32-wasi-compiler-rt-18
            - win32-compiler-rt-18
            - win64-compiler-rt-18

macosx64-clang-18-raw:
    description: "Clang 18 toolchain build"
    treeherder:
        symbol: TM(clang-18-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-clang-18-stage1
            - linux64-clang-18-profile
            - macosx64-sdk-toolchain
            - macosx64-x64-compiler-rt-18

macosx64-clang-18:
    description: "Clang 18 toolchain repack with MacOS Compiler RT libs"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TM(clang-18)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: null
                default:
                    - macosx64-clang
                    - macosx64-clang-toolchain
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-clang-18-raw
            - android-aarch64-compiler-rt-18
            - android-aarch64-libunwind-18
            - android-arm-compiler-rt-18
            - android-arm-libunwind-18
            - android-x64-compiler-rt-18
            - android-x64-libunwind-18
            - android-x86-compiler-rt-18
            - android-x86-libunwind-18
            - linux64-aarch64-compiler-rt-18
            - linux64-x64-compiler-rt-18
            - linux64-x86-compiler-rt-18
            - macosx64-aarch64-compiler-rt-18
            - macosx64-x64-compiler-rt-18
            - wasm32-wasi-compiler-rt-18
            - win32-compiler-rt-18
            - win64-compiler-rt-18

macosx64-aarch64-clang-18-raw:
    description: "Clang 18 toolchain build"
    treeherder:
        symbol: TM(clang-18-aarch64-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-clang-18-stage1
            - linux64-clang-18-profile
            - macosx64-sdk-toolchain
            - macosx64-aarch64-compiler-rt-18

macosx64-aarch64-clang-18:
    description: "Clang 18 toolchain repack with MacOS Compiler RT libs"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TM(clang-18-aarch64)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: null
                default: macosx64-aarch64-clang
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-aarch64-clang-18-raw
            - android-aarch64-compiler-rt-18
            - android-aarch64-libunwind-18
            - android-arm-compiler-rt-18
            - android-arm-libunwind-18
            - android-x64-compiler-rt-18
            - android-x64-libunwind-18
            - android-x86-compiler-rt-18
            - android-x86-libunwind-18
            - linux64-aarch64-compiler-rt-18
            - linux64-x64-compiler-rt-18
            - linux64-x86-compiler-rt-18
            - macosx64-aarch64-compiler-rt-18
            - macosx64-x64-compiler-rt-18
            - wasm32-wasi-compiler-rt-18
            - win32-compiler-rt-18
            - win64-compiler-rt-18

win64-clang-18-stage1:
    description: "Clang-cl 18 toolchain build stage 1"
    treeherder:
        symbol: TW64(clang-18-stage1)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/1stage.json'
        toolchain-alias:
            by-project:
                toolchains: null
                default: win64-clang-toolchain
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
        toolchain:
            - linux64-clang-18-stage1
            - vs-toolchain
            - win64-libxml2

win64-clang-18-raw:
    description: "Clang-cl 18 toolchain build"
    treeherder:
        symbol: TW64(clang-18-raw)
    worker-type: b-win2022
    worker:
        max-run-time: 9000
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-18.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-18
            - ninja
        toolchain:
            - win64-clang-18-stage1
            - win64-cmake
            - win64-compiler-rt-18
            - vs-toolchain
            - win64-libxml2

win64-clang-18:
    description: "Clang-cl 18 toolchain build"
    attributes:
        local-toolchain: true
    treeherder:
        symbol: TW64(clang-18)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: null
                default: win64-clang
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - win64-clang-18-raw
            - android-aarch64-compiler-rt-18
            - android-aarch64-libunwind-18
            - android-arm-compiler-rt-18
            - android-arm-libunwind-18
            - android-x64-compiler-rt-18
            - android-x64-libunwind-18
            - android-x86-compiler-rt-18
            - android-x86-libunwind-18
            - linux64-aarch64-compiler-rt-18
            - linux64-x64-compiler-rt-18
            - linux64-x86-compiler-rt-18
            - macosx64-aarch64-compiler-rt-18
            - macosx64-x64-compiler-rt-18
            - wasm32-wasi-compiler-rt-18
            - win32-compiler-rt-18
            - win64-compiler-rt-18

linux64-clang-trunk-mingw-x86:
    description: "MinGW-Clang trunk x86 toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TMW(clang-trunk-x86)
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x86'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-alias:
            by-project:
                toolchains: linux64-clang-mingw-x86
                default: null
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-trunk
            - mingw-w64-trunk
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-trunk

linux64-clang-trunk-mingw-x64:
    description: "MinGW-Clang trunk x64 toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TMW(clang-trunk-x64)
        tier: 1
    worker-type: b-linux-gcp
    run:
        script: build-clang-mingw.sh
        arguments:
            - 'x64'
        resources:
            - 'taskcluster/scripts/misc/mingw-*.patch'
        toolchain-alias:
            by-project:
                toolchains: linux64-clang-mingw-x64
                default: null
        toolchain-artifact: public/build/clangmingw.tar.zst
    fetches:
        fetch:
            - clang-trunk
            - mingw-w64-trunk
            - llvm-mingw
            - gcc-9.5.0
        toolchain:
            - linux64-clang-trunk

linux64-clang-trunk-stage1:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(clang-trunk-stage1)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/1stage.json'
        toolchain-alias:
            by-project:
                toolchains: linux64-clang-toolchain
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-toolchain-sysroot

linux64-clang-trunk-profile:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(clang-trunk-profile)
    run:
        using: toolchain-script
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-stage-1.json'
            - 'build/build-clang/profile.json'
        toolchain-artifact: public/build/merged.profdata
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-x64-compiler-rt-trunk
            - linux64-toolchain-sysroot

linux64-clang-trunk-raw:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(clang-trunk-raw)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/linux64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-clang-trunk-profile
            - linux64-toolchain-sysroot

linux64-clang-trunk:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TL(clang-trunk)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: linux64-clang
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - linux64-clang-trunk-raw
            - android-aarch64-compiler-rt-trunk
            - android-aarch64-libunwind-trunk
            - android-arm-compiler-rt-trunk
            - android-arm-libunwind-trunk
            - android-x64-compiler-rt-trunk
            - android-x64-libunwind-trunk
            - android-x86-compiler-rt-trunk
            - android-x86-libunwind-trunk
            - linux64-aarch64-compiler-rt-trunk
            - linux64-x64-compiler-rt-trunk
            - linux64-x86-compiler-rt-trunk
            - macosx64-aarch64-compiler-rt-trunk
            - macosx64-x64-compiler-rt-trunk
            - wasm32-wasi-compiler-rt-trunk
            - win32-compiler-rt-trunk
            - win64-compiler-rt-trunk

macosx64-clang-trunk-raw:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TM(clang-trunk-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-clang-trunk-profile
            - macosx64-sdk-toolchain
            - macosx64-x64-compiler-rt-trunk

macosx64-clang-trunk:
    description: "Clang trunk toolchain repack with MacOS Compiler RT libs"
    attributes:
        cached_task: false
    treeherder:
        symbol: TM(clang-trunk)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains:
                    - macosx64-clang
                    - macosx64-clang-toolchain
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-clang-trunk-raw
            - android-aarch64-compiler-rt-trunk
            - android-aarch64-libunwind-trunk
            - android-arm-compiler-rt-trunk
            - android-arm-libunwind-trunk
            - android-x64-compiler-rt-trunk
            - android-x64-libunwind-trunk
            - android-x86-compiler-rt-trunk
            - android-x86-libunwind-trunk
            - linux64-aarch64-compiler-rt-trunk
            - linux64-x64-compiler-rt-trunk
            - linux64-x86-compiler-rt-trunk
            - macosx64-aarch64-compiler-rt-trunk
            - macosx64-x64-compiler-rt-trunk
            - wasm32-wasi-compiler-rt-trunk
            - win32-compiler-rt-trunk
            - win64-compiler-rt-trunk

macosx64-aarch64-clang-trunk-raw:
    description: "Clang trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TM(clang-trunk-aarch64-raw)
    worker-type: b-linux-large-gcp
    worker:
        max-run-time: 3600
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/macosx64.json'
            - 'build/build-clang/macosx64-aarch64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-3-stages.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - linux64-clang-trunk-profile
            - macosx64-sdk-toolchain
            - macosx64-aarch64-compiler-rt-trunk

macosx64-aarch64-clang-trunk:
    description: "Clang trunk toolchain repack with MacOS Compiler RT libs"
    attributes:
        cached_task: false
    treeherder:
        symbol: TM(clang-trunk-aarch64)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: macosx64-aarch64-clang
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - macosx64-aarch64-clang-trunk-raw
            - android-aarch64-compiler-rt-trunk
            - android-aarch64-libunwind-trunk
            - android-arm-compiler-rt-trunk
            - android-arm-libunwind-trunk
            - android-x64-compiler-rt-trunk
            - android-x64-libunwind-trunk
            - android-x86-compiler-rt-trunk
            - android-x86-libunwind-trunk
            - linux64-aarch64-compiler-rt-trunk
            - linux64-x64-compiler-rt-trunk
            - linux64-x86-compiler-rt-trunk
            - macosx64-aarch64-compiler-rt-trunk
            - macosx64-x64-compiler-rt-trunk
            - wasm32-wasi-compiler-rt-trunk
            - win32-compiler-rt-trunk
            - win64-compiler-rt-trunk

win64-clang-trunk-stage1:
    description: "Clang-cl trunk toolchain build stage 1"
    attributes:
        cached_task: false
    treeherder:
        symbol: TW64(clang-trunk-stage1)
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/1stage.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/1stage.json'
        toolchain-alias:
            by-project:
                toolchains: win64-clang-toolchain
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
        toolchain:
            - linux64-clang-trunk-stage1
            - vs-toolchain
            - win64-libxml2

win64-clang-trunk-raw:
    description: "Clang-cl trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TW64(clang-trunk-raw)
    worker-type: b-win2022
    worker:
        max-run-time: 9000
    run:
        script: build-clang.sh
        arguments:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        resources:
            - 'build/build-clang/win64.json'
            - 'build/build-clang/clang-trunk.json'
            - 'build/build-clang/skip-stage-1-win64.json'
            - 'build/build-clang/4stages-pgo.json'
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        fetch:
            - clang-trunk
            - ninja
        toolchain:
            - win64-clang-trunk-stage1
            - win64-cmake
            - win64-compiler-rt-trunk
            - vs-toolchain
            - win64-libxml2

win64-clang-trunk:
    description: "Clang-cl trunk toolchain build"
    attributes:
        cached_task: false
    treeherder:
        symbol: TW64(clang-trunk)
    worker-type: b-linux-gcp
    worker:
        max-run-time: 600
    run:
        script: repack-clang.sh
        toolchain-alias:
            by-project:
                toolchains: win64-clang
                default: null
        toolchain-artifact: public/build/clang.tar.zst
    fetches:
        toolchain:
            - linux64-cctools-port
            - win64-clang-trunk-raw
            - android-aarch64-compiler-rt-trunk
            - android-aarch64-libunwind-trunk
            - android-arm-compiler-rt-trunk
            - android-arm-libunwind-trunk
            - android-x64-compiler-rt-trunk
            - android-x64-libunwind-trunk
            - android-x86-compiler-rt-trunk
            - android-x86-libunwind-trunk
            - linux64-aarch64-compiler-rt-trunk
            - linux64-x64-compiler-rt-trunk
            - linux64-x86-compiler-rt-trunk
            - macosx64-aarch64-compiler-rt-trunk
            - macosx64-x64-compiler-rt-trunk
            - wasm32-wasi-compiler-rt-trunk
            - win32-compiler-rt-trunk
            - win64-compiler-rt-trunk
