-
Notifications
You must be signed in to change notification settings - Fork 0
Support building and running josh on Windows #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
02d76ed
15646ed
de3de6e
a6c7fa5
b2dbb1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: rust-windows | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ '**' ] | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| merge_group: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| # aws-lc-sys (rustls' default provider) assembles with NASM on x86-64; the | ||
| # crate ships prebuilt objects behind this switch, so the runner needs no | ||
| # extra install. ARM64 hosts need clang-cl instead. | ||
| AWS_LC_SYS_PREBUILT_NASM: 1 | ||
|
|
||
| jobs: | ||
| windows: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - { arch: x86-64, os: windows-latest } | ||
| - { arch: arm64, os: windows-11-arm } | ||
| runs-on: ${{ matrix.os }} | ||
| name: Windows ${{ matrix.arch }} | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checkout leaves token usable by tests
Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents |
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # stable | ||
| with: | ||
| toolchain: stable | ||
| # aws-lc-sys' ARM assembly is GNU-syntax, which MSVC cannot assemble: the | ||
| # build then fails late in lib.exe, archiving objects that were never | ||
| # written. clang-cl assembles it and stays ABI-compatible with the MSVC | ||
| # toolchain the Rust side links with. The runner image ships it; the step | ||
| # reports what it found, and warns loudly if it ever has to install one. | ||
| - name: Use clang-cl for C dependencies | ||
| if: matrix.arch == 'arm64' | ||
| shell: pwsh | ||
| run: | | ||
| $clang = Get-Command clang-cl -ErrorAction SilentlyContinue | ||
| if ($clang) { | ||
| Write-Host "clang-cl: $($clang.Source)" | ||
| } else { | ||
| $found = Get-ChildItem "$env:ProgramFiles\Microsoft Visual Studio", "$env:ProgramFiles\LLVM" ` | ||
| -Recurse -Filter clang-cl.exe -ErrorAction SilentlyContinue | | ||
| Select-Object -First 1 -ExpandProperty DirectoryName | ||
| if ($found) { | ||
| Write-Host "::warning::clang-cl was not on PATH; using $found" | ||
| Add-Content $env:GITHUB_PATH $found | ||
| } else { | ||
| Write-Host "::warning::the runner image no longer ships clang-cl; installing LLVM" | ||
| choco install llvm -y --no-progress | ||
| Add-Content $env:GITHUB_PATH "$env:ProgramFiles\LLVM\bin" | ||
|
Comment on lines
+56
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mutable LLVM package alters CI toolchainThe ARM fallback runs Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents |
||
| } | ||
| } | ||
| # cc-rs splits these on whitespace, so the bare name has to resolve on PATH. | ||
| Add-Content $env:GITHUB_ENV "CC=clang-cl" | ||
| Add-Content $env:GITHUB_ENV "CXX=clang-cl" | ||
|
|
||
| # josh-ssh-shell is unix-only (unix sockets, fifos, raw fds), so the | ||
| # workspace does not build here. | ||
| - name: Build | ||
| run: cargo build --locked -p josh-proxy -p josh-cli | ||
| # josh compose needs podman and does not run on Windows, so the .t suites | ||
| # are out of reach; these are the crates whose unit tests run here. | ||
| - name: Unit tests | ||
| run: cargo test --locked -p josh-core -p josh-filter -p josh-gix-ext -p josh-git-serde -p josh-search -p josh-memodb | ||
|
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Windows CI skips CLI and proxy unit testsThe Windows Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents |
||
| # Drives the built binaries, since the .t suites cannot run here: the CLI | ||
| # against a local repository, and josh-proxy against a git server hosted by | ||
| # HttpListener, so the job needs nothing that Windows does not ship. | ||
| - name: Functional tests | ||
| run: pwsh tests/windows/run.ps1 target/debug -PathForms | ||
|
Comment on lines
+73
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Port collisions invalidate Windows functional testsThe harness hard-codes Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR build can retain write token
This
pull_requestworkflow executes checkout-controlled Cargo, PowerShell, and Bash code without an explicit token scope, so permissive repository defaults can expose write access during same-repository PRs — should we setpermissions: contents: readand grant no other permissions?Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents