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

markup5ever aborts in build.rs #1209

Closed
emi2k01 opened this issue Dec 2, 2021 · 2 comments · Fixed by dtolnay/proc-macro2#303
Closed

markup5ever aborts in build.rs #1209

emi2k01 opened this issue Dec 2, 2021 · 2 comments · Fixed by dtolnay/proc-macro2#303
Labels
upstream Caused by a dependency

Comments

@emi2k01
Copy link

emi2k01 commented Dec 2, 2021

Repro:

git clone https://github.com/servo/html5ever --depth 1 && \
    cd html5ever/markup5ever && \
    cargo_cf build

It seems to crash in write_to(&mut generated) (grep it) when string cache string-cache calls AtomType::to_tokens in the body of write_to.

I don't know how to get the backtrace since it just aborts.

It works correctly with normal cargo.

@bjorn3
Copy link
Member

bjorn3 commented Dec 2, 2021

Thanks for the issue. Markup5ever uses proc_macro2 in it's build script, which tries to detect if it s running inside a proc macro or not by invoking a function that panics when not run inside a proc macro. cg_clif doesn't support catching panics and thus aborts. This should have been fixed in dtolnay/proc-macro2#300, but it seems that I made a mistake with the #[cfg]. Opened dtolnay/proc-macro2#303 with a confirmed fix.

Duplicate of #1101

@bjorn3 bjorn3 added the upstream Caused by a dependency label Dec 2, 2021
@bjorn3
Copy link
Member

bjorn3 commented Dec 5, 2021

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

@bjorn3 bjorn3 closed this as completed Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Caused by a dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants