Closed
Bug 1361003
Opened 7 years ago
Closed 7 years ago
cargo errors during rust vendoring should be printed
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: glob, Assigned: glob)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
2.09 KB,
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
the error message produced should `mach vendor rust` fail is not useful - it contains just that executing cargo failed and a stacktrace to the run_process fn. $ ./mach vendor rust 0:02.88 rm -rf /home/servo-sync/firefox-overlay/third_party/rust 0:02.88 /home/servo-sync/.cargo/bin/cargo update --manifest-path /home/servo-sync/firefox-overlay/toolkit/library/rust/Cargo.toml -p gkrust Error running mach: ['vendor', 'rust'] 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 should consider filing a bug for this issue. If filing a bug, please include the full output of mach, including this error message. The details of the failure are as follows: Exception: Process executed with non-0 exit code 101: [u'/home/servo-sync/.cargo/bin/cargo', u'update', u'--manifest-path', u'/home/servo-sync/firefox-overlay/toolkit/library/rust/Cargo.toml', u'-p', u'gkrust'] File "/home/servo-sync/firefox-overlay/python/mozbuild/mozbuild/mach_commands.py", line 1819, in vendor_rust vendor_command.vendor(**kwargs) File "/home/servo-sync/firefox-overlay/python/mozbuild/mozbuild/vendor_rust.py", line 275, in vendor self._run_command_in_srcdir(args=[cargo, 'update', '--manifest-path', mozpath.join(path, 'Cargo.toml'), '-p', lib]) File "/home/servo-sync/firefox-overlay/python/mozbuild/mozbuild/base.py", line 600, in _run_command_in_srcdir return self.run_process(cwd=self.topsrcdir, **args) File "/home/servo-sync/firefox-overlay/python/mach/mach/mixin/process.py", line 147, in run_process raise Exception('Process executed with non-0 exit code %d: %s' % (status, args)) running cargo directly shows the actual error message: $ cargo update --manifest-path /home/servo-sync/firefox-overlay/toolkit/library/rust/Cargo.toml -p gkrust Updating registry `https://github.com/rust-lang/crates.io-index` error: failed to select a version for `smallvec` (required by `style`): all possible versions conflict with previously selected versions of `smallvec` version 0.3.2 in use by smallvec v0.3.2 possible versions to select: 0.3.3 this error should have been included in the output of `mach vendor rust`.
Comment 1•7 years ago
|
||
We're currently calling `run_process` to invoke cargo (by way of `_run_command_in_srcdir`), which uses mozprocess under the hood: https://dxr.mozilla.org/mozilla-central/rev/5278e2a35fc8f2be390243db1e62858bf0982055/python/mach/mach/mixin/process.py#133 I'd have to look at the mozprocess docs/code to see if there's anything nice it gives us to handle this situation. If not, we could just use `subprocess.check_call` directly, which will raise a `CalledProcessError` if the command fails, which will give us stderr in the exception object: https://docs.python.org/2.7/library/subprocess.html#subprocess.check_call
Updated•7 years ago
|
Component: mach → Build Config
Blocks: stylo-tooling
Comment 3•7 years ago
|
||
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #1) > We're currently calling `run_process` to invoke cargo (by way of > `_run_command_in_srcdir`), which uses mozprocess under the hood: > https://dxr.mozilla.org/mozilla-central/rev/ > 5278e2a35fc8f2be390243db1e62858bf0982055/python/mach/mach/mixin/process. > py#133 > > I'd have to look at the mozprocess docs/code to see if there's anything nice > it gives us to handle this situation. If not, we could just use > `subprocess.check_call` directly, which will raise a `CalledProcessError` if > the command fails, which will give us stderr in the exception object: > https://docs.python.org/2.7/library/subprocess.html#subprocess.check_call It doesn't look like the mozprocess code provides anything nice for dealing with stderr, just code to process stdout as it comes in. subprocess.check_call it is!
minor update to silence .cargo/config instructions.
Attachment #8879437 -
Attachment is obsolete: true
Attachment #8879437 -
Flags: review?(ted)
Attachment #8879441 -
Flags: review?(ted)
*sigh* updated so it applies to tip, instead of a revision from march. sorry about the bugspam.
Attachment #8879441 -
Attachment is obsolete: true
Attachment #8879441 -
Flags: review?(ted)
Attachment #8879449 -
Flags: review?(ted)
Comment 7•7 years ago
|
||
Comment on attachment 8879449 [details] [diff] [review] 1361003_3.patch Review of attachment 8879449 [details] [diff] [review]: ----------------------------------------------------------------- I know we have some niceties in mozprocess that we'll probably lose out on here, like timeout handling, but in automation that generally gets handled in other layers anyway. ::: python/mozbuild/mozbuild/vendor_rust.py @@ +271,5 @@ > ('geckodriver', 'testing/geckodriver'), > ) > for (lib, crate_root) in crates_and_roots: > path = mozpath.join(self.topsrcdir, crate_root) > + # We use check_call instead of mozprocess to ensure errors are displayed. See bug 1361003 I don't think the "see bug X" comment is really necessary, that's what blame is for.
Attachment #8879449 -
Flags: review?(ted) → review+
Comment 8•7 years ago
|
||
I think I originally meant `check_output`, but I guess it's not really important to hide the stdout of these commands, and in fact it might be better to have it all printed.
previous patch conflicts with bug 1369156. carrying forward r+
Attachment #8879449 -
Attachment is obsolete: true
Attachment #8880246 -
Flags: review+
Keywords: checkin-needed
Comment 10•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c6bfc0bcf3c8 Use check_call when calling "mach vendor rust". r=ted
Keywords: checkin-needed
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c6bfc0bcf3c8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•