fix(setup): locate libclang on VS Build Tools-only Windows installs#2024
Open
Ectropy wants to merge 2 commits into
Open
fix(setup): locate libclang on VS Build Tools-only Windows installs#2024Ectropy wants to merge 2 commits into
Ectropy wants to merge 2 commits into
Conversation
vswhere excludes the standalone Build Tools product unless -products * is passed, so on machines without a full Visual Studio IDE the installationPath query returns nothing and LIBCLANG_PATH is written as a dangling relative path, breaking bindgen. Query with the same -products/-requires filters that ensureMsvcVersion() already uses, so any install that passes the MSVC version gate is also found here.
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
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 change allows people to build the project even if they don't have a full install of Visual Studio, so long as they have the right Visual Studio Build Tools 2022 installed.
vswhere excludes the standalone Build Tools product unless -products * is passed, so on machines without a full Visual Studio IDE the installationPath query returns nothing and LIBCLANG_PATH is written as a dangling relative path, breaking bindgen. Query with the same -products/-requires filters that ensureMsvcVersion() already uses, so any install that passes the MSVC version gate is also found here.
Greptile Summary
This PR fixes a one-line
vswhere.exeinvocation on Windows so that theLIBCLANG_PATHlookup works on machines that only have VS Build Tools installed (no full IDE). Without-products *,vswheresilently skips standalone Build Tool installs, producing an emptyinstallationPathand a broken path written into.cargo/config.toml.-products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64flags exactly mirror those already used inensureMsvcVersion(), making the twovswherecalls consistent: any install that passes the MSVC version gate will also be found by theLIBCLANG_PATHquery.ensureMsvcVersion()runs first and throws on an empty result, the absence of an explicit empty-string guard onvcInstallDiris safe — no silent partial failure is possible.Confidence Score: 5/5
Safe to merge — one-line targeted fix to a PowerShell vswhere query with no new logic, no risk of regression on full VS IDE installs.
The change adds two well-understood vswhere flags that match the existing ensureMsvcVersion() call exactly. Full VS IDE installs are unaffected (they still satisfy the requires filter), and the fix only makes Build Tools-only machines work correctly. No error-handling paths are altered.
No files require special attention.
Important Files Changed
-products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64to the vswhere query that resolves LIBCLANG_PATH, matching the identical flags already used in ensureMsvcVersion(); correctly fixes the empty-path bug on Build Tools-only installs.Reviews (1): Last reviewed commit: "fix(setup): locate libclang on VS Build ..." | Re-trigger Greptile