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

Read ServoArcTypeList.h for list of arc types #15669

Merged
merged 1 commit into from
Feb 22, 2017

Conversation

upsuper
Copy link
Contributor

@upsuper upsuper commented Feb 21, 2017

r? @heycam


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @bholley: components/style/build_gecko.rs
  • @emilio: components/style/build_gecko.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 21, 2017
@highfive
Copy link

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@upsuper
Copy link
Contributor Author

upsuper commented Feb 22, 2017

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 ServoArcTypeList.h doesn't include any line comment, so I cannot test (and I don't want to rebuild everything just for testing it...)

@heycam
Copy link
Contributor

heycam commented Feb 22, 2017

@bors-servo delegate+

@bors-servo
Copy link
Contributor

✌️ @upsuper can now approve this pull request

@upsuper
Copy link
Contributor Author

upsuper commented Feb 22, 2017

@bors-servo r=heycam

@bors-servo
Copy link
Contributor

📌 Commit c2de28d has been approved by heycam

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Feb 22, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit c2de28d with merge 07debf5...

bors-servo pushed a commit that referenced this pull request Feb 22, 2017
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 -->
@bors-servo
Copy link
Contributor

☀️ 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
Approved by: heycam
Pushing 07debf5 to master...

@bors-servo bors-servo merged commit c2de28d into servo:master Feb 22, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 22, 2017
@upsuper upsuper deleted the bindgen-arc-type branch February 22, 2017 03:59
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 this pull request may close these issues.

4 participants