Skip to content

Move autogen to its own crate, no longer run in build.rs #2679

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

Merged
merged 4 commits into from
Apr 19, 2025

Conversation

Rua
Copy link
Contributor

@Rua Rua commented Apr 11, 2025

Autogen no longer runs each time you build Vulkano. Instead it builds with cargo run --bin autogen. The output files are placed in autogen/output.

I've also switched to the prettyplease crate for formatting the output, which seems to give somewhat better results than rustfmt.

@marc0246
Copy link
Contributor

Could you please name the output directory out? I know this is me being extremely nit-picky but that's the convention for build artifact directories. Cargo names it this as well iirc.

@Rua
Copy link
Contributor Author

Rua commented Apr 19, 2025

Could you please name the output directory out? I know this is me being extremely nit-picky but that's the convention for build artifact directories. Cargo names it this as well iirc.

Actually, I suspect that rust-analyzer is having some trouble figuring out when code is including files from outside the crate's directory structure. Because it's failing to autocomplete any of the generated names. So I'm thinking of putting it in vulkano/autogen instead.

@marc0246
Copy link
Contributor

I suspect that rust-analyzer is having some trouble figuring out when code is including files from outside the crate's directory structure

I was just about to comment about that haha. That's the same issue I ran into in #2648 which forced me to put include inside vulkano-shaders. I'm also uncertain about how sophisticated Cargo packaging is. It rewrites some paths but I haven't tested this.

@Rua
Copy link
Contributor Author

Rua commented Apr 19, 2025

How's this?

@marc0246
Copy link
Contributor

Looks nice 👍

FTR here are my build timings before and after:
Untitled
Untitled

We shaved off 30% of our compile times 🎉 Ideally that build script wouldn't exist at all (it still needs to be compiled after all). I'm not sure it actually does anything since your windowing library should link that stuff. But that's a micro-optimization for the future.

@marc0246 marc0246 merged commit 77a3c8f into vulkano-rs:master Apr 19, 2025
8 checks passed
marc0246 added a commit that referenced this pull request Apr 21, 2025
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.

2 participants