# 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/.

loader: taskgraph.loader.transform:loader

kind-dependencies:
    - toolchain

transforms:
    - taskgraph.transforms.build_attrs:transforms
    - taskgraph.transforms.use_toolchains:transforms
    - taskgraph.transforms.job:transforms
    - taskgraph.transforms.task:transforms

job-defaults:
    index:
        product: firefox
    treeherder:
        symbol: Searchfox(idx)
        kind: build
        tier: 2
    run-on-projects: []

jobs:
    linux64-searchfox/debug:
        description: "Linux64 Debug Searchfox"
        index:
            job-name: linux64-searchfox-debug
        treeherder:
            platform: linux64/debug
        worker-type: aws-provisioner-v1/gecko-{level}-b-linux
        worker:
            max-run-time: 36000
        run:
            using: mozharness
            actions: [clobber build]
            config:
                - builds/releng_base_firefox.py
                - builds/releng_sub_linux_configs/64_searchfox_and_debug.py
                - balrog/production.py
            script: "mozharness/scripts/fx_desktop_build.py"
            tooltool-downloads: public
            keep-artifacts: false
        toolchains:
            - linux64-clang
            - linux64-rust

    macosx64-searchfox/debug:
        description: "MacOS X x64 Debug Cross-compile Searchfox"
        index:
            job-name: macosx64-searchfox-debug
        treeherder:
            platform: osx-cross/debug
        worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
        worker:
            max-run-time: 36000
            env:
                TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/macosx64/cross-releng.manifest"
        run:
            using: mozharness
            actions: [clobber get-secrets build update]
            config:
                - builds/releng_base_firefox.py
                - builds/releng_base_mac_64_cross_builds.py
                - balrog/production.py
            script: "mozharness/scripts/fx_desktop_build.py"
            custom-build-variant-cfg: cross-debug-searchfox
            secrets: true
            tooltool-downloads: internal
            keep-artifacts: false
        toolchains:
            - linux64-cctools-port
            - linux64-clang
            - linux64-hfsplus
            - linux64-libdmg
            - linux64-llvm-dsymutil
            - linux64-rust-macos

    # NOTE: Windows Searchfox jobs aren't working quite yet (bug 1418415).

    win64-searchfox/debug:
        description: "Win64 Searchfox Debug (clang-cl)"
        index:
            product: firefox
            job-name: win64-searchfox-debug
        treeherder:
            platform: windows2012-64/debug
        worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
        worker:
            max-run-time: 7200
            env:
                TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/releng.manifest"
        run:
            using: mozharness
            options: [append-env-variables-from-configs]
            script: mozharness/scripts/fx_desktop_build.py
            config:
                - builds/releng_base_firefox.py
                - builds/taskcluster_base_windows.py
                - builds/taskcluster_base_win64.py
                - builds/taskcluster_sub_win64/searchfox_debug.py
        toolchains:
            - win64-clang-cl
            - win64-rust
