Change tests/standalone so that a tool regenerates its sources#3091
Merged
kennykerr merged 1 commit intoJun 12, 2024
Merged
Conversation
kennykerr
approved these changes
Jun 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a problem relating to the build script of the
crates/tests/standalonecrate. 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, likewindowsandsys. The only difference is that this follows the new pattern of directly linking towindows_bindgeninstead of runningcargo runrecursively. This is a lot more efficient, especially if you runcargo run --release ....