# 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:
        max-run-time: 10800
        docker-image: {in-tree: debian12-amd64-build}
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "0"
    run:
        tooltool-downloads: public

sm-package-linux64/opt:
    description: "Spidermonkey source package and test"
    index:
        job-name: sm-package-linux64-opt
    treeherder:
        symbol: SM(pkg)
        platform: linux64/opt
    run:
        using: spidermonkey-package
        spidermonkey-variant: plain
    fetches:
        toolchain:
            - linux64-clang
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-rust
            - linux64-gcc
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-plain-linux64/debug:
    description: "Spidermonkey Plain"
    index:
        job-name: sm-plain-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(p)
    run:
        spidermonkey-variant: plaindebug
    fetches:
        toolchain:
            - linux64-clang
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-rust
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-plain-linux64/opt:
    description: "Spidermonkey Plain"
    index:
        job-name: sm-plain-linux64-opt
    treeherder:
        symbol: SM(p)
        platform: linux64/opt
    run:
        spidermonkey-variant: plain
    fetches:
        toolchain:
            - linux64-clang
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-rust
            - linux64-gcc
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-nojit-linux64/opt:
    description: "Spidermonkey no JIT"
    index:
        job-name: sm-nojit-linux64-opt
    treeherder:
        symbol: SM(nojit)
        platform: linux64/opt
    run:
        spidermonkey-variant: nojit
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-pbl-linux64/opt:
    description: "Spidermonkey PBL"
    index:
        job-name: sm-pbl-linux64-opt
    treeherder:
        symbol: SM(pbl)
        platform: linux64/opt
        tier: 2
    run:
        spidermonkey-variant: pbl
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-pbl-linux64/debug:
    description: "Spidermonkey PBL Debug"
    index:
        job-name: sm-pbl-linux64-debug
    treeherder:
        symbol: SM(pbl)
        platform: linux64/debug
        tier: 2
    run:
        spidermonkey-variant: pbl-debug
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-plain-linux32/debug:
    description: "Spidermonkey Plain"
    index:
        job-name: sm-plain-linux32-debug
    treeherder:
        platform: linux32/debug
        symbol: SM(p)
    run:
        spidermonkey-variant: plaindebug
        spidermonkey-platform: linux
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-i686-linux-gnu
            - sysroot-x86_64-linux-gnu

sm-arm-sim-linux32/debug:
    description: "Spidermonkey ARM sim"
    index:
        job-name: sm-arm-sim-linux32-debug
    treeherder:
        platform: linux32/debug
        symbol: SM(arm)
    run:
        spidermonkey-variant: arm-sim
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-i686-linux-gnu
            - sysroot-x86_64-linux-gnu

sm-arm64-sim-linux64/debug:
    description: "Spidermonkey ARM64 sim"
    index:
        job-name: sm-arm64-sim-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(arm64)
    run:
        spidermonkey-variant: arm64-sim
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-asan-linux64/opt:
    description: "Spidermonkey Address Sanitizer"
    index:
        job-name: sm-linux64-asan-opt
    treeherder:
        symbol: SM(asan)
        platform: linux64/opt
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    run:
        spidermonkey-variant: asan
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-compacting-linux64/debug:
    description: "Spidermonkey Compacting"
    index:
        job-name: sm-compacting-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(cgc)
    run:
        spidermonkey-variant: compacting
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-linux64-wasi/opt:
    description: "Spidermonkey WASI opt build"
    index:
        job-name: sm-linux64-wasi-opt
    treeherder:
        platform: linux64/opt
        symbol: SM(wasi)
        tier: 2
    run:
        spidermonkey-variant: wasi
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi

# Like sm-linux64-wasi/opt but with Intl/ICU enabled.
sm-linux64-wasi-intl/opt:
    description: "Spidermonkey WASI Intl opt build"
    index:
        job-name: sm-linux64-wasi-intl-opt
    treeherder:
        platform: linux64/opt
        symbol: SM(wasi-intl)
        tier: 2
    run:
        spidermonkey-variant: wasi-intl
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi

sm-wasm-no-experimental-linux64/debug:
    description: "Spidermonkey WebAssembly No experimental features"
    index:
        job-name: sm-wasm-no-experimental-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(wasm-no-experimental)
        tier: 2
    run:
        spidermonkey-variant: wasm-noexperimental
    fetches:
        toolchain:
            - linux64-clang
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-rust
            - linux64-gcc
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-linux64-wasi-pbl/opt:
    description: "Spidermonkey WASI opt build with PBL"
    index:
        job-name: sm-pbl-linux64-wasi-opt
    treeherder:
        platform: linux64/opt
        symbol: SM(wasi-pbl)
        tier: 2
    run:
        spidermonkey-variant: wasi-pbl
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi

sm-msan-linux64/opt:
    description: "Spidermonkey Memory Sanitizer"
    index:
        job-name: sm-linux64-msan-opt
    treeherder:
        symbol: SM(msan)
        platform: linux64/opt
        tier: 3
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    run:
        spidermonkey-variant: msan
    # Disable by default by allow try pushes to explicitly request.
    run-on-projects: []
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-tsan-linux64/opt:
    description: "Spidermonkey Thread Sanitizer"
    index:
        job-name: sm-linux64-tsan-opt
    treeherder:
        symbol: SM(tsan)
        platform: linux64/opt
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    run:
        spidermonkey-variant: tsan
    fetches:
        toolchain:
            - linux64-clang
            - linux64-gcc
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-rust-dev
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-rootanalysis-linux64/debug:
    description: "Spidermonkey Root Analysis"
    index:
        job-name: sm-rootanalysis-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(r)
    run:
        spidermonkey-variant: rootanalysis
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-nonunified-linux64/debug:
    description: "Spidermonkey Non-Unified Debug"
    index:
        job-name: sm-nonunified-linux64-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(nu)
    run:
        spidermonkey-variant: nonunified
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-fuzzing-linux64/opt:
    description: "Spidermonkey Fuzzing"
    index:
        job-name: sm-linux64-fuzzing
    treeherder:
        platform: linux64/opt
        symbol: SM(f)
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    run:
        spidermonkey-variant: fuzzing
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-fuzzilli-linux64/debug:
    description: "Spidermonkey Fuzzilli debug"
    index:
        job-name: sm-linux64-fuzzilli-debug
    treeherder:
        platform: linux64/debug
        symbol: SM(fuzzilli)
    worker:
        env:
            MOZ_JS_UPLOAD_BINARIES_DEFAULT: "1"
    run:
        spidermonkey-variant: fuzzilli
    fetches:
        toolchain:
            - linux64-clang
            - linux64-rust
            - linux64-cbindgen
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu

sm-gdb-linux64/debug:
    description: "Spidermonkey GDB Pretty-printers"
    index:
        job-name: sm-gdb-linux64
    worker:
        docker-image: {in-tree: gdb-test}
    treeherder:
        platform: linux64/debug
        tier: 2
        symbol: SM(gdb)
    run:
        spidermonkey-variant: gdb
    fetches:
        toolchain:
            - linux64-clang
            - linux64-gcc
            - linux64-rust
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-breakpad-injector
            - linux64-minidump-stackwalk
            - linux64-llvm-symbolizer
            - linux64-pkgconf
            - sysroot-x86_64-linux-gnu
