Warnings/errors in jsapi_debug.rs cause very long log lines (>436K chars)
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: coop, Assigned: emilio)
References
Details
Attachments
(1 file)
This isn't even a failing example, but you can see the log line length problem here:
https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=rust&selectedJob=280326229
https://treeherder.mozilla.org/logviewer.html#?job_id=280326229&repo=autoland
Here's a log snippet:
[task 2019-12-09T18:06:36.007Z] warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
[task 2019-12-09T18:06:36.008Z] --> /builds/worker/workspace/build/src/target/debug/build/js-9a4fb89246aff8ca/out/jsapi_debug.rs:10:253507
[task 2019-12-09T18:06:36.008Z] |
[task 2019-12-09T18:06:36.008Z] 10 | # [ allow ( non_snake_case , non_camel_case_types , non_upper_case_globals ) ] pub mod root { # [ repr ( C ) ] # [ derive ( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ] pub struct __BindgenBitfieldUnit < Storage , Align > { storage : Storage , align : [ Align ; 0 ] , } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > { # [ inline ] pub fn new ( storage : Storage ) -> Self { Self { storage , align : [ ] } } } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > where Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] >, { # [ inline ] pub fn get_bit ( & self , index : usize ) -> bool { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = self . storage . as_ref ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; ...
I've truncated that final line (otherwise it would continue for over 436,000 characters) but that should give you something to grep for.That's the equiv of dumping a 6,000 LOC file on a single line. Worse still, there are 6 similar warnings in that log alone.
We process all the logs that come through Taskcluster and these new warnings were bad enough to cause bug 1602479 on our end.
We now have defensive code in place for this type of pathology when processing, but it still throws the browser for a loop when you try to view one of these logs in treeherder/taskcluster. I can't imagine if would be easy to actually find/fix the warning using the log in its current state.
Reporter | ||
Updated•4 years ago
|
Comment 1•4 years ago
|
||
This file is generated by js/rust/build.rs. It's using bindgen.
Emilio says that if you have rustfmt installed, it should generate nicely formatted code (not one huge line). But "the rust spidermonkey bindings thing are built in a very weird way, involving various docker things that I don't understand".
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
I think I managed to understand this: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5fa3bfff6bb1aa6654a9a6ed2cb84e89fda298a4
Assignee | ||
Comment 3•4 years ago
|
||
We build bindgen without the which
feeature, which means it won't try to
look for rustfmt
in $PATH. So point at it explicitly so that the bindings are
properly formatted.
We do the same for regular Gecko builds in build/mozconfig.rust
.
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
BTW, what's the state of the in-tree bindings vs. mozjs-sys?
We have two tasks: One building mozjs-sys with trunk spidermonkey, and one building js/rust
, which is mostly an old version of mozjs-sys, but not quite.
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
It does fix the issue per https://treeherder.mozilla.org/logviewer.html#?job_id=280901340&repo=try.
Comment 6•4 years ago
|
||
Servo doesn't rely on the in-tree bindings. You can do whatever you want with them.
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/419f2483e06c Explicitly point to rustfmt during spidermonkey rust build. r=glandium
Comment 8•4 years ago
|
||
bugherder |
Description
•