Closed Bug 2073844 Opened 2 months ago Closed 2 months ago

Set MOZCONFIG on build tasks from taskgraph instead of composing it in mozharness

Categories

(Release Engineering :: Applications: MozharnessCore, task, P3)

Tracking

(firefox159 fixed)

RESOLVED FIXED
Tracking Status
firefox159 --- fixed

People

(Reporter: ahochheiden, Assigned: ahochheiden)

References

(Blocks 1 open bug)

Details

Attachments

(5 external files)

Build tasks let mozharness compose the mozconfig path from keys spread over its config files. The path is task configuration, so taskgraph computes it and sets MOZCONFIG in the task environment, mozharness reads it from there, and the keys leave the configs. No build changes its mozconfig. comm-central builds through the same kinds and will need to name its application in its kind yml.

The mozconfig a build uses is task configuration, and taskgraph already
resolves the variant, so it computes the path and passes it to the task
as MOZCONFIG. The platform defaults to the longest mozconfig directory
name that prefixes the task name, the application to browser or to
mobile/android for Android platforms. A task with config-paths has
to name its application, so comm-central fails at graph generation
instead of building from Firefox mozconfigs. Kinds that took a variant,
platform or application from a mozharness config now say so in their
kind definitions. artifact-build and valgrind do not run the build
transforms and set the variable directly. The macOS unify tasks never
run mozharness and get nothing.

The task environment's MOZCONFIG is the source path relative to the
checkout, which mozharness copies to .mozconfig with
extra_mozconfig_content appended. mozharness then points the build
environment's MOZCONFIG at that .mozconfig, since mach reads
MOZCONFIG before .mozconfig and the extra content would otherwise be
dropped. get_mozconfig_path stays for desktop_l10n.py.

Nothing reads app_name, mozconfig_platform, mozconfig_variant or
src_mozconfig from these files any more. The variant configs stay
because most of them still carry debug_build, env,
disable_package_metrics or postflight_build_mach_commands, and the
Android ones that end up empty keep --custom-build-variant-cfg set,
which _is_configuration_shipped checks through build_variant.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7fff2c491331 https://hg.mozilla.org/integration/autoland/rev/4ad924813fdf Set `MOZCONFIG` in the environment of mozharness build tasks from taskgraph. r=ahal,taskgraph-reviewers,releng-reviewers https://github.com/mozilla-firefox/firefox/commit/8be914ff1e59 https://hg.mozilla.org/integration/autoland/rev/5d4bf7f7aa09 Take the mozconfig path from `MOZCONFIG` in mozharness builds. r=ahal https://github.com/mozilla-firefox/firefox/commit/6b7428c2d74c https://hg.mozilla.org/integration/autoland/rev/4899fbd90ba5 Drop the mozconfig keys from the mozharness build configs. r=ahal
Pushed by nfay@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2de3d0a44422 https://hg.mozilla.org/integration/autoland/rev/245aefc97efe Revert "Bug 2073844, Bug 2073826, Bug 2073829, Bug 2073828 - Drop the mozconfig keys from the mozharness build configs. r=ahal" for causing Gecko Decision bustage

Backed out for causing Gecko Decision bustage

Backout link

Push with failures

Failure log

Flags: needinfo?(ahochheiden)
Flags: needinfo?(ahochheiden)

Conflicted with bug 2058679. Fixed now.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/27f59a6e6167 https://hg.mozilla.org/integration/autoland/rev/2a1657fea830 Set `MOZCONFIG` in the environment of mozharness build tasks from taskgraph. r=ahal,taskgraph-reviewers,releng-reviewers https://github.com/mozilla-firefox/firefox/commit/d947ae6ed1aa https://hg.mozilla.org/integration/autoland/rev/c8bdd8da4205 Take the mozconfig path from `MOZCONFIG` in mozharness builds. r=ahal https://github.com/mozilla-firefox/firefox/commit/e719470568dc https://hg.mozilla.org/integration/autoland/rev/bacf6204bdfb Drop the mozconfig keys from the mozharness build configs. r=ahal

How does this potentially impact Thunderbird? FYI Alex

