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

Assume most recent stable compiler if building without build script #1593

Closed
dtolnay opened this issue Aug 1, 2019 · 2 comments
Closed

Assume most recent stable compiler if building without build script #1593

dtolnay opened this issue Aug 1, 2019 · 2 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented Aug 1, 2019

Non-Cargo build systems (Bazel, Buck, ...) usually have other ways to encode things that Cargo typically expects build.rs scripts to do, like invoking bindgen, controlling features based on target, running code generators, etc.

It would be helpful if building Serde without its build script could produce a reasonable default modern Serde, rather than a pessimistic maximally compatible Serde with everything newer than rustc 1.13.0 disabled.

Concretely this will involve negating all the rustc-cfg emitted by the current build.rs.

- if minor >= 25 {
-     println!("cargo:rustc-cfg=core_duration");
- }
+ if minor < 25 {
+     println!("cargo:rustc-cfg=no_core_duration");
+ }
@taiki-e
Copy link
Contributor

taiki-e commented Aug 21, 2022

This has been done in 55a7ced (serde), efaafd4 (serde_derive), and a5fd85a (serde_test).

I also checked the other build scripts in the repository (serde_derive_internals, test_suite) and there was no code for the rustc version in either.

@dtolnay
Copy link
Member Author

dtolnay commented Aug 21, 2022

Great! Thank you.

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

No branches or pull requests

2 participants