# 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/.
#
# We have these build jobs in a separate file because their definitions are
# different enough from the main Linux build jobs that their presence in
# linux.yml would make using job-defaults there significantly less useful.
---
job-defaults:
    worker-type: b-linux-gcp

linux64-base-toolchains/opt:
    description: "Linux64 base toolchains Opt"
    index:
        product: firefox
        job-name: linux64-base-toolchains-opt
    treeherder:
        platform: linux64/opt
        symbol: Bb
    run-on-projects: ['mozilla-central']
    worker:
        max-run-time: 7200
        env:
            PERFHERDER_EXTRA_OPTIONS: base-toolchains
            FORCE_GCC: '1'
    run:
        using: mozharness
        actions: [get-secrets, build]
        config:
            - builds/releng_base_firefox.py
            - builds/releng_base_linux_64_builds.py
        script: "mozharness/scripts/fx_desktop_build.py"
        secrets: true
        tooltool-downloads: public
    use-sccache: true
    fetches:
        toolchain:
            - linux64-binutils-2.31.1
            - linux64-clang-base
            - linux64-gcc-base
            - linux64-rust-base
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-sccache
            - linux64-nasm-2.14.02
            - linux64-node-12
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

linux64-base-toolchains/debug:
    description: "Linux64 base toolchains Debug"
    index:
        product: firefox
        job-name: linux64-base-toolchains-debug
    treeherder:
        platform: linux64/debug
        symbol: Bb
    optimization:
        skip-unless-expanded: null
    worker:
        max-run-time: 7200
        env:
            PERFHERDER_EXTRA_OPTIONS: base-toolchains
            FORCE_GCC: '1'
    run:
        using: mozharness
        actions: [get-secrets, build]
        config:
            - builds/releng_base_firefox.py
            - builds/releng_base_linux_64_builds.py
        script: "mozharness/scripts/fx_desktop_build.py"
        secrets: true
        custom-build-variant-cfg: debug
        mozconfig-variant: debug
        tooltool-downloads: public
    use-sccache: true
    fetches:
        toolchain:
            - linux64-binutils-2.31.1
            - linux64-clang-base
            - linux64-gcc-base
            - linux64-rust-base
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-sccache
            - linux64-nasm-2.14.02
            - linux64-node-12
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

linux64-base-toolchains-clang/opt:
    description: "Linux64 base toolchains clang Opt"
    index:
        product: firefox
        job-name: linux64-base-toolchains-clang-opt
    treeherder:
        platform: linux64/opt
        symbol: Bbc
    run-on-projects: ['mozilla-central']
    worker:
        max-run-time: 7200
        env:
            PERFHERDER_EXTRA_OPTIONS: base-toolchains-clang
            DISABLE_CLANG_PLUGIN: '1'
    run:
        using: mozharness
        actions: [get-secrets, build]
        config:
            - builds/releng_base_firefox.py
            - builds/releng_base_linux_64_builds.py
        script: "mozharness/scripts/fx_desktop_build.py"
        secrets: true
        tooltool-downloads: public
    fetches:
        toolchain:
            - linux64-clang-base
            - linux64-rust-base
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-nasm-2.14.02
            - linux64-node-12
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

linux64-base-toolchains-clang/debug:
    description: "Linux64 base toolchains clang Debug"
    index:
        product: firefox
        job-name: linux64-base-toolchains-clang-debug
    treeherder:
        platform: linux64/debug
        symbol: Bbc
    optimization:
        skip-unless-expanded: null
    worker:
        max-run-time: 5400
        env:
            PERFHERDER_EXTRA_OPTIONS: base-toolchains-clang
            DISABLE_CLANG_PLUGIN: '1'
    run:
        using: mozharness
        actions: [get-secrets, build]
        config:
            - builds/releng_base_firefox.py
            - builds/releng_base_linux_64_builds.py
        script: "mozharness/scripts/fx_desktop_build.py"
        secrets: true
        custom-build-variant-cfg: debug
        mozconfig-variant: debug
        tooltool-downloads: public
    fetches:
        toolchain:
            - linux64-clang-base
            - linux64-rust-base
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-nasm-2.14.02
            - linux64-node-12
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu