Skip to content

Conversation

@mhoff12358
Copy link
Contributor

The variable is RUST_GDEXT_USED_CLASS_NAMES and it is a comma separated list.
It isn't correctly picked up by cargo to cause a rebuild.

The variable is RUST_GDEXT_USED_CLASS_NAMES and it is a comma separated
list.
It isn't correctly picked up by cargo to cause a rebuild.
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-459

@Bromeon
Copy link
Member

Bromeon commented Oct 21, 2023

What is the use case here?

The whole "limit classes to a certain number" is currently an implementation detail; the feature is not listed in the docs. It's mostly done to speed up compile time in CI, not intended as a user-facing configuration.

@mhoff12358
Copy link
Contributor Author

The reason to do this would be to reduce binary size (and compile times incidentally).

In any case, I mostly wanted to throw this together to see if it worked to see if it could be recommended for helping resolve some issues with WASM builds.

@mhoff12358
Copy link
Contributor Author

The goal here was to share the idea with people in the WASM thread, should I keep the draft PR to my repo to avoid cluttering the main repo's PR list?

@Bromeon
Copy link
Member

Bromeon commented Oct 22, 2023

In general, PRs are intended for code that is eventually merged 🙂 so yeah, you could use your own fork in the future, but feel free to continue this one for this topic.

I'll open a PR about the lazy loading soon, let's see if that helps already. I would expect that once that is in place, the linker will be smart enough to erase unused Rust code (i.e. classes and methods) from the final binary. So I don't think a custom class filter would be necessary.

@Bromeon
Copy link
Member

Bromeon commented Nov 19, 2023

Closing as I don't think this is something we should support, see above. Instead, we should focus our efforts on improving compile times (and global function tables have already helped a lot in that regard). Thanks nevertheless! 🙂

@Bromeon Bromeon closed this Nov 19, 2023
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.

3 participants