# 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:
    - gecko_taskgraph.transforms.build_attrs:transforms
    - gecko_taskgraph.transforms.build_schedules:transforms
    - gecko_taskgraph.transforms.build_lints:transforms
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

task-defaults:
    attributes:
        retrigger: true
    treeherder:
        kind: build
        tier: 1
    worker-type: b-linux-gcp
    worker:
        max-run-time: 10800
        docker-image: {in-tree: debian12-amd64-build}
    use-python: default

tasks:
    linux64-shell-haz/debug:
        description: "JS Shell Hazard Analysis Linux"
        index:
            product: firefox
            job-name: shell-haz-debug
        treeherder:
            platform: linux64/debug
            symbol: SM(H)
        run:
            using: hazard
            command: >
                cd /builds/worker/checkouts/gecko/taskcluster/scripts/builder
                && ./build-haz-linux.sh --project js $HOME/workspace
        when:
            files-changed:
                - js/public/**
                - js/src/**
        fetches:
            toolchain:
                - linux64-clang
                - linux64-gcc-9
                - linux64-gcc-sixgill
                - linux64-rust
                - linux64-cbindgen
                - linux64-node
                - linux64-pkgconf
                - sysroot-x86_64-linux-gnu

    linux64-haz/debug:
        description: "Browser Hazard Analysis Linux"
        index:
            product: firefox
            job-name: browser-haz-debug
        treeherder:
            platform: linux64/debug
            symbol: H
        run:
            using: hazard
            command: >
                cd /builds/worker/checkouts/gecko/taskcluster/scripts/builder
                && ./build-haz-linux.sh --project browser $HOME/workspace
        fetches:
            toolchain:
                - linux64-clang
                - linux64-gcc-9
                - linux64-gcc-sixgill
                - linux64-rust
                - linux64-cbindgen
                - linux64-nasm
                - linux64-node
                - linux64-pkgconf
                - sysroot-x86_64-linux-gnu
                - sysroot-wasm32-wasi
        optimization:
            skip-unless-backstop: null
