Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
64636a0
Regenerate doc tests and prune stale generated files
ciaranra May 13, 2026
0f58884
Auto-include CUDA Python packages when toolkit and NVIDIA GPU detected
ciaranra May 13, 2026
9740a15
Merge remote-tracking branch 'origin/dev' into cleanup
ciaranra May 14, 2026
6a55986
Surface CUDA Python packages in pecos setup summary
ciaranra May 14, 2026
1f525cc
Stop pytest from shelling out to cargo, fix shadowed slr_tests module…
ciaranra May 14, 2026
7cbcb5c
Sanitize generated doc test paths and fix cmake-setup example
ciaranra May 14, 2026
8796251
Introduce VariableState; fix SLR linearity bugs at use-after-unpack s…
ciaranra May 14, 2026
40b668d
Plumb profile through build-selene, python build, and rust test
ciaranra May 15, 2026
8c4f974
Fix pyo3 cargo test linking and void-main entry-point dispatch
ciaranra May 15, 2026
7e98e38
Keep Go cgo -L for direct go test and include extension-module in --f…
ciaranra May 15, 2026
b9281eb
Guard empty arrays for bash 3.2 in clean/build-selene, exclude all py…
ciaranra May 15, 2026
e4c0d59
Restore check/clippy coverage for pyo3 cdylibs by splitting test-only…
ciaranra May 15, 2026
a879159
Move pecos-rslib-cuda to FFI_CRATES so default check doesnt trigger e…
ciaranra May 15, 2026
1af738f
Update --include-ffi help text to list pecos-rslib-cuda and flag its …
ciaranra May 15, 2026
f347e1f
Merge origin/cleanup, resolving python_cmd.rs Build arm by combining …
ciaranra May 15, 2026
6df6aac
Apply just lint auto-fixes (clippy doc_markdown backticks; black dict…
ciaranra May 15, 2026
4c57d2f
Pin black target-version to py310 to match requires-python floor
ciaranra May 15, 2026
b0cceee
Pick newest installed MSVC toolset on Windows CI to match VsDevCmd LI…
ciaranra May 15, 2026
9f07d67
Exclude LIB/INCLUDE/LIBPATH from MSYS2 path conversion so the MSVC en…
ciaranra May 16, 2026
3bebcb0
Bake MSVC LIB/INCLUDE into cargo [env] with force=true so rustc/link.…
ciaranra May 16, 2026
f1a825b
Add through-just MSVC LIB diagnostic to localize where the env is los…
ciaranra May 16, 2026
9face90
Experiment: drop MSVC linker pin + config.toml LIB/INCLUDE on python-…
ciaranra May 16, 2026
9da21df
Revert "Experiment: drop MSVC linker pin + config.toml LIB/INCLUDE on…
ciaranra May 16, 2026
d2ef0aa
Run Windows cargo/just CI steps under shell:pwsh so GitHub Actions do…
ciaranra May 16, 2026
2eed3dc
Revert "Run Windows cargo/just CI steps under shell:pwsh so GitHub Ac…
ciaranra May 16, 2026
72b5eb5
Experiment: prepend MSVC host-bin to PATH in just recipes (no linker …
ciaranra May 16, 2026
779eb9a
Add MSVC host-bin PATH prepend to setup-quiet and sync-deps too (matu…
ciaranra May 16, 2026
01b1a38
Re-add cargo [env] LIB/INCLUDE (no linker= -- PATH-prepend handles th…
ciaranra May 16, 2026
f77fd30
Replace Windows MSVC PATH-prepend with a scoped-merge bootstrap scrip…
ciaranra May 16, 2026
074865d
Apply rustfmt to cargo_config.rs
ciaranra May 16, 2026
7302c56
Use the MSVC bootstrap (not setup-msvc.ps1 pin) in the rust/julia/go …
ciaranra May 16, 2026
339cb7d
Address review: bootstrap prereq on all dev/setup cargo recipes, fail…
ciaranra May 17, 2026
4baf781
Derive the release linker env pin from VCToolsInstallDir (so it can't…
ciaranra May 17, 2026
1caa3de
Add a fast-path to the MSVC bootstrap: skip vswhere/VsDevCmd when the…
ciaranra May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ jobs:
prefix-key: v1-rust-no-bin
workspaces: go/pecos-go-ffi

- name: Set up Visual Studio environment on Windows
- name: Bootstrap MSVC for the Cargo build path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/ci/setup-msvc.ps1 -Arch x64 -HostArch x64
# Single mechanism: writes linker + LIB/INCLUDE into .cargo/config.toml,
# which the `cargo build` below (run from go/pecos-go-ffi) picks up via
# the parent-dir config search -- same as a local Windows build.
run: ./scripts/win-msvc-bootstrap.ps1

- name: Build Rust FFI library (Windows)
if: runner.os == 'Windows'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/julia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ jobs:
prefix-key: v1-rust-no-bin
workspaces: julia/pecos-julia-ffi

- name: Set up Visual Studio environment on Windows
- name: Bootstrap MSVC for the Cargo build path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/ci/setup-msvc.ps1 -Arch x64 -HostArch x64
# Single mechanism: writes linker + LIB/INCLUDE into .cargo/config.toml,
# which the `cargo build` below (run from julia/pecos-julia-ffi) picks up
# via the parent-dir config search -- same as a local Windows build.
run: ./scripts/win-msvc-bootstrap.ps1

- name: Build Rust FFI library (Windows)
if: runner.os == 'Windows'
Expand Down
71 changes: 36 additions & 35 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,46 +136,47 @@ jobs:
method: 'local'
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust"]'

# On Windows, Git Bash's /usr/bin/link.exe shadows MSVC's link.exe.
# Create .cargo/config.toml with the explicit MSVC linker path so cargo
# uses the correct linker inside cibuildwheel (which runs on the host).
# On Windows, Git Bash's /usr/bin/link.exe shadows MSVC's link.exe, so
# pin the linker in .cargo/config.toml for the cargo commands cibuildwheel
# runs on the host. Derive it from VCToolsInstallDir -- the toolset the
# prior setup-msvc.ps1 step's VsDevCmd actually configured -- so the
# linker always matches the LIB/INCLUDE in effect (no lexical toolset
# guessing, which could select a mismatched toolset and cause LNK1181).
- name: Configure MSVC linker for Cargo (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vsWhere -latest -property installationPath
$linkPath = Get-ChildItem -Path "$vsPath\VC\Tools\MSVC" -Recurse -Filter "link.exe" |
Where-Object { $_.FullName -like "*\bin\Hostx64\x64\*" } |
Select-Object -First 1 -ExpandProperty FullName

if ($linkPath) {
$escapedPath = $linkPath.Replace('\', '/')
$configContent = "[target.x86_64-pc-windows-msvc]`nlinker = `"$escapedPath`""

# Create in repo root (for CIBW_BEFORE_ALL cargo commands)
New-Item -ItemType Directory -Force -Path .cargo | Out-Null
$configContent | Out-File -FilePath ".cargo\config.toml" -Encoding UTF8

# Create in pecos-rslib directory (for maturin builds)
New-Item -ItemType Directory -Force -Path "python\pecos-rslib\.cargo" | Out-Null
$configContent | Out-File -FilePath "python\pecos-rslib\.cargo\config.toml" -Encoding UTF8

# Create in user cargo home (fallback)
$cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { "$env:USERPROFILE\.cargo" }
New-Item -ItemType Directory -Force -Path $cargoHome | Out-Null
if (Test-Path "$cargoHome\config.toml") {
"`n$configContent" | Out-File -FilePath "$cargoHome\config.toml" -Encoding UTF8 -Append
} else {
$configContent | Out-File -FilePath "$cargoHome\config.toml" -Encoding UTF8
}
$vcTools = $env:VCToolsInstallDir
if (-not $vcTools) {
Write-Error "VCToolsInstallDir not set; the setup-msvc.ps1 step must run first"
exit 1
}
$linkPath = Join-Path ($vcTools.TrimEnd('\', '/')) "bin\Hostx64\x64\link.exe"
if (-not (Test-Path $linkPath)) {
Write-Error "MSVC link.exe not found at $linkPath"
exit 1
}
$escapedPath = $linkPath.Replace('\', '/')
$configContent = "[target.x86_64-pc-windows-msvc]`nlinker = `"$escapedPath`""

Write-Host "Configured MSVC linker: $linkPath"
# cibuildwheel and maturin run in different working directories;
# write the config where each one looks for it.
New-Item -ItemType Directory -Force -Path .cargo | Out-Null
$configContent | Out-File -FilePath ".cargo\config.toml" -Encoding UTF8

New-Item -ItemType Directory -Force -Path "python\pecos-rslib\.cargo" | Out-Null
$configContent | Out-File -FilePath "python\pecos-rslib\.cargo\config.toml" -Encoding UTF8

$cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { "$env:USERPROFILE\.cargo" }
New-Item -ItemType Directory -Force -Path $cargoHome | Out-Null
if (Test-Path "$cargoHome\config.toml") {
"`n$configContent" | Out-File -FilePath "$cargoHome\config.toml" -Encoding UTF8 -Append
} else {
Write-Error "Could not find MSVC link.exe"
exit 1
$configContent | Out-File -FilePath "$cargoHome\config.toml" -Encoding UTF8
}

Write-Host "Configured MSVC linker: $linkPath"

- name: Build wheels
uses: pypa/cibuildwheel@v3.3.1
with:
Expand All @@ -195,7 +196,7 @@ jobs:
LLVM_SYS_140_PREFIX=$HOME/.pecos/deps/llvm-14
CMAKE=$HOME/.pecos/deps/cmake-${{ env.PECOS_CMAKE_VERSION }}/bin/cmake
CUDA_PATH=/usr/local/cuda-12.6
MATURIN_PEP517_ARGS=--features=mwpf
MATURIN_PEP517_ARGS=--features=extension-module,mwpf
CIBW_BEFORE_ALL_LINUX: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -228,7 +229,7 @@ jobs:
CMAKE=$HOME/.pecos/deps/cmake-${{ env.PECOS_CMAKE_VERSION }}/CMake.app/Contents/bin/cmake
MACOSX_DEPLOYMENT_TARGET=13.2
SDKROOT=$(xcrun --show-sdk-path)
MATURIN_PEP517_ARGS=--features=mwpf
MATURIN_PEP517_ARGS=--features=extension-module,mwpf
CIBW_BEFORE_ALL_MACOS: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
Expand All @@ -248,7 +249,7 @@ jobs:
PATH="C:\\Users\\runneradmin\\.pecos\\deps\\llvm-14\\bin;C:\\Users\\runneradmin\\.pecos\\deps\\cmake-${{ env.PECOS_CMAKE_VERSION }}\\bin;$PATH"
LLVM_SYS_140_PREFIX="C:\\Users\\runneradmin\\.pecos\\deps\\llvm-14"
CMAKE="C:\\Users\\runneradmin\\.pecos\\deps\\cmake-${{ env.PECOS_CMAKE_VERSION }}\\bin\\cmake.exe"
MATURIN_PEP517_ARGS=--features=mwpf
MATURIN_PEP517_ARGS=--features=extension-module,mwpf
CIBW_BEFORE_ALL_WINDOWS: >
echo "=== Installing LLVM using pecos ===" &&
rustup update &&
Expand Down
96 changes: 47 additions & 49 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Visual Studio environment on Windows
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/ci/setup-msvc.ps1 -Arch x64 -HostArch x64
# No Windows-special MSVC setup here: the first cargo invocation is
# `just ci-env`, whose `_msvc-bootstrap` prerequisite runs
# scripts/win-msvc-bootstrap.ps1 and writes the linker + LIB/INCLUDE into
# .cargo/config.toml (read by cargo after it spawns, so it survives
# git-bash). CI is therefore structurally identical to Linux/macOS, and a
# local Windows dev gets the exact same path via the same just prereq.

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
Expand Down Expand Up @@ -127,54 +129,14 @@ jobs:
path: ~/.pecos/deps/llvm-14
key: llvm-${{ env.LLVM_VERSION }}-${{ runner.os }}-${{ runner.arch }}-v2

# Configure MSVC linker BEFORE any cargo build (Git's link.exe conflicts with MSVC's)
- name: Configure MSVC linker (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vsWhere -latest -property installationPath
$linkPath = Get-ChildItem -Path "$vsPath\VC\Tools\MSVC" -Recurse -Filter "link.exe" |
Where-Object { $_.FullName -like "*\bin\Hostx64\x64\*" } |
Select-Object -First 1 -ExpandProperty FullName
if ($linkPath) {
New-Item -ItemType Directory -Force -Path .cargo | Out-Null
$escapedPath = $linkPath.Replace('\', '/')
"[target.x86_64-pc-windows-msvc]`nlinker = `"$escapedPath`"" | Out-File -FilePath ".cargo\config.toml" -Encoding UTF8
} else {
Write-Error "Could not find MSVC link.exe"
exit 1
}

# `just ci-env` is the first cargo invocation. Its `_msvc-bootstrap`
# prerequisite writes the MSVC linker + LIB/INCLUDE into
# .cargo/config.toml on Windows (no-op elsewhere); LLVM is configured into
# the same file by `pecos setup` during the build. Nothing Windows-special
# is needed at the workflow level.
- name: Ensure LLVM ${{ env.LLVM_VERSION }}
run: just ci-env

- name: Configure LLVM environment (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# Rewrite .cargo/config.toml with both linker and LLVM config
# (`pecos env --github-actions` sets LLVM_SYS_140_PREFIX for following steps.)
$env:PECOS_LLVM = $env:LLVM_SYS_140_PREFIX

# Rewrite .cargo/config.toml with both linker and LLVM config
# (pecos install llvm may have already written this, so overwrite cleanly)
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vsWhere -latest -property installationPath
$linkPath = Get-ChildItem -Path "$vsPath\VC\Tools\MSVC" -Recurse -Filter "link.exe" |
Where-Object { $_.FullName -like "*\bin\Hostx64\x64\*" } |
Select-Object -First 1 -ExpandProperty FullName
$escapedLinker = $linkPath.Replace('\', '/')
$escapedLLVM = $env:LLVM_SYS_140_PREFIX.Replace('\', '/')
@"
[target.x86_64-pc-windows-msvc]
linker = "$escapedLinker"

[env]
LLVM_SYS_140_PREFIX = { value = "$escapedLLVM", force = true }
"@ | Out-File -FilePath ".cargo\config.toml" -Encoding UTF8

# Now install CLI (LLVM env is set, inkwell can find it)
- name: Install PECOS CLI
run: cargo install --path crates/pecos-cli --force

Expand Down Expand Up @@ -233,3 +195,39 @@ jobs:

- name: Run linting
run: just lint check

# Audience-B contract: a crates.io consumer builds the publishable crates
# with plain `cargo` on Windows -- no `just`, no git-bash, no generated
# .cargo/config.toml, none of the MSVC bootstrap. This proves the git-bash
# remediation is confined to the dev/CI tooling and never leaks into the
# crates themselves. Fails closed if a repo config.toml is present.
windows-vanilla-cargo:
name: Windows vanilla cargo (crates.io consumer contract)
runs-on: windows-2022
timeout-minutes: 45
steps:
- uses: actions/checkout@v6

- name: Set up Rust (MSVC)
shell: pwsh
run: |
curl.exe -sSf -o rustup-init.exe https://win.rustup.rs
./rustup-init.exe -y --default-toolchain stable --default-host x86_64-pc-windows-msvc --profile minimal
"$HOME\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Assert no generated .cargo/config.toml (fail closed)
shell: pwsh
run: |
if (Test-Path .cargo/config.toml) {
Write-Error "repo .cargo/config.toml exists; the crates.io contract must hold WITHOUT it"
exit 1
}

# pecos-build (where the toml_edit work lives) and pecos-core are
# publishable and need no LLVM/FFI/external toolchain -- the right
# minimal canary. LLVM-needing crates additionally require the upstream
# llvm-sys LLVM_SYS_140_PREFIX (a universal llvm-sys requirement, not a
# PECOS workaround) and are out of scope for this contract lane.
- name: Vanilla cargo check (publishable crates, no just/bootstrap)
shell: pwsh
run: cargo check -p pecos-build -p pecos-core
8 changes: 6 additions & 2 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,14 @@ jobs:
path: ~/.pecos/deps/llvm-14
key: llvm-${{ env.LLVM_VERSION }}-${{ runner.os }}-${{ runner.arch }}-v2

- name: Set up Visual Studio environment on Windows
- name: Bootstrap MSVC for the Cargo build path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/ci/setup-msvc.ps1 -Arch x64 -HostArch x64
# Single mechanism: writes the linker + LIB/INCLUDE into
# .cargo/config.toml (read by cargo after it spawns). Sets no env pin,
# so `just ci-env` and the direct `cargo build` steps below both work,
# identically to a local Windows build.
run: ./scripts/win-msvc-bootstrap.ps1

- name: Ensure LLVM ${{ env.LLVM_VERSION }}
run: just ci-env
Expand Down
46 changes: 40 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading