# 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
    - fetch

transforms:
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

task-defaults:
    attributes:
        cron: true
        # This enables uploading symbols.
        enable-full-crashsymbols: true
    fetches:
        toolchain:
            - linux64-dump_syms
    treeherder:
        platform: symbols/opt
        kind: other
        tier: 2
    worker-type: b-linux-gcp
    worker:
        env:
            MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE: system

tasks:
    mac:
        description: Extract macOS system symbols found in crashreports
        attributes:
            build_platform: macos
        index:
            product: system-symbols
            job-name: mac
            type: generic
        worker:
            env:
                PROCESSED_PACKAGES_INDEX: gecko.v2.mozilla-central.latest.system-symbols.mac
                PROCESSED_PACKAGES_PATH: public/build/processed-packages.gz
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-mac}
            max-run-time: 28800
        run:
            using: run-task
            command: >-
                ./run.sh
        treeherder:
            symbol: system-symbols-mac
        fetches:
            toolchain:
                - linux64-libdmg
    win:
        description: Extract windows system symbols found in crashreports
        attributes:
            build_platform: windows
        index:
            product: system-symbols
            job-name: win
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-win}
            max-run-time: 3600
        run:
            using: run-task
            command: >-
                ./run.sh
        treeherder:
            symbol: system-symbols-win
    archlinux:
        description: Extract ArchLinux system symbols found in crashreports
        attributes:
            build_platform: archlinux
        index:
            product: system-symbols
            job-name: archlinux
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh arch
        treeherder:
            symbol: sys-symbols-archlinux
        fetches:
            fetch:
                - symbol-scrapers
    debian:
        description: Extract Debian system symbols found in crashreports
        attributes:
            build_platform: debian
        index:
            product: system-symbols
            job-name: debian
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh debian
        treeherder:
            symbol: sys-symbols-debian
        fetches:
            fetch:
                - symbol-scrapers
    firefox-snap:
        description: Extract Firefox Snap symbols found in crashreports
        attributes:
            build_platform: firefox-snap
        index:
            product: system-symbols
            job-name: firefox-snap
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh firefox-snap
        treeherder:
            symbol: firefox-symbols-snap
        fetches:
            fetch:
                - symbol-scrapers
    flatpak:
        description: Extract Firefox Flatpak symbols found in crashreports
        attributes:
            build_platform: firefox-flatpak
        index:
            product: system-symbols
            job-name: firefox-flatpak
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh firefox-flatpak
        treeherder:
            symbol: firefox-symbols-fltpk
        fetches:
            fetch:
                - symbol-scrapers
    gnome-sdk-snap:
        description: Extract GNOME SDK Snap symbols found in crashreports
        attributes:
            build_platform: gnome-sdk-snap
        index:
            product: system-symbols
            job-name: gnome-sdk-snap
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh gnome-sdk-snap
        treeherder:
            symbol: gnome-sdk-symbols-snap
        fetches:
            fetch:
                - symbol-scrapers
    fedora:
        description: Extract Fedora system symbols found in crashreports
        attributes:
            build_platform: fedora
        index:
            product: system-symbols
            job-name: fedora
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh fedora
        treeherder:
            symbol: sys-symbols-fedora
        fetches:
            fetch:
                - symbol-scrapers
    opensuse:
        description: Extract OpenSUSE system symbols found in crashreports
        attributes:
            build_platform: opensuse
        index:
            product: system-symbols
            job-name: opensuse
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh opensuse
        treeherder:
            symbol: sys-symbols-opensuse
        fetches:
            fetch:
                - symbol-scrapers
    ubuntu:
        description: Extract Ubuntu system symbols found in crashreports
        attributes:
            build_platform: ubuntu
        index:
            product: system-symbols
            job-name: ubuntu
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 18000
        run:
            using: run-task
            command: >-
                ./run.sh ubuntu
        treeherder:
            symbol: sys-symbols-ubuntu
        fetches:
            fetch:
                - symbol-scrapers
    win-gfx:
        description: Extract symbols from closed-source Windows graphics drivers
        attributes:
            build_platform: windows-graphics
        index:
            product: system-symbols
            job-name: win-gfx
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-win-gfx}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh
        treeherder:
            symbol: sys-symbols-win-gfx
        fetches:
            fetch:
                - symbol-scrapers
            toolchain:
                - linux64-cabextract
                - linux64-7zz
    alpine:
        description: Extract Alpine Linux system symbols found in crashreports
        attributes:
            build_platform: alpine
        index:
            product: system-symbols
            job-name: alpine
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh alpine
        treeherder:
            symbol: sys-symbols-alpine
        fetches:
            fetch:
                - symbol-scrapers
    thunderbird-snap:
        description: Extract Thunderbird Snap symbols found in crashreports
        attributes:
            build_platform: thunderbird-snap
        index:
            product: system-symbols
            job-name: thunderbird-snap
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh thunderbird-snap
        treeherder:
            symbol: tbird-symbols-snap
        fetches:
            fetch:
                - symbol-scrapers
    raspberry-pi-os:
        description: Extract Raspberry Pi OS system symbols found in crashreports
        attributes:
            build_platform: raspberry-pi-os
        index:
            product: system-symbols
            job-name: raspberry-pi-os
            type: generic
        worker:
            artifacts:
                - name: public/build
                  type: directory
                  path: /builds/worker/artifacts/
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 14400
        run:
            using: run-task
            command: >-
                ./run.sh raspberry-pi-os
        treeherder:
            symbol: sys-symbols-rpios
        fetches:
            fetch:
                - symbol-scrapers
