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

Run bindgen in build.rs #134

Merged
merged 1 commit into from May 22, 2018
Merged

Run bindgen in build.rs #134

merged 1 commit into from May 22, 2018

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented May 9, 2018

This PR uses the bindgen crate to generate the Rust bindings for the mozjs_sys crate.

In its current form, this means requiring llvm to be installed to build mozjs_sys. We could check those bindings in if we want to avoid that requirement, but this has its own problems.


This change is Reviewable

@asajeffrey
Copy link
Member Author

asajeffrey commented May 9, 2018

r? @jdm

build.rs Outdated
builder = builder
.clang_arg("-DJS_GC_ZEAL")
.clang_arg("-DDEBUG")
.clang_arg("-DJS_DEBUG");

This comment has been minimized.

@jdm

jdm May 10, 2018

Member

These defines are missing from the jsglue compilation if debugmozjs is enabled. We should probably make some kind of common setup to avoid flags going out of sync.

This comment has been minimized.

@asajeffrey

asajeffrey May 10, 2018

Author Member

Oh, good point.

This comment has been minimized.

@asajeffrey

asajeffrey May 10, 2018

Author Member

Rather annoyingly, the flags are set in both makefile.cargo and build.rs, so we're stuck with some duplication. The thing to do eventually is move everything out of makefile.cargo, but I don't think that should be part of this PR.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 10, 2018

Oh, and credit where credit's due, quite a bit of the build is from @fitzgen thanks!

@jdm
Copy link
Member

jdm commented May 10, 2018

I'm enjoying these commit messages.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 10, 2018

You can spot my level of annoyance with travis and appveyor increasing as the day goes on :)

@nox
Copy link
Member

nox commented May 11, 2018

FWIW, I still don't think we should run bindgen in build.rs and force everyone to have a clang setup etc. There are no particular problems with checking in the bindings, apart from generating them in the first place.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 11, 2018

@nox yes, there's an annoying trade-off of checking generated artefacts in vs building them. If this were the only use of libclang, I'd say we should just swallow the pain and check them in, but it looks like osmesaup may require llvm too.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 11, 2018

Look at all that green!

@asajeffrey
Copy link
Member Author

asajeffrey commented May 12, 2018

Back to red again ☹️ due to link errors.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 18, 2018

Green! Lovely green!

@jdm
jdm approved these changes May 22, 2018
@asajeffrey asajeffrey force-pushed the asajeffrey:bindgenup branch from cf4502f to d40cfd5 May 22, 2018
@asajeffrey
Copy link
Member Author

asajeffrey commented May 22, 2018

Squashed.

@asajeffrey
Copy link
Member Author

asajeffrey commented May 22, 2018

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented May 22, 2018

📌 Commit d40cfd5 has been approved by jdm

bors-servo added a commit that referenced this pull request May 22, 2018
Run bindgen in build.rs

This PR uses the bindgen crate to generate the Rust bindings for the `mozjs_sys` crate.

In its current form, this means requiring llvm to be installed to build `mozjs_sys`. We could check those bindings in if we want to avoid that requirement, but this has its own problems.

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

bors-servo commented May 22, 2018

Testing commit d40cfd5 with merge d7f2a34...

@asajeffrey asajeffrey mentioned this pull request May 22, 2018
@bors-servo
Copy link
Contributor

bors-servo commented May 22, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: jdm
Pushing d7f2a34 to master...

@bors-servo bors-servo merged commit d40cfd5 into servo:master May 22, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
bors-servo added a commit that referenced this pull request May 22, 2018
Version bump

This is the version bump for bindgenup, PR #134 which can land once it does.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/135)
<!-- Reviewable:end -->
bors-servo added a commit to servo/rust-mozjs that referenced this pull request May 23, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

This is the matching PR to servo/mozjs#134 which runs bindgen on spidermonkey to produce Rust bindings.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/425)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 23, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 24, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 24, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 25, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 25, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 29, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 29, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 29, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 30, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 30, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request May 30, 2018
Get the mozjs crate to work with the mozjs_sys which uses bindgen

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

This is the matching PR to servo/mozjs#134 and servo/rust-mozjs#425 which runs bindgen on spidermonkey to produce Rust bindings.

---
<!-- 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
- [X] These changes do not require tests because current tests should catch failures

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

<!-- 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/20793)
<!-- Reviewable:end -->
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

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