Bug 1397937 - Prune unused FFI types with Linux 32-bit issues. r=emilio
authorJ. Ryan Stinnett <jryans@gmail.com>
Thu, 07 Sep 2017 18:00:43 -0500
changeset 379742 ed8bd83b7ec66114e89dd07e6cb4003e27b7b7b1
parent 379741 39a2a87fc10013e2dbdbdd66a3c203d04df564ba
child 379743 7df0418c605dc7d749c1edc0efe3e7af998c8b46
push id32461
push userkwierso@gmail.com
push dateFri, 08 Sep 2017 20:15:32 +0000
treeherdermozilla-central@dd3736e98e4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1397937
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397937 - Prune unused FFI types with Linux 32-bit issues. r=emilio MozReview-Commit-ID: 26UmO9RcGQm
layout/style/ServoBindings.toml
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -82,16 +82,28 @@ raw-lines = [
     "pub use self::root::mozilla::dom::*;",
     "use atomic_refcell::AtomicRefCell;",
     "use data::ElementData;",
 ]
 hide-types = [
     "nsString",
     ".*char_traits",
     ".*incompatible_char_type",
+    # JS::Value uses alignas(8) which bindgen can't represent correctly on Linux
+    # 32-bit.  See https://github.com/rust-lang-nursery/rust-bindgen/issues/917.
+    # It's also not used by Stylo.  The following types are also hidden for
+    # making use of it and being similarly unused by Stylo.
+    "JS::Value",
+    "mozilla::binding_danger::TErrorResult.*",
+    "mozilla::ErrorResult.*", # Causes JSWhyMagic to be included & handled incorrectly.
+    "mozilla::dom::CallbackFunction",
+    "mozilla::dom::CallbackObject.*",
+    "nsINode_ErrorResult",
+    "nsDOMAttributeMap_ErrorResult",
+    # End of JS::Value related types
 ]
 bitfield-enums = [
     "nsChangeHint",
     "nsRestyleHint",
     "OriginFlags",
 ]
 constified-enums = [
     "UpdateAnimationsTasks",
@@ -320,19 +332,20 @@ opaque-types = [
     "nsIPresShell_ScrollAxis",  # <- For some reason the alignment of this is 4
                                 # for clang.
     "nsPIDOMWindow",  # <- Takes the vtable from a template parameter, and we can't
                       #    generate it conditionally.
     "JS::Rooted",
     "mozilla::Maybe",
     "gfxSize",  # <- union { struct { T width; T height; }; T components[2] };
     "gfxSize_Super",  # Ditto.
-    "mozilla::ErrorResult",  # Causes JSWhyMagic to be included & handled incorrectly.
     "mozilla::StyleAnimationValue",
     "StyleAnimationValue", # pulls in a whole bunch of stuff we don't need in the bindings
+    "mozilla::dom::.*Callback", # Pulls in ErrorResult and other things that
+                                # don't align properly on Linux 32-bit
 ]
 mapped-generic-types = [
     { generic = true, gecko = "mozilla::ServoUnsafeCell", servo = "::std::cell::UnsafeCell" },
     { generic = true, gecko = "mozilla::ServoCell", servo = "::std::cell::Cell" },
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoFontComputationData", servo = "::properties::FontComputationData" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },