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

stylo: Move all binding-generator logic code to a python script. #12212

Merged
merged 3 commits into from Jul 6, 2016

Conversation

@emilio
Copy link
Member

emilio commented Jul 4, 2016


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because tooling

This not only makes us more consistent with the rest of the codebase but also:

  • Makes us repeat less code like common flags and all that stuff.
  • Reduces the noise of the build: You only get the output of the commands on
    failure or when you pass the -v flag.
  • Makes you able to select a single kind of build or multiple in the same
    place.

I've basically kept the regen.sh script because of the LIBCLANG_PATH checks, but
at least from Linux I don't need them anymore. Also, that logic could be moved
to the new script.

The whole point of this isn't only making it prettier and easier to use, but
also allowing me to write more complex logic in the binding generator scripts,
that I will probably need to integrate the DOM enum types we need for animations
and such easily (can't be just an include, because that pulls in another header
with the same name bringing a lot of DOM and IDL churn).

For reference, here's a successful regen round with the script:

./regen.py --target all /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/
[BINDGEN] structs::release in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 168 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] structs::debug in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 169 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] bindings::None in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK

r? @bholley

Maybe @jgraham and/or @wafflespeanut want to take a look to criticize my (lack of) pythonism ;-)


This change is Reviewable

@highfive
Copy link

highfive commented Jul 4, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@@ -0,0 +1,366 @@
#!/usr/bin/env python

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Jul 4, 2016

Member

It seems unfortunate this file doesn't get tidy checked.

os.path.join(".", "ports", "geckolib", "gecko_bindings", "tools"),

This comment has been minimized.

Copy link
@emilio

emilio Jul 4, 2016

Author Member

Whoops... Thanks!

(BTW I meant to mention you above, not @jgraham, who uses to be busy and not too much around servo)

This comment has been minimized.

Copy link
@emilio

emilio Jul 4, 2016

Author Member

(Tidied btw)

@emilio emilio force-pushed the emilio:stylo-regen-script branch 2 times, most recently from 5ff8059 to 01a8ae0 Jul 4, 2016
return ret


def extend_object(obj, other):

This comment has been minimized.

Copy link
@bholley

bholley Jul 5, 2016

Contributor

Seems like there should be some more pythonic way to do this?

This comment has been minimized.

Copy link
@emilio

emilio Jul 5, 2016

Author Member

I don't think so, there's dict.update(other), but that overrides the keys instead of merging them, so we need to write this by hand.

@bholley
Copy link
Contributor

bholley commented Jul 5, 2016

r=me with someone looking over the pythonisms.

@emilio
Copy link
Member Author

emilio commented Jul 5, 2016

@bors-servo: r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jul 5, 2016

📌 Commit 01a8ae0 has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

Testing commit 01a8ae0 with merge ee81a5f...

bors-servo added a commit that referenced this pull request Jul 6, 2016
stylo: Move all binding-generator logic code to a python script.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because tooling

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

---

This not only makes us more consistent with the rest of the codebase but also:

 * Makes us repeat less code like common flags and all that stuff.
 * Reduces the noise of the build: You only get the output of the commands on
   failure or when you pass the -v flag.
 * Makes you able to select a single kind of build or multiple in the same
   place.

I've basically kept the regen.sh script because of the LIBCLANG_PATH checks, but
at least from Linux I don't need them anymore. Also, that logic could be moved
to the new script.

The whole point of this isn't only making it prettier and easier to use, but
also allowing me to write more complex logic in the binding generator scripts,
that I will probably need to integrate the DOM enum types we need for animations
and such easily (can't be just an include, because that pulls in another header
with the same name bringing a lot of DOM and IDL churn).

For reference, here's a successful regen round with the script:

```
./regen.py --target all /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/
[BINDGEN] structs::release in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 168 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] structs::debug in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 169 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] bindings::None in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
```

---

r? @bholley

Maybe @jgraham and/or @wafflespeanut want to take a look to criticize my (lack of) pythonism ;-)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12212)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

💔 Test failed - linux-rel

@emilio
Copy link
Member Author

emilio commented Jul 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

🔒 Merge conflict

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

The latest upstream changes (presumably #11886) made this pull request unmergeable. Please resolve the merge conflicts.

@emilio emilio force-pushed the emilio:stylo-regen-script branch from 01a8ae0 to e63a3b4 Jul 6, 2016
emilio added 3 commits Jul 4, 2016
This not only makes us more consistent with the rest of the codebase but also:

 * Makes us repeat less code like common flags and all that stuff.
 * Reduces the noise of the build: You only get the output of the commands on
   failure or when you pass the -v flag.
 * Makes you able to select a single kind of build or multiple in the same
   place.

I've basically kept the regen.sh script because of the LIBCLANG_PATH checks, but
at least from Linux I don't need them anymore. Also, that logic could be moved
to the new script.

The whole point of this isn't only making it prettier and easier to use, but
also allowing me to write more complex logic in the binding generator scripts,
that I will probably need to integrate the DOM enum types we need for animations
and such easily (can't be just an include, because that pulls in another header
with the same name bringing a lot of DOM and IDL churn).
…::PlaybackDirection
@emilio emilio force-pushed the emilio:stylo-regen-script branch from e63a3b4 to 28a5bb7 Jul 6, 2016
@emilio
Copy link
Member Author

emilio commented Jul 6, 2016

Rebased and addressed review comments of @frewsxcv and @wafflespeanut on IRC.

@bors-servo: r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

📌 Commit 28a5bb7 has been approved by bholley

bors-servo added a commit that referenced this pull request Jul 6, 2016
stylo: Move all binding-generator logic code to a python script.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because tooling

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

---

This not only makes us more consistent with the rest of the codebase but also:

 * Makes us repeat less code like common flags and all that stuff.
 * Reduces the noise of the build: You only get the output of the commands on
   failure or when you pass the -v flag.
 * Makes you able to select a single kind of build or multiple in the same
   place.

I've basically kept the regen.sh script because of the LIBCLANG_PATH checks, but
at least from Linux I don't need them anymore. Also, that logic could be moved
to the new script.

The whole point of this isn't only making it prettier and easier to use, but
also allowing me to write more complex logic in the binding generator scripts,
that I will probably need to integrate the DOM enum types we need for animations
and such easily (can't be just an include, because that pulls in another header
with the same name bringing a lot of DOM and IDL churn).

For reference, here's a successful regen round with the script:

```
./regen.py --target all /home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/
[BINDGEN] structs::release in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 168 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] structs::debug in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
[RUSTC]... OK
[RUSTC_TEST]... OK
test result: ok. 169 passed; 0 failed; 0 ignored; 0 measured
[BINDGEN] bindings::None in "/home/emilio/projects/moz/stylo/gecko/obj-x86_64-pc-linux-gnu/"... OK
```

---

r? @bholley

Maybe @jgraham and/or @wafflespeanut want to take a look to criticize my (lack of) pythonism ;-)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12212)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

Testing commit 28a5bb7 with merge e78459e...

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2016

@bors-servo bors-servo merged commit 28a5bb7 into servo:master Jul 6, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@Manishearth
Copy link
Member

Manishearth commented Jul 6, 2016

What gecko-dev commit did you build off? bholley/gecko-dev:stylo isn't working anymore, the attr functions are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.