Skip to content

Commit 36948ab

Browse files
authored
Fix semver-checks: Add back functino windows_registry::find (#1539)
* ci: re-enable semver-checls * Fix semver-checks: Add back function `windows_registry::find` which simply calls into `find_msvc_tools::find`
1 parent 0a1c2a3 commit 36948ab

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,13 @@ jobs:
402402
- uses: Swatinem/rust-cache@v2
403403
- run: cargo fmt -- --check
404404

405-
#semver-checks:
406-
# runs-on: ubuntu-latest
407-
# steps:
408-
# - name: Checkout
409-
# uses: actions/checkout@v5
410-
# - name: Check semver
411-
# uses: obi1kenobi/cargo-semver-checks-action@v2
405+
semver-checks:
406+
runs-on: ubuntu-latest
407+
steps:
408+
- name: Checkout
409+
uses: actions/checkout@v5
410+
- name: Check semver
411+
uses: obi1kenobi/cargo-semver-checks-action@v2
412412

413413
# Dummy job to have a stable name for the "all tests pass" requirement
414414
tests-pass:
@@ -422,7 +422,7 @@ jobs:
422422
- msrv
423423
- clippy
424424
- rustfmt
425-
#- semver-checks
425+
- semver-checks
426426
if: always() # always run even if dependencies fail
427427
runs-on: ubuntu-latest
428428
steps:

src/lib.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,33 @@ pub mod windows_registry {
269269
// Regardless of whether this should be in this crate's public API,
270270
// it has been since 2015, so don't break it.
271271

272-
pub use ::find_msvc_tools::find; // Fine, only uses std types
272+
/// Attempts to find a tool within an MSVC installation using the Windows
273+
/// registry as a point to search from.
274+
///
275+
/// The `arch_or_target` argument is the architecture or the Rust target name
276+
/// that the tool should work for (e.g. compile or link for). The supported
277+
/// architecture names are:
278+
/// - `"x64"` or `"x86_64"`
279+
/// - `"arm64"` or `"aarch64"`
280+
/// - `"arm64ec"`
281+
/// - `"x86"`, `"i586"` or `"i686"`
282+
/// - `"arm"` or `"thumbv7a"`
283+
///
284+
/// The `tool` argument is the tool to find. Supported tools include:
285+
/// - MSVC tools: `cl.exe`, `link.exe`, `lib.exe`, etc.
286+
/// - `MSBuild`: `msbuild.exe`
287+
/// - Visual Studio IDE: `devenv.exe`
288+
/// - Clang/LLVM tools: `clang.exe`, `clang++.exe`, `clang-*.exe`, `llvm-*.exe`, `lld.exe`, etc.
289+
///
290+
/// This function will return `None` if the tool could not be found, or it will
291+
/// return `Some(cmd)` which represents a command that's ready to execute the
292+
/// tool with the appropriate environment variables set.
293+
///
294+
/// Note that this function always returns `None` for non-MSVC targets (if a
295+
/// full target name was specified).
296+
pub fn find(arch_or_target: &str, tool: &str) -> Option<std::process::Command> {
297+
::find_msvc_tools::find(arch_or_target, tool)
298+
}
273299

274300
/// A version of Visual Studio
275301
#[derive(Debug, PartialEq, Eq, Copy, Clone)]

0 commit comments

Comments
 (0)