Closed Bug 1753047 Opened 2 years ago Closed 2 years ago

Bootstrap / toolchains fail in git checkout without origin remote

Categories

(Firefox Build System :: Task Configuration, defect)

defect

Tracking

(firefox-esr91 unaffected, firefox96 unaffected, firefox97 unaffected, firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox96 --- unaffected
firefox97 --- unaffected
firefox98 --- fixed

People

(Reporter: emilio, Assigned: ahal)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files, 1 obsolete file)

My remote is called mozilla (I guess at some point I git remote rename origin mozilla or something).

$ mach artifact toolchain --bootstrap --from-build linux64-clang-tidy                                                                                                                                                                    
/home/emilio/src/moz/gecko/mach:81: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils
error: No such remote 'origin'
Error running mach:

    ['artifact', 'toolchain', '--bootstrap', '--from-build', 'linux64-clang-tidy']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file artifact| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

subprocess.CalledProcessError: Command '('/usr/bin/git', 'remote', 'get-url', 'origin')' returned non-zero exit status 2.

  File "/home/emilio/src/moz/gecko/python/mozbuild/mozbuild/artifact_commands.py", line 380, in artifact_toolchain
    tasks = toolchain_task_definitions()
  File "/home/emilio/src/moz/gecko/python/mozbuild/mozbuild/toolchains.py", line 19, in toolchain_task_definitions
    toolchains = load_tasks_for_kind(params, "toolchain", root_dir=root_dir)
  File "/home/emilio/src/moz/gecko/taskcluster/gecko_taskgraph/generator.py", line 490, in load_tasks_for_kind
    for task in tgg.full_task_set
  File "/home/emilio/src/moz/gecko/taskcluster/gecko_taskgraph/generator.py", line 163, in full_task_set
    return self._run_until("full_task_set")
  File "/home/emilio/src/moz/gecko/taskcluster/gecko_taskgraph/generator.py", line 435, in _run_until
    k, v = next(self._run)
  File "/home/emilio/src/moz/gecko/taskcluster/gecko_taskgraph/generator.py", line 264, in _run
    parameters = self._parameters(graph_config)
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py", line 318, in get_parameters
    parameters = load_parameters_file(
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py", line 274, in load_parameters_file
    return Parameters(strict=strict, repo_root=repo_root, **overrides)
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py", line 121, in __init__
    kwargs = Parameters._fill_defaults(repo_root=repo_root, **kwargs)
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py", line 161, in _fill_defaults
    defaults.update(fn(repo_root))
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/parameters.py", line 65, in _get_defaults
    "base_repository": repo.get_url(),
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/util/vcs.py", line 135, in get_url
    return self.run("remote", "get-url", remote).strip()
  File "/home/emilio/src/moz/gecko/third_party/python/taskcluster_taskgraph/taskgraph/util/vcs.py", line 28, in run
    return subprocess.check_output(cmd, cwd=self.path, universal_newlines=True)
  File "/usr/lib64/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,

Sentry event ID: 30d1dc1178a440a180da0ff9b9868144
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit
Flags: needinfo?(ahal)

I'm out sick today, so yet another backout is probably best. Fwiw I even set up a git-cinnabar clone to test it this time, but I guess my remote is called origin, sigh :)

There's no need to even be calling get_url here, we can hardcode the params to what the old values used to be in Gecko. The only gotcha is that the fix will need to happen in the upstream taskgraph repo. I can publish a release to pypi if anyone wants to try to submit a fix there, or I can try and get a fix up at some point by tonight, but otherwise I guess back it out again

Flags: needinfo?(ahal)

I'm ok not backing out if I'm the only one with this problem for now, fwiw, can wait for a few days typing origin, I'll probably have a few misses on muscle memory but...

I might try to do that if this gets too annoying :)

jgraham was also hitting it at least, it's up to you. There's no particular rush on having that bug fixed.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

This call will raise if there's no remote called "origin". If this happens, an
empty string may still work as a default (and in Gecko we'll be overriding it
anyway).

Attachment #9261708 - Attachment is obsolete: true
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/ci/taskgraph/rev/f1ff40653baa
Catch call to repo.get_url() and use an empty string if there's an exception, r=releng-reviewers,jmaher
https://hg.mozilla.org/ci/taskgraph/rev/78b8548bcd52
Version bump to taskgraph 1.1.4, r=releng-reviewers,jmaher
Attachment #9261774 - Attachment description: WIP: Bug 1753047 - [taskgraph] Use hardcoded values for default 'base_repository' and 'head_repository' parameters → Bug 1753047 - [taskgraph] Use hardcoded values for default 'base_repository' and 'head_repository' parameters, r?#releng-reviewers!
Attachment #9261775 - Attachment description: WIP: Bug 1753047 - Update vendored taskgraph to 1.1.4 → Bug 1753047 - Update vendored taskgraph to 1.1.4, r?#releng-reviewers!
Assignee: emilio → ahal

Set release status flags based on info from the regressing bug 1746414

Has Regression Range: --- → yes
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d93bf3a612f5
[taskgraph] Use hardcoded values for default 'base_repository' and 'head_repository' parameters, r=releng-reviewers,jmaher,aki
https://hg.mozilla.org/integration/autoland/rev/111381fbf62d
Update vendored taskgraph to 1.1.4, r=releng-reviewers,jcristau
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Component: Toolchains → Task Configuration
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: