Closed Bug 1655161 Opened 4 years ago Closed 4 years ago

mach clang-format fails (bytes-like object is required, not 'str')

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(firefox-esr68 unaffected, firefox-esr78 unaffected, firefox79 unaffected, firefox80 fixed)

RESOLVED WORKSFORME
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- unaffected
firefox80 --- fixed

People

(Reporter: kats, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Running ./mach clang-format -c HEAD

Error running mach:

    ['clang-format', '-c', 'HEAD']

The error occurred in the implementation of the invoked mach command.

This should never occur and is likely a bug in the implementation of that
command.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file clang-format| 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:

TypeError: a bytes-like object is required, not 'str'

  File "/home/kats/zspace/gecko-tests/python/mozbuild/mozbuild/code-analysis/mach_commands.py", line 1724, in clang_format
    self._clang_format_path, commit, output)
  File "/home/kats/zspace/gecko-tests/python/mozbuild/mozbuild/code-analysis/mach_commands.py", line 2150, in _run_clang_format_diff
    diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
  File "/home/kats/zspace/gecko-tests/python/mozbuild/mozbuild/code-analysis/mach_commands.py", line 2092, in _get_clang_format_diff_command
    pattern = pattern.replace('.*', '**')
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

Keywords: regression
Regressed by: 1606475
Has Regression Range: --- → yes
Component: General → Lint and Formatting

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

Can you please take a look at this regression?

Flags: needinfo?(hamzah18051)

It's weird that this is happening.
An exact same regression was fixed in bug1606475
I'll try to look what's the issue behind this

Flags: needinfo?(hamzah18051)

Let me double-check it's still happening. Maybe I was running a bad version of the code.

Hm, indeed on a more recent version of code I don't see this anymore. I'll close for now but I can reopen if I see it again.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.