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

Reduce the need for users to write build scripts #14948

Open
5 tasks
epage opened this issue Dec 17, 2024 · 2 comments
Open
5 tasks

Reduce the need for users to write build scripts #14948

epage opened this issue Dec 17, 2024 · 2 comments
Labels
A-build-scripts Area: build.rs scripts C-tracking-issue Category: A tracking issue for something unstable.

Comments

@epage
Copy link
Contributor

epage commented Dec 17, 2024

Like RUSTFLAGS, build scripts are an important escape hatch. Like RUSTFLAGS (#12739), we should find replacements for common uses of build scripts so people don't have to reach to this escape hatch so often

Reducing build scripts would

  • Improve build times
  • Reduce risk of bugs
  • Reduce the dependency review audit scope

Uses of build scripts

@epage epage added A-build-scripts Area: build.rs scripts C-tracking-issue Category: A tracking issue for something unstable. labels Dec 17, 2024
@ChrisDenton
Copy link
Member

ChrisDenton commented Dec 26, 2024

I would draw a distinction between main binary build scripts (e.g. the executable or cdylib) and libraries. I think a build scripts for an executable is far more tolerable than for libraries. They're in direct control of the crate author and don't have any other users. Also a single top-level build script is going to have negligible impact on build times for all but the smallest projects.

Which is not to say reducing the need for them is not important too, just that reducing the need for library build scripts will likely have the far bigger impact.

@epage
Copy link
Contributor Author

epage commented Dec 26, 2024

This is not about trying to remove all build scripts but finding patterns in the community and providing a solution to avoid writing one yourself. In some cases, this will be using an artifact dependency as your build script. This is a general solution that helps libs and bins. And the benefits extend to bins. For smaller projects it democratizes the benefits of build scripts by making it easier to discover what you can do, easier to implement, and with fewer bugs. For larger projects with multiple bins, it makes reuse easier, reduces build times, and makes it easier to audit your own code base.

Yes, libs will get more benefits as we prioritize solutions to implement but understanding and tracking the needs of bins takes little away from that but instead gives a better understanding for designing soluations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Area: build.rs scripts C-tracking-issue Category: A tracking issue for something unstable.
Projects
Status: No status
Development

No branches or pull requests

2 participants