Skip to content

Change tests/standalone so that a tool regenerates its sources#3091

Merged
kennykerr merged 1 commit into
microsoft:masterfrom
sivadeilra:user/ardavis/standalone-tests
Jun 12, 2024
Merged

Change tests/standalone so that a tool regenerates its sources#3091
kennykerr merged 1 commit into
microsoft:masterfrom
sivadeilra:user/ardavis/standalone-tests

Conversation

@sivadeilra
Copy link
Copy Markdown
Collaborator

This fixes a problem relating to the build script of the crates/tests/standalone crate. This build script runs bindgen on a variety of inputs and generates source code.

The problem is that the build script modifies source code during a build script, and does so unconditionally. Because this process is relatively slow, these filesystem writes sometimes interfere with Git operations, because Git sees the intermediate (partially modified) state of these source files. This has been a big hassle for me in running Git operations. It also interferes with Rust Analyzer, and causes a lot of wasted resources when editing the repo with RA.

The solution is to move this codegen step to a separate tool, crates/tools/standalone. This works similarly to existing tools, like windows and sys. The only difference is that this follows the new pattern of directly linking to windows_bindgen instead of running cargo run recursively. This is a lot more efficient, especially if you run cargo run --release ....

@kennykerr kennykerr merged commit 573076a into microsoft:master Jun 12, 2024
@sivadeilra sivadeilra deleted the user/ardavis/standalone-tests branch June 12, 2024 01:26
mati865 pushed a commit to mati865/windows-rs that referenced this pull request Jun 15, 2024
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