Closed Bug 1528848 Opened 5 years ago Closed 5 years ago

Thunderbird build on Debian stretch fails on stylo

Categories

(Thunderbird :: Build Config, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bugzilla, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

Build bug on current versions between 16~18Feb2019.
Run on up-to-date Debian stable (=stretch).
Yesterday, I re-downloaded thunderbird and did the 'mach bootstrap'
to help ensure my tools were current.
I reran hg pull -u / mach build several times.

Actual results:

38:35.46 Compiling jsrust_shared v0.1.0 (thunderbird/js/src/rust/shared)
38:56.64 error[E0308]: mismatched types
38:56.64 --> thunderbird/obj-x86_64-pc-linux-gnu/x86_64-unknown-linux-gnu/debug/build/style-c1a12de0b6472119/out/gecko_properties.rs:4502:38
38:56.64 |
38:56.64 4502 | self.gecko.mScrollMargin.0 = v;
38:56.64 | ^ expected struct gecko_bindings::structs::root::mozilla::StyleCSSPixelLength, found struct values::computed::length::CSSPixelLength
38:56.64 |
38:56.64 = note: expected type gecko_bindings::structs::root::mozilla::StyleCSSPixelLength
38:56.64 found type values::computed::length::CSSPixelLength
38:56.78 error[E0308]: mismatched types
38:56.78 --> thunderbird/obj-x86_64-pc-linux-gnu/x86_64-unknown-linux-gnu/debug/build/style-c1a12de0b6472119/out/gecko_properties.rs:4516:9

Expected results:

The rust source should have compiled without errors. Rust & cargo versions:
0:04.58 checking rustc version... 1.32.0
0:04.64 checking cargo version... 1.32.0

Component: Untriaged → Build Config

Pretty sure this is Stylo and not Cranelift, since the error is in a style prefixed directory name, and the structure mention style and CSS. Have you tried again since there, and did it get fixed in the meanwhile?

Flags: needinfo?(bugzilla)
Summary: Thunderbird build on Debian stretch fails on js/src/wasm/cranelift/jsrust_shared → Thunderbird build on Debian stretch fails on stylo

I tried this morning & got the same error.

27:43.09 error[E0308]: mismatched types
27:43.09 --> servo/components/style/gecko/conversions.rs:712:64
27:43.09 712 | GenericBasicShape::Inset(InsetRect { rect, round })
27:43.09 | ^^^^^ expected struct values::generics::NonNegative, found struct values::computed::length::LengthPercentage

I tried several times last weekend to change the statement on line 705:

let round = other.mRadius;

using both the rust "cast" 'as newType' and some of the rust traits that the file's author and/or maintainer emilio had written. Other than running examples in the first few chapters of the rust tutorial, this is my first experience with rust and I wasn't able to make anything work. It looks like round wants to be a struct values::generics::NonNegative and can't convert a struct "values::computed::length::LengthPercentage" to a NonNegative. I am using:

stable-x86_64-unknown-linux-gnu unchanged rustc 1.33.0 (2aa4c46cf 2019-02-28)

on my Debian machine which is running stretch & was updated as of this morning. I'm not sure what 'Stylo' or 'Cranelift' is; the file's header says that it "maintains conversion helpers between Servo and Gecko types".

Off topic, but I'd sure like to know how to build (=compile) just this file or just the directory that this file is in. As you can see from the snippet above, it takes me ~27 minutes to see if my change will work or not. Also, I'm wondering how Mozilla and other Debian users can compile this when I can't :-).

Flags: needinfo?(bugzilla)

Emilio, any idea here?

Flags: needinfo?(emilio)

You're using an unsupported libclang version. Minimum supported version is libclang 4.0, since older versions have a gazillion bugs related to typedefs as you can see.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)

Err, meant to resolve as INVALID. Let me know if that's not the case and I'm happy to look into it further.

But this is exactly the kind of error that we were working around until bug 1394825.

Regarding building just that particular code, ./mach build toolkit/library/rust should do it I think.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
See Also: → 1394825

Benjamin, thanks for looking into this & checking w/Emilio.
I updated to LLVM & clang 4.0 and that fixed the problem.
Emilio, thanks for the solution & ./mach build command to just compile a small section of code.

You need to log in before you can comment on or make changes to this bug.