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

Fails to compile cssparser 0.25.9 #1101

Closed
jyn514 opened this issue Nov 1, 2020 · 5 comments · Fixed by dtolnay/proc-macro2#303
Closed

Fails to compile cssparser 0.25.9 #1101

jyn514 opened this issue Nov 1, 2020 · 5 comments · Fixed by dtolnay/proc-macro2#303

Comments

@jyn514
Copy link
Member

jyn514 commented Nov 1, 2020

This is cg_clif built from rust-lang/rust#78624 using codegen-backends = ["cranelift"], so I think 8063c37.

$ git clone https://github.com/servo/rust-cssparser && cd rust-cssparser
$ git checkout v0.25.9
$ cargo +stage1 build
   Compiling cssparser v0.25.9 (/home/joshua/rust-cssparser)
   Compiling cssparser-macros v0.3.6 (/home/joshua/rust-cssparser/macros)
warning: Argument of type `proc_macro::bridge::buffer::Slice<u8>` with pass mode `ByValPair(types::I64, types::I64)` is not yet supported for non-rust abi `"C"`. Calling this function may result in a crash.
   --> /home/joshua/rustc/library/proc_macro/src/bridge/buffer.rs:134:9
    |
134 |         extern "C" fn extend_from_slice<T: Copy>(b: Buffer<T>, xs: Slice<'_, T>) -> Buffer<T> {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted

error: failed to run custom build command for `cssparser v0.25.9`

Caused by:
  process didn't exit successfully: `/home/joshua/.local/lib/cargo/target/debug/build/cssparser-a9d0987f2ba68887/build-script-build` (signal: 6, SIGABRT: process abort signal)
  --- stdout
  cargo:rustc-cfg=rustc_has_pr45225
  cargo:rustc-cfg=has_std__mem__MaybeUninit
  cargo:rerun-if-changed=/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cssparser-0.25.9/src/tokenizer.rs

  --- stderr
  fatal runtime error: failed to initiate panic, error 5
@bjorn3
Copy link
Member

bjorn3 commented Nov 1, 2020

[...]
#8  0x0000555555966d9f in std::panicking::begin_panic (arg0=0x2, arg1=0x7ffff7d84510, arg2=0x0) at /home/bjorn/Documenten/cg_clif3/build_sysroot/sysroot_src/library/std/src/panicking.rs:521
#9  0x000055555599a5cb in proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}} (sret0=0x2, arg1=0x7ffff7d84510)
    at sysroot_src/library/proc_macro/src/bridge/client.rs:331
[...]
#28 0x0000555555919956 in proc_macro2::detection::inside_proc_macro () at /home/bjorn/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.13/src/detection.rs:15

It uses an outdated version of proc_macro2 that tries to detect if it is a proc macro by catching a panic. cg_clif doesn't support unwinding on panics.

@bjorn3
Copy link
Member

bjorn3 commented Nov 1, 2020

Same issue as #1085.

@jyn514
Copy link
Member Author

jyn514 commented Nov 1, 2020

Ok, building docs.rs is blocked on cloudflare/lol-html#72 then.

@bjorn3
Copy link
Member

bjorn3 commented Dec 5, 2021

This should be fixed now as of proc-macro 1.0.33.

@jyn514
Copy link
Member Author

jyn514 commented Dec 30, 2021

I just checked, docs.rs builds fine after updating the version of proc-macro in the lockfile :) thanks!

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