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

Move packages.rs to OUT_DIR #1186

Open
philpax opened this issue Nov 23, 2023 · 0 comments
Open

Move packages.rs to OUT_DIR #1186

philpax opened this issue Nov 23, 2023 · 0 comments
Labels
enhancement New feature or request topic:api API functionality, including both host and guest

Comments

@philpax
Copy link
Contributor

philpax commented Nov 23, 2023

As part of #1171, the guest package projection codegen was moved to a build script that generates src/packages.rs. This was previously implemented in the proc macro, but this led to editor responsiveness issues and the projection frequently being out of date.

However, the build script adds a file to src instead of OUT_DIR, which is the convention for generated files in Rust. This is because, during testing, rust-analyzer often failed to autocomplete items that were defined in OUT_DIR/packages.rs, especially after the creation of a new package.

I was unable to reproduce that issue in a fresh Rust project with a mock build script that did something similar in a similar setup (wasm32-wasi, multiple binaries), making it difficult to narrow down the cause of the issue.

When we have some free time, we should figure out if we can get this working to avoid cluttering users' src directories. (That being said, there's the counter-argument that seeing the projection in filesystem makes it clearer to see what's happening. Could go either way.)

@philpax philpax added enhancement New feature or request topic:api API functionality, including both host and guest labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic:api API functionality, including both host and guest
Projects
None yet
Development

No branches or pull requests

1 participant