(In reply to Toby Pilling [:tobyp] from comment #9)

How does this potentially impact Thunderbird? FYI Alex

I'm already trying to check for firefox, but even directly from autoland (so no enterprise specific tree, pure autoland) I cannot push it to try:

$  ./mach try fuzzy -q "'marionette | 'xpcshell"
"""
Traceback (most recent call last):
  File "/usr/lib/python3.14/concurrent/futures/process.py", line 254, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/home/alex/.mozbuild/srcdirs/gecko-cinnabar-afdce27966eb/_virtualenvs/try/lib/python3.14/site-packages/taskgraph/generator.py", line 109, in load_tasks
    for task_dict in transforms(trans_config, inputs)
                     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2862, in check_run_task_caches
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2772, in check_perf_task_fission_filtering
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2757, in check_task_dependencies
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2743, in check_task_identifiers
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2724, in chain_of_trust
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2513, in build_task
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2443, in set_task_and_artifact_expiry
    for job in jobs:
               ^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2425, in try_task_config_routes
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2413, in try_task_config_priority
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2380, in try_task_config_env
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2362, in add_github_checks_route
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2329, in add_index_routes
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2080, in validate
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2054, in task_name_from_label
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2044, in setup_raptor
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 1991, in set_defaults
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 1948, in set_implementation
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/job/__init__.py", line 387, in use_fetches
    raise Exception(
    ...<2 lines>...
    )
Exception: android-x86_64-shippable/opt can't fetch instrumented-build-android-x86_64-shippable/opt artifacts because it has no instrumented-build-android-x86_64-shippable/opt dependencies!
"""

Am I missing something here?

Flags: needinfo?(ahochheiden)

Authored by https://github.com/ahochheiden
https://github.com/mozilla/enterprise-firefox/commit/7fff2c4913312b460004ca162e548c7232b0e2af
[enterprise-main] Bug 2073844 - Set MOZCONFIG in the environment of mozharness build tasks from taskgraph. r=ahal,taskgraph-reviewers,releng-reviewers

Authored by https://github.com/ahochheiden
https://github.com/mozilla/enterprise-firefox/commit/8be914ff1e59962aac996de0d8de2dddf4f66238
[enterprise-main] Bug 2073844 - Take the mozconfig path from MOZCONFIG in mozharness builds. r=ahal

Authored by https://github.com/ahochheiden
https://github.com/mozilla/enterprise-firefox/commit/6b7428c2d74c44134278c104d05e70f37c7dfb5a
[enterprise-main] Bug 2073844 - Drop the mozconfig keys from the mozharness build configs. r=ahal

Authored by Norisz Fay
https://github.com/mozilla/enterprise-firefox/commit/2de3d0a444223be49e2e0e3423ff6e094042d150
[enterprise-main] Revert "Bug 2073844, Bug 2073826, Bug 2073829, Bug 2073828 - Drop the mozconfig keys from the mozharness build configs. r=ahal" for causing Gecko Decision bustage

(via GitHub webhook, authenticated as shared-secret)

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

(In reply to :gerard-majax from comment #13)

(In reply to Toby Pilling [:tobyp] from comment #9)

How does this potentially impact Thunderbird? FYI Alex

I'm already trying to check for firefox, but even directly from autoland (so no enterprise specific tree, pure autoland) I cannot push it to try:

$  ./mach try fuzzy -q "'marionette | 'xpcshell"
"""
Traceback (most recent call last):
  File "/usr/lib/python3.14/concurrent/futures/process.py", line 254, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/home/alex/.mozbuild/srcdirs/gecko-cinnabar-afdce27966eb/_virtualenvs/try/lib/python3.14/site-packages/taskgraph/generator.py", line 109, in load_tasks
    for task_dict in transforms(trans_config, inputs)
                     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2862, in check_run_task_caches
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2772, in check_perf_task_fission_filtering
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2757, in check_task_dependencies
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2743, in check_task_identifiers
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2724, in chain_of_trust
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2513, in build_task
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2443, in set_task_and_artifact_expiry
    for job in jobs:
               ^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2425, in try_task_config_routes
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2413, in try_task_config_priority
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2380, in try_task_config_env
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2362, in add_github_checks_route
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2329, in add_index_routes
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2080, in validate
    yield from tasks
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2054, in task_name_from_label
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 2044, in setup_raptor
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 1991, in set_defaults
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/task.py", line 1948, in set_implementation
    for task in tasks:
                ^^^^^
  File "/home/alex/firefox/gecko-cinnabar/taskcluster/gecko_taskgraph/transforms/job/__init__.py", line 387, in use_fetches
    raise Exception(
    ...<2 lines>...
    )
Exception: android-x86_64-shippable/opt can't fetch instrumented-build-android-x86_64-shippable/opt artifacts because it has no instrumented-build-android-x86_64-shippable/opt dependencies!
"""

Am I missing something here?

As discussed on Slack, I believe this was against the Fix merge conflict change by :smolnar. It's confusing because the backout of bug 2058679 made the merge conflict resolution of this tricky, and as a result this got backed out too.

(In reply to Toby Pilling [:tobyp] from comment #9)

How does this potentially impact Thunderbird? FYI Alex

Thunderbird will need some changes, same as enterprise. I'm gonna refactor these patches a bit to make doing that easier/simpler.

Flags: needinfo?(ahochheiden)

Thanks a ton, much appreciated

The goal is for every build to use one mozconfig file from the tree, so
that MOZCONFIG=<that file> ./mach build reproduces it locally. Some
builds instead had mozharness append extra lines to a copy of their
mozconfig at run time. Those lines now live in new mozconfig files that
source the original and add them.

Attachment #9645556 - Attachment description: Bug 2073844 - Set `MOZCONFIG` in the environment of mozharness build tasks from taskgraph. r?ahal → Bug 2073844 - Set `MOZCONFIG` in the environment of build tasks from a `mozconfig` key. r?ahal
See Also: → 2075468
Pushed by nfay@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3a28734ebb54 https://hg.mozilla.org/integration/autoland/rev/40e8b9493d3b Revert "Bug 2073844 - Drop the mozconfig keys from the mozharness build configs. r=ahal" for causing gecko decision bustage

Backed out for causing gecko decision bustage

Backout link

Push with failures

Failure log

Flags: needinfo?(ahochheiden)
Flags: needinfo?(ahochheiden)

I should have anticipated that interaction. Oh well, I'll wait until the a-s patches stick the landing, then rebase.

Authored by https://github.com/lissyx
https://github.com/mozilla/enterprise-firefox/commit/92bc1d2cd811099dc2449979688f7c56a0788eff
[enterprise-main] Merge pull request #1577 from ahochheiden/mozconfig-key-pr

(via GitHub webhook, authenticated as shared-secret)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: