-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Read ServoArcTypeList.h for list of arc types #15669
Conversation
components/style/build_gecko.rs
Outdated
fn get_arc_types() -> Vec<String> { | ||
let list_file = File::open(DISTDIR_PATH.join("include/mozilla/ServoArcTypeList.h")) | ||
.expect("Unable to open ServoArcTypeList.h"); | ||
let re = Regex::new(r#"^SERVO_ARC_TYPE\(\w+,\s*(\w+)\)"#).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're not processing this using the C preprocessor, then please add some comments to ServoArcTypeList.h saying that the format of that file must be kept very strict, and that e.g. comments and #ifdefs will not be processed when the file is read for bindgen's purpose.
In fact, I wonder if you can cause the build to break in here if the file contents are unexpected. Maybe you could allow only //
comments, blank lines, and SERVO_ARC_TYPE(..., ...)
lines, and panic if we get some other line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably a good idea.
aa899bb
to
3467d7c
Compare
3467d7c
to
c2de28d
Compare
Updated the patch to simply remove the comment before handling, so that we don't need a coordinated push with Gecko. It doesn't strip line comment at the moment, though, because the current |
@bors-servo delegate+ |
✌️ @upsuper can now approve this pull request |
@bors-servo r=heycam |
📌 Commit c2de28d has been approved by |
Read ServoArcTypeList.h for list of arc types r? @heycam <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15669) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev |
r? @heycam
This change is