Closed Bug 1602651 Opened 4 years ago Closed 4 years ago

Warnings/errors in jsapi_debug.rs cause very long log lines (>436K chars)

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox73 fixed)

RESOLVED FIXED
mozilla73
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.

Summary: Warnings/errors in jsapi_debug.rs cause very long lines (>436K chars) → Warnings/errors in jsapi_debug.rs cause very long log lines (>436K chars)

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".

Flags: needinfo?(emilio)
Priority: -- → P2

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.

Assignee: nobody → emilio

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.

Flags: needinfo?(josh)
Component: JavaScript Engine → General
Priority: P2 → --
Product: Core → Firefox Build System

Servo doesn't rely on the in-tree bindings. You can do whatever you want with them.

Flags: needinfo?(josh)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/419f2483e06c
Explicitly point to rustfmt during spidermonkey rust build. r=glandium
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: