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

Restore prettyplease feature gate to bindgen library crate #2537

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Restore prettyplease feature gate to bindgen library crate #2537

merged 1 commit into from
Jun 2, 2023

Conversation

lopopolo
Copy link
Contributor

@lopopolo lopopolo commented May 25, 2023

This is a partial revert of these two PRs:

Allow formatting of generated bindings and the inclusion of the prettyplease dependency to be optional when depending on bindgen as a library.

prettyplease remains required and enabled by bindgen-cli.

In a project I maintain, bindgen is used in a build script to generate bindings for a native C library. Those bindings are written to OUT_DIR and are include!'d into the crate sources; these bindings don't need to be formatted.

See for additional context:

I tested all of the following locally:

cd bindgen
cargo check
cargo check --no-default-features
cargo check --no-default-features --features prettyplease

The CI steps added in #2506 should be sufficient for maintaining the correctness of these conditional compilation features.

cc @pvdrz

@lopopolo
Copy link
Contributor Author

I think this might be blocked on #2536

ci/test.sh Outdated Show resolved Hide resolved
@lopopolo lopopolo requested a review from pvdrz June 1, 2023 19:43
@lopopolo
Copy link
Contributor Author

lopopolo commented Jun 1, 2023

@pvdrz this is ready for review and CI is green

This is a partial revert of these two PRs:

- #2491
- #2505

Allow formatting of generated bindings and the inclusion of the
`prettyplease` dependency to be optional when depending on bindgen as a
library.

`prettyplease` remains required and enabled by bindgen-cli.

In a project I maintain, `bindgen` is used in a build script to generate
bindings for a native C library. Those bindings are written to `OUT_DIR`
and are `include!`'d into the crate sources; these bindings don't need
to be formatted.

See for additional context:

- #2491 (comment)
- #2491 (comment)
- #2491 (comment)

I tested all of the following locally:

```shell
cd bindgen
cargo check
cargo check --no-default-features
cargo check --no-default-features --features prettyplease
```

The CI steps added in #2506 should be sufficient
for maintaining the correctness of these conditional compilation features.
@pvdrz pvdrz merged commit 26d672e into rust-lang:main Jun 2, 2023
27 checks passed
@pvdrz
Copy link
Contributor

pvdrz commented Jun 2, 2023

thanks!

@lopopolo lopopolo deleted the lopopolo/prettyplease-optional branch June 2, 2023 20:25
@emilio
Copy link
Contributor

emilio commented Jun 7, 2023

Curious @pvdrz, when is a release scheduled / can one be made? I got asked about this because we want to update to syn 2, but we'd rather avoid pulling in prettyplease.

No rush tho. Thanks!

@pvdrz
Copy link
Contributor

pvdrz commented Jun 7, 2023

Someone told me that we do releases when people ask for them :trollface:

I think we have enough features for a new release too so I guess later this week or maybe starting next week.

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.

None yet

4 participants