Closed Bug 1819784 Opened 3 years ago Closed 3 years ago

FileNotFoundError: [Errno 2] No such file or directory: '$HOME/.mozbuild/clang-tools/clang-tidy/bin/clang-format'

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect

Tracking

(firefox-esr102 unaffected, firefox110 unaffected, firefox111 unaffected, firefox112 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- unaffected
firefox111 --- unaffected
firefox112 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

From bug 1816443 comment 4:

This commit broke clang-format for me. I would get the following error when trying to run ./mach clang-format. Backing out this change fixed it for me and allowed clang-tidy/format to be installed into .mozbuild.

I'm running on a M1 Macbook.

Error running mach:

    ['static-analysis', 'install']

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 static-analysis| 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:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/rhunt/.mozbuild/clang-tools/clang-tidy/bin/clang-format'

  File "/Users/rhunt/src/mz/python/mozbuild/mozbuild/code_analysis/mach_commands.py", line 1024, in install
    rc, _ = get_clang_tools(
  File "/Users/rhunt/src/mz/python/mozbuild/mozbuild/code_analysis/mach_commands.py", line 1580, in get_clang_tools
    return get_clang_tools(
  File "/Users/rhunt/src/mz/python/mozbuild/mozbuild/code_analysis/mach_commands.py", line 1602, in get_clang_tools
    return 0 if _is_version_eligible(command_context, clang_paths) else 1, clang_paths
  File "/Users/rhunt/src/mz/python/mozbuild/mozbuild/code_analysis/mach_commands.py", line 512, in _is_version_eligible
    current_version = _get_current_version(command_context, clang_paths)
  File "/Users/rhunt/src/mz/python/mozbuild/mozbuild/code_analysis/mach_commands.py", line 482, in _get_current_version
    subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/rhunt/src/mz/third_party/python/sentry_sdk/sentry_sdk/integrations/stdlib.py", line 190, in sentry_patched_popen_init
    rv = old_popen_init(self, *a, **kw)  # type: ignore
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

A workaround until this lands:

--- a/taskcluster/ci/toolchain/clang-tidy.yml
+++ b/taskcluster/ci/toolchain/clang-tidy.yml
@@ -77,6 +77,7 @@ macosx64-arch64-clang-tidy:
             - 'build/build-clang/clang-tidy-macosx64.json'
             - 'build/build-clang/macosx64.json'
             - 'build/build-clang/macosx64-aarch64.json'
+        toolchain-alias: macosx64-aarch64-clang-tidy
     fetches:
         toolchain:
             - linux64-clang-15

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

Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/bb7af766ab32 Fix arm64 mac clang-tidy toolchain naming. r=firefox-build-system-reviewers,andi
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Thank you for fixing this!

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

Attachment

General

Created:
Updated:
Size: