Open Bug 1511656 Opened 6 years ago Updated 2 years ago

Rebase (with format-source installed) fails with "abort: clang-format: mach exited with status 1"

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(Not tracked)

People

(Reporter: botond, Unassigned)

Details

Attachments

(1 file)

Attached is the output of the hg rebase command I ran, with the --debug flag.

Please let me know if there is any other information I can provide.

My v-c-t is updated to 525a58232933.
My problem was that, on this machine, I updated v-c-t and enabled the format-source extension in my .hgrc, but did not actually run |mach bootstrap|, and as a result did not have clang-format in .mozbuild.

Could have gotten a more helpful error message, though, along the lines of "clang-format not found, run <command> to install it".
Status: NEW → UNCONFIRMED
Ever confirmed: false
See Also: 1511594
Adding to the above in case anyone else ends up here: it appears this can also result from having an older clang-format. I'd last bootstrapped a couple of weeks ago and was seeing this issue while trying to rebase. After performing another `mach bootstrap`, I was able to merge.

As above, if a clearer warning message is possible, it would be useful to immediately know that clang-format needs updating.

Also seeing this; In my case, I'm trying to hg graft a patch from near tip to esr60:

resolving manifests
 branchmerge: True, force: True, partial: False
 ancestor: 2bf86657a448, local: db09f3a62a37+, remote: 01710e1d51de
 preserving js/src/jit/IonAnalysis.cpp for resolve of js/src/jit/IonAnalysis.cpp
 preserving js/src/jit/IonBuilder.cpp for resolve of js/src/jit/IonBuilder.cpp
 preserving js/src/jit/MIR.h for resolve of js/src/jit/MIR.h
 js/src/jit/IonAnalysis.cpp: versions differ -> m (premerge)
Files to be: js/src/jit/IonAnalysis.cpp js/src/jit/IonAnalysis.cpp js/src/jit/IonAnalysis.cpp
running /Users/mgaudet/mozilla-unified-clean-2/mach clang-format -assume-filename=$HG_FILENAME -p /var/folders/b7/yvcc5cld3wg97tl62wbcl9zw0000gn/T/tmplCc3hp.cpp
abort: clang-format: mach exited with status 1

If I run that mach command by hand, I see this error

/Users/mgaudet/mozilla-unified-clean-2/mach clang-format -assume-filename=js/src/jit/IonAnalysis.cpp -p /var/folders/b7/yvcc5cld3wg97tl62wbcl9zw0000gn/T/tmplCc3hp.cpp
It looks like you passed an unrecognized argument into mach.

The clang-format command does not accept the arguments: -assume-filename=js/src/jit/IonAnalysis.cpp

This is irksome, as support for clang-format --assume-filename isn't in ESR60's copy of mach (so mach bootstrap doesn't resolve this), and so I cannot graft this change, as graft works by having your current directory checked out to the target branch. (I think if I could figure out how to disable format source, this work work)

Status: UNCONFIRMED → NEW
Ever confirmed: true

I ended up dealing with the ESR case also. It was awhile ago, and IIRC only some grafts broke. I was able to hacked around the issues via:

  • Grafting Bug 1508635 (I believe I could get away with this and the next graft without explosions, if not, I may have applied via other means)
  • Grafting Bug 1509276
  • Commenting out these lines (not the exact revision I have of that file, but the lines are the same).
  • Edit: My notes say that I also needed to run ./mach static-analysis install --minimal-install manually since I commented out the above lines.

I expect the better way of doing this would be backporting all the relevant patches, but the above was enough to unblock me.

Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: