# 使用 Homebrew, Nix 安装 xwin

查看 xwin 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:xwin
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install xwin
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#xwin
```

  证据: nixpkgs package indexes: pkgs/by-name/xw/xwin/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:xwin
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/xwin>
- **版本:** 0.9.0
- **来源摘要:** Microsoft CRT and Windows SDK headers and libraries loader
- **主页:** <https://github.com/Jake-Shadle/xwin>
- **仓库:** <https://github.com/Jake-Shadle/xwin>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/Jake-Shadle/xwin/archive/refs/tags/0.9.0.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- xwin (cli)
- xwin (别名)

## 构建依赖

- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.9.0
- 本地数据: OK
- 上游仓库: https://github.com/Jake-Shadle/xwin
- 检测到的最新版本: 0.9.0 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

xwin is a Rust utility for downloading, unpacking, pruning, and laying out Microsoft CRT and Windows SDK headers and libraries so Windows MSVC-targeted builds can run from non-Windows hosts with LLVM/clang tooling.

### 项目历史

Jake Shadle created the GitHub repository in August 2021 alongside a detailed post on cross-compiling Windows binaries from Linux. The blog explains the practical CI problem: producing `x86_64-pc-windows-msvc` outputs without running the whole Windows toolchain on Windows, while still using clang-cl and lld-link against Microsoft CRT and SDK files.

The README defines xwin's core job as creating CRT and SDK root directories with the includes and libraries needed by native cross-compiling toolchains, including symlinks to repair Windows SDK casing problems on case-sensitive filesystems. The CLI grew commands such as `download`, `unpack`, `splat`, and `minimize`.

Recent releases track changes in Microsoft's installer and manifest ecosystem: channel-name changes, MSI packages without cabinet references, TLS/certificate handling, HTTP retry behavior, and debug-runtime inclusion.

### 采用历史

xwin sits in the Rust cross-compilation niche: developers targeting `*-pc-windows-msvc` from Linux or macOS need Windows headers and libraries but often prefer cargo, clang-cl, lld-link, containers, and Linux CI. Packaging xwin in Homebrew, Nix, crates.io, and GitHub releases makes that workflow scriptable.

### 使用方式

The common flow is `xwin --accept-license splat --output /path/to/sysroot`, then pointing clang-cl, lld-link, Cargo, or build scripts at the produced CRT and SDK include/library directories. `download` and `unpack` expose intermediate steps, while `minimize` can trace a Cargo build and produce a reduced map of files actually used.

### 为什么软件包爱好者会关心

xwin is significant because it turns proprietary-platform SDK acquisition into a reproducible package-style operation without redistributing Microsoft's files. It collapses a painful cross-compilation prerequisite into one auditable CLI.

It also captures a modern packaging pattern: acquiring upstream binary installer payloads, normalizing layout, fixing filesystem case mismatches, caching aggressively, and producing a sysroot other tools can consume.

### 时间线

- 2021-08-04: GitHub repository created.
- 2021-08-22: Shadle publishes the cross-compiling Windows binaries from Linux walkthrough describing the new utility and its CI motivation.
- 2021: README-era workflow centers on downloading CRT/SDK payloads and `splat` output for clang/LLVM Windows cross builds.
- 2024-2025: Releases focus on Microsoft installer churn, HTTP/TLS behavior, debug-runtime support, and SDK package layout changes.
- 2026-04-20: 0.9.0 release fixes channel-name handling for newer Microsoft manifest versions.

### Related projects

- clang-cl, lld-link, and LLVM: the non-Windows toolchain xwin is designed to feed.
- Rust target `x86_64-pc-windows-msvc`: a primary driver for xwin's documented workflow.
- cargo and cc-rs: common Rust build tooling that consumes compiler/linker configuration pointing at xwin output.
- winsysroot: a layout style xwin can generate for clang-cl-oriented SDK discovery.

### 来源

- <https://api.github.com/repos/Jake-Shadle/xwin>
- <https://api.github.com/repos/Jake-Shadle/xwin/releases?per_page=8>
- <https://crates.io/crates/xwin>
- <https://github.com/Jake-Shadle/xwin>
- <https://jake-shadle.github.io/xwin/>
- <https://raw.githubusercontent.com/Jake-Shadle/xwin/main/README.md>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** xwin
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - xwin: normalized package name match | nixpkgs package indexes: pkgs/by-name/xw/xwin/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-zigbuild](https://pkg.so/zh-hans/brew/cargo-zigbuild/) - Shares pkgdb curated category or tags: cli, cross-compilation, developer-tools, rust.
- [uv](https://pkg.so/zh-hans/brew/uv/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [ripgrep](https://pkg.so/zh-hans/brew/ripgrep/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [starship](https://pkg.so/zh-hans/brew/starship/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [zoxide](https://pkg.so/zh-hans/brew/zoxide/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [ruff](https://pkg.so/zh-hans/brew/ruff/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [uutils-findutils](https://pkg.so/zh-hans/brew/uutils-findutils/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [fnm](https://pkg.so/zh-hans/brew/fnm/) - Shares pkgdb curated category or tags: cli, developer-tools, rust.
- [xwin](https://pkg.so/zh-hans/cargo/xwin/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/xwin.yml](https://github.com/mxcl/pkgdb/blob/main/combined/xwin.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
