Closed Bug 1349479 Opened 7 years ago Closed 7 years ago

stylo: bindgen busted on llvm4.0

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: kuoe0.tw, Assigned: emilio)

References

Details

I built stylo and failed with the following messages.

--- Error Message ---
 1:12.41 error: failed to run custom build command for `style v0.0.1 (file:///Users/kuoe0/Works/Mozilla/gecko-dev/servo/components/style)`
 1:12.42 process didn't exit successfully: `/Users/kuoe0/Works/Mozilla/obj-central-default-darwin-desktop-stylo-debug/toolkit/library/debug/build/style-b3825590b01f853f/build-script-build` (exit code: 101)
 ...
 ...
 1:16.61
 1:16.61 --- stderr
 1:16.61 thread '<unnamed>' panicked at 'C'mon: Continue', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/result.rs:868
 1:16.61 note: Run with `RUST_BACKTRACE=1` for a backtrace.
 1:16.61 thread '<unnamed>' panicked at 'C'mon: Continue', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/result.rs:868
 1:16.61 thread '<unnamed>' panicked at 'C'mon: Continue', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/result.rs:868
 1:16.61 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/result.rs:868


--- System Env ---

OS: macOS 10.12
Rust: rustc 1.16.0 (30cf806ef 2017-03-10)
LLVM: 4.0.0


--- Mozconfig ---

export LLVM_CONFIG="/usr/local/opt/llvm/bin/llvm-config"
export LDFLAGS=-Wl,-no_compact_unwind

export CC="/usr/local/bin/ccache clang"
export CXX="/usr/local/bin/ccache clang++"

ac_add_options --with-ccache
ac_add_options --enable-stylo
ac_add_options --enable-debug
Summary: stylo: build failed on style v0.0.1 → stylo: build failed on style v0.0.1 on macOS 10.12
Hi Emilio, do you know how to make it compile? Thanks!
Flags: needinfo?(emilio+bugs)
Which version of clang are you using? We're tracking down a few issues with bindgen and newer libclang at https://github.com/servo/rust-bindgen/issues/584.

Meanwhile you can probably build with --disable-stylo-build-bindgen (http://searchfox.org/mozilla-central/rev/0079c7adf3b329bff579d3bbe6ac7ba2f6218a19/toolkit/moz.configure#580)
Flags: needinfo?(emilio+bugs)
My clang version is 4.0.0. I think this bug is as same as that issue.
Priority: -- → P5
I suggest this to be at least P3 (and probably P2) since it stops people from using newer version of llvm (I tried and got blocked for a day and eventually downgraded my llvm install to 3.9 to work around), and actually we need bindgen to get fixed soonish for other bustage as well.
Priority: P5 → P3
Ok, looks like you have a patch for it over in https://github.com/servo/rust-bindgen/pull/594
Assignee: nobody → xidorn+moz
Priority: P3 → P1
Summary: stylo: build failed on style v0.0.1 on macOS 10.12 → stylo: bindgen busted on llvm4.0
I'm not actively working on this... That patch itself doesn't fix all problems. The main issue is that bindgen master doesn't work properly at all with stylo even with older llvm, which is the actual blocker. We need to wait for that to be solved before we can confidently try to fix it with llvm 4.0.
Assignee: xidorn+moz → nobody
Ok. Do we have somebody on point for fixing the bindgen regression? fitzgen?
Flags: needinfo?(nfitzgerald)
I've been in work weeks for the last week and a half and through the end of this week, so I haven't had time to do any hacking (and won't again until next week). However, this is a blocker for me landing my SM rust bindings stuff, so I'll definitely get to it eventually.

Anyone else should feel free to steal the work from me if you urgently need a fix.
Flags: needinfo?(nfitzgerald)
Ok, I'll mark this as assigned to fitzgen, and we can steal it if somebody needs it sooner.
Assignee: nobody → nfitzgerald
On OS X (where "brew install llvm" now gives 4.0.0) I’ve worked around this by running "brew install llvm@3.9" and changing .mozconfig to:

export LLVM_CONFIG="/usr/local/opt/llvm@3.9/bin/llvm-config"
(In reply to Simon Sapin (:SimonSapin) from comment #10)
> On OS X (where "brew install llvm" now gives 4.0.0) I’ve worked around this
> by running "brew install llvm@3.9" and changing .mozconfig to:
> 
> export LLVM_CONFIG="/usr/local/opt/llvm@3.9/bin/llvm-config"

I have tried this work around last week, and it still failed. There are some settings in my mozconfig and it works.

```
export PATH="/usr/local/opt/llvm@3.9/bin:$PATH"
export CPPFLAGS="-I/usr/local/opt/llvm@3.9/include"
export LDFLAGS="-L/usr/local/opt/llvm@3.9/lib -Wl,-no_compact_unwind,-rpath,/usr/local/opt/llvm@3.9/lib"
```
Stylo bindings are now working again on master bindgen with libclang 3.9.

Unfortunately, there is a regression in libclang >= 4 surrounding default template type parameters, which I suspect Stylo bindings hit but I'm not 100% sure as I haven't explicitly rebuilt libclang 4 and tested again.

Emilio is working on upstreaming a fix, but I don't know if Clang will uplift it to the 4.X series or if we jsut have to say either use 3.9 or tip.

https://bugs.llvm.org/show_bug.cgi?id=32539
https://reviews.llvm.org/D31732
https://github.com/servo/rust-bindgen/issues/585

Reassigning this bug to Emilio since he is already working on the upstream fix, and there isn't anything else left AFAIK.
Assignee: nfitzgerald → emilio+bugs
--enable-stylo on mozilla-central with below patch seems to build fine with LLVM 4.0.1rc1 for me. Are we waiting for something more?

https://github.com/jbeich/gecko-dev/commit/4e3da5030b45
Flags: needinfo?(emilio+bugs)
Nope!, the recent bindgen update should've fixed both llvm 4.0 and 5.0. Thanks for checking!
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(emilio+bugs)
Resolution: --- → FIXED
See Also: → 1363666
You need to log in before you can comment on or make changes to this bug.