# 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:
    index:
        product: firefox
    worker-type: b-osx-1015
    worker:
        max-run-time: 7200
        artifacts:
            - name: public/build/security/{browser_entitlement}.xml
              path: checkouts/gecko/security/mac/hardenedruntime/{entitlement_directory}/{browser_entitlement}.xml
              type: file
            - name: public/build/security/media-plugin-helper.xml
              path: checkouts/gecko/security/mac/hardenedruntime/{entitlement_directory}/media-plugin-helper.xml
              type: file
            - name: public/build/security/plugin-container.xml
              path: checkouts/gecko/security/mac/hardenedruntime/{entitlement_directory}/plugin-container.xml
              type: file
    run:
        using: mozharness
        script: "mozharness/scripts/fx_desktop_build.py"

macosx64-plain/opt:
    description: "MacOS X x64 Opt Plain"
    index:
        job-name: macosx64-plain-opt
    treeherder:
        symbol: Bp
        platform: osx/opt
        tier: 1
    worker:
        env:
            PERFHERDER_EXTRA_OPTIONS: plain
    run:
        actions: [build]
        config:
            - builds/releng_base_firefox.py
            - builds/taskcluster_base_macosx.py
        extra-config:
            disable_package_metrics: true
            stage_platform: macosx64
            mozconfig_platform: macosx64
        mozconfig-variant: plain-opt
    run-on-projects: ['mozilla-central']
    fetches:
        toolchain:
            - macosx64-clang
            - macosx64-cbindgen
            - macosx64-nasm
            - macosx64-node
            - macosx64-rust
            - macosx64-sdk
            - sysroot-wasm32-wasi
            - onnxruntime-x86_64-apple-darwin
    optimization:
        skip-unless-expanded: null

macosx64-plain/debug:
    description: "MacOS X x64 Debug Plain"
    index:
        job-name: macosx64-plain-debug
    treeherder:
        symbol: Bp
        platform: osx/debug
        tier: 1
    worker:
        env:
            PERFHERDER_EXTRA_OPTIONS: plain
    run:
        actions: [build]
        config:
            - builds/releng_base_firefox.py
            - builds/taskcluster_base_macosx.py
        extra-config:
            disable_package_metrics: true
            stage_platform: macosx64
            mozconfig_platform: macosx64
        mozconfig-variant: plain-debug
    run-on-projects: ['trunk']
    fetches:
        toolchain:
            - macosx64-clang
            - macosx64-cbindgen
            - macosx64-nasm
            - macosx64-node
            - macosx64-rust
            - macosx64-sdk
            - sysroot-wasm32-wasi
            - onnxruntime-x86_64-apple-darwin
    optimization:
        skip-unless-expanded: null

macosx64-rusttests/opt:
    description: "MacOS X x64 Rust Tests Opt"
    index:
        job-name: macosx64-rusttests-opt
    treeherder:
        platform: macosx64/opt
        symbol: BR
        tier: 1
    worker:
        env:
            PERFHERDER_EXTRA_OPTIONS: rusttests
    run:
        actions: [build]
        config:
            - builds/releng_base_firefox.py
            - builds/taskcluster_base_macosx.py
            - builds/releng_sub_mac_configs/rusttests.py
        extra-config:
            mozconfig_platform: macosx64
        mozconfig-variant: rusttests
    run-on-projects: ['mozilla-central']
    fetches:
        toolchain:
            - macosx64-clang
            - macosx64-rust
            - macosx64-cbindgen
            - macosx64-nasm
            - macosx64-node
            - macosx64-sdk
    optimization:
        test-inclusive: [rusttests]

macosx64-rusttests/debug:
    description: "MacOS X x64 Rust Tests Debug"
    index:
        job-name: macosx64-rusttests-debug
    treeherder:
        platform: macosx64/debug
        symbol: BR
        tier: 1
    worker:
        env:
            PERFHERDER_EXTRA_OPTIONS: rusttests
    run:
        actions: [build]
        config:
            - builds/releng_base_firefox.py
            - builds/taskcluster_base_macosx.py
            - builds/releng_sub_mac_configs/rusttests.py
        extra-config:
            mozconfig_platform: macosx64
        mozconfig-variant: rusttests-debug
    run-on-projects: ['trunk']
    fetches:
        toolchain:
            - macosx64-clang
            - macosx64-rust
            - macosx64-cbindgen
            - macosx64-nasm
            - macosx64-node
            - macosx64-sdk
    optimization:
        test-inclusive: [rusttests]
