Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cbindgen-0.14.0 "crashes" while building firefox #506

Closed
Ponce opened this issue Apr 8, 2020 · 2 comments · Fixed by #508
Closed

cbindgen-0.14.0 "crashes" while building firefox #506

Ponce opened this issue Apr 8, 2020 · 2 comments · Fixed by #508

Comments

@Ponce
Copy link

Ponce commented Apr 8, 2020

slackware64-current, gcc-9.3.0, rust-1.42.0, firefox-76.0b2 (or 75.0)

as the shell script used on Slackware to build firefox downloads and install the latest cbindgen silently in ~/.cargo/bin/ since a few days builds of the latest firefox were failing.
examining the output I noticed it was because of cbingen, so I tried building firefox with fixed cbindgen versions: with 0.14.0 it fails with this error (I set in the environment RUST_BACKTRACE=full, as hinted)

 1:32.94 xpcom/ds/nsGkAtomList.h.stub
 1:33.07 b''
 1:33.10 b"WARN: Skip wgpu-core::MAX - (not `pub`).\nWARN: Skip wgpu-core::EMPTY - (not `pub`).\nWARN: Skip wgpu-core::BITS_PER_BYTE - (not `pub`).\nWARN: Skip wgpu-core::BIND_BUFFER_ALIGNMENT - (Unhandled const definition)\nWARN: Skip wgpu-core::CLEANUP_WAIT_MS - (not `pub`).\nWARN: Skip wgpu-core::VARIANT - (not `pub`).\nWARN: Skip wgpu-core::VARIANT - (not `pub`).\nWARN: Skip wgpu-core::VARIANT - (not `pub`).\nWARN: Skip wgpu-core::VARIANT - (not `pub`).\nWARN: Skip wgpu-core::BACKEND_BITS - (not `pub`).\nWARN: Skip wgpu-core::EPOCH_MASK - (not `pub`).\nWARN: Skip wgpu-core::ERROR - (Unhandled const definition)\nWARN: Skip wgpu-core::FRAME_TIMEOUT_MS - (not `pub`).\nWARN: Skip wgpu-core::DUMMY_SELECTOR - (Cannot have a zero sized const definition.)\nWARN: Skip wgpu-types::VULKAN - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(Vulkan), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::GL - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(Gl), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::METAL - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(Metal), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::DX12 - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(Dx12), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::DX11 - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(Dx11), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::BROWSER_WEBGPU - (Unsupported expression. Cast(ExprCast { attrs: [], expr: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Backend), arguments: None }, Colon2, PathSegment { ident: Ident(BrowserWebGpu), arguments: None }] } }), as_token: As, ty: Path(TypePath { qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(u32), arguments: None }] } }) }))\nWARN: Skip wgpu-types::PRIMARY - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(VULKAN), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::SECONDARY - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(GL), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::READ_ALL - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(MAP_READ), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::WRITE_ALL - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(MAP_WRITE), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::ORDERED - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(READ_ALL), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::READ_ALL - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(COPY_SRC), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::WRITE_ALL - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(COPY_DST), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::ORDERED - (Unsupported expression. Field(ExprField { attrs: [], base: Path(ExprPath { attrs: [], qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(Self), arguments: None }, Colon2, PathSegment { ident: Ident(READ_ALL), arguments: None }] } }), dot_token: Dot, member: Named(Ident(bits)) }))\nWARN: Skip wgpu-types::REPLACE - (Unsupported path expression. [PathSegment { ident: Ident(BlendFactor), arguments: None }, Colon2, PathSegment { ident: Ident(One), arguments: None }])\nWARN: Skip wgpu-types::IGNORE - (Unsupported path expression. [PathSegment { ident: Ident(CompareFunction), arguments: None }, Colon2, PathSegment { ident: Ident(Always), arguments: None }])\nthread 'main' panicked at 'Unable to mangle generic parameter Ptr(Primitive(UInt8)) for 'Result'', src/bindgen/mangle.rs:52:17\nstack backtrace:\n   0:     0x563827cc8c93 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1dbfc7419c3ffbf\n   1:     0x563827ce9f6d - core::fmt::write::h7be4cf574d82590c\n   2:     0x563827cc8625 - std::io::Write::write_fmt::h4153108fd7e5952c\n   3:     0x563827cbc160 - std::panicking::default_hook::{{closure}}::h605411d7e5327846\n   4:     0x563827cbbe78 - std::panicking::default_hook::hafddd3c4bf5674d5\n   5:     0x563827cbc87c - std::panicking::rust_panic_with_hook::hcd919988461ee8aa\n   6:     0x563827cbc390 - rust_begin_unwind\n   7:     0x563827cbc30b - std::panicking::begin_panic_fmt::hf346097d32db72ce\n   8:     0x563827ac4dac - cbindgen::bindgen::mangle::internal_mangle_name::hb6899f364edc591d\n   9:     0x563827b11484 - <cbindgen::bindgen::ir::opaque::OpaqueItem as cbindgen::bindgen::ir::item::Item>::instantiate_monomorph::h6f28d167dd0d4209\n  10:     0x563827ac3fb4 - cbindgen::bindgen::ir::ty::Type::add_monomorphs::h476674f0df57c4fd\n  11:     0x563827b2bfae - cbindgen::bindgen::library::Library::generate::h4bb717dec9c0795e\n  12:     0x563827a4b63b - cbindgen::bindgen::builder::Builder::generate::h33bcee20302b3894\n  13:     0x563827a54b78 - cbindgen::main::hec7f96b44236a916\n  14:     0x563827a46353 - std::rt::lang_start::{{closure}}::hb549067eeb018666\n  15:     0x563827cbc283 - std::panicking::try::do_call::h1693beeec7d06c75\n  16:     0x563827ccee67 - __rust_maybe_catch_panic\n  17:     0x563827cbf857 - std::rt::lang_start_internal::hfbcfc7b0accd3206\n  18:     0x563827a55802 - main\n  19:     0x7fc504386e5b - __libc_start_main\n  20:     0x56382795a1ca - _start\n  21:                0x0 - <unknown>\n"
 1:33.10 xpcom/base/ErrorNamesInternal.h.stub
 1:33.10 gmake[4]: *** [backend.mk:12: .deps/wgpu_ffi_generated.h.stub] Error 101
 1:33.10 gmake[3]: *** [/tmp/firefox-76.0/config/recurse.mk:101: dom/webgpu/ffi/export] Error 2
 1:33.10 gmake[3]: *** Waiting for unfinished jobs....
 1:33.13 intl/locale/unic_langid_ffi_generated.h.stub
 1:33.21 /tmp/firefox-76.0/xpcom/ds/StaticAtoms.py:2578: SyntaxWarning: "is" with a literal. Did you mean "=="?
 1:33.21   if atom.atom_type is "PseudoElementAtom":
 1:33.21 /tmp/firefox-76.0/xpcom/ds/StaticAtoms.py:2582: SyntaxWarning: "is" with a literal. Did you mean "=="?
 1:33.21   elif atom.atom_type is "NonInheritingAnonBoxAtom" or atom.atom_type is "InheritingAnonBoxAtom":
 1:33.21 /tmp/firefox-76.0/xpcom/ds/StaticAtoms.py:2582: SyntaxWarning: "is" with a literal. Did you mean "=="?
 1:33.21   elif atom.atom_type is "NonInheritingAnonBoxAtom" or atom.atom_type is "InheritingAnonBoxAtom":
 1:33.22 xpcom/ds/nsGkAtomConsts.h.stub
 1:33.23 dom/media/audioipc_server_ffi_generated.h.stub
 1:33.29 xpcom/base/error_list.rs.stub
 1:33.49 xpcom/base/gk_rust_utils_ffi_generated.h.stub
 2:22.09 gmake[2]: *** [/tmp/firefox-76.0/config/recurse.mk:34: export] Error 2
 2:22.09 gmake[1]: *** [/tmp/firefox-76.0/config/rules.mk:394: default] Error 2
 2:22.09 gmake: *** [client.mk:125: build] Error 2
 2:22.12 0 compiler warnings present.

while with 0.13.2 everything goes fine.

let me know if I can test something else.

@Ponce
Copy link
Author

Ponce commented Apr 8, 2020

I tried a manual bisect and it seems to go fine reverting this commit

ec1631f

emilio added a commit to emilio/cbindgen that referenced this issue Apr 10, 2020
Ugly, but better than crashing.

Closes mozilla#506.
Closes mozilla#453.
emilio added a commit to emilio/cbindgen that referenced this issue Apr 10, 2020
Ugly, but better than crashing.

Closes mozilla#506.
Closes mozilla#453.
@emilio
Copy link
Collaborator

emilio commented Apr 10, 2020

Yeah. The workaround they were using for that stopped working. Anyhow #508 should fix the root cause.

emilio added a commit that referenced this issue Apr 10, 2020
Ugly, but better than crashing.

Closes #506.
Closes #453.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants