Skip to content

Commit

Permalink
Add Windows build support and extensive logging for cross-compilation
Browse files Browse the repository at this point in the history
- Added Windows target to default build matrix
- Added verbose logging for Windows builds in Cross.toml
- Added debug logging and toolchain info to build step
- Added -vv flag to cross build command for more verbose output
  • Loading branch information
Kvadratni committed Jan 30, 2025
1 parent 302b913 commit 055abbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
operating-systems:
type: string
required: false
default: '["ubuntu-latest","macos-latest"]'
default: '["ubuntu-latest","macos-latest","windows-latest"]'
architectures:
type: string
required: false
Expand All @@ -33,6 +33,8 @@ jobs:
target-suffix: unknown-linux-gnu
- os: macos-latest
target-suffix: apple-darwin
- os: windows-latest
target-suffix: pc-windows-gnu

steps:
- name: Checkout code
Expand All @@ -50,12 +52,20 @@ jobs:
- name: Build CLI
env:
CROSS_NO_WARNINGS: 0
RUST_LOG: debug
RUST_BACKTRACE: 1
CROSS_VERBOSE: 1
run: |
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
rustup target add "${TARGET}"
echo "Building for target: ${TARGET}"
echo "Rust toolchain info:"
rustup show
echo "Cross version:"
cross --version
# 'cross' is used to cross-compile for different architectures (see Cross.toml)
cross build --release --target ${TARGET} -p goose-cli
cross build --release --target ${TARGET} -p goose-cli -vv
# tar the goose binary as goose-<TARGET>.tar.bz2
cd target/${TARGET}/release
Expand Down
3 changes: 3 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ pre-build = [

[target.x86_64-pc-windows-gnu]
image = "dockcross/windows-static-x64:latest"
# Enable verbose output for Windows builds
build-std = true
env = { "RUST_LOG" = "debug", "RUST_BACKTRACE" = "1", "CROSS_VERBOSE" = "1" }

0 comments on commit 055abbf

Please sign in to comment.