Skip to content

Commit 9fd655d

Browse files
authored
fix windows cli build (#2667)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Enable Windows CLI build in CI and update generated Python/TypeScript clients to v0.212.0 with new `watchers` support and minor config tweaks. > > - **CI/CD (CLI Build)**: > - Add Windows branch trigger and Windows-specific setup in `.github/workflows/build-cli-release.reusable.yaml` (install `protoc` and `protoc-gen-go`, skip `mise` on Windows). > - Split CFFI build into Unix vs Windows steps; adjust artifact naming and PATH handling. > - Improve Rust unit test workflow in `primary.yml` (list built libs, set `BAML_LIBRARY_PATH`, run tests verbosely). > - **Generated Python Client**: > - Bump generator version to `0.212.0` and export `watchers`. > - Extend `BamlCallOptions` with `watchers` and plumb through runtime calls. > - Add `set_log_max_message_length` alias in `config`. > - **Generated TypeScript Client**: > - Bump package version to `0.212.0` and switch exported namespace from `events` to `watchers`. > - Make `BamlCallOptions` generic with optional `watchers`; thread through async/sync clients and request builders. > - Update method calls to pass `options.watchers` across generated services. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4a571dd. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 9f43516 commit 9fd655d

File tree

138 files changed

+1797
-1105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1797
-1105
lines changed

.github/workflows/build-cli-release.reusable.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
push:
1616
branches:
1717
- sam/mise-protoc-gen-go
18+
- aaron/fix-windows
1819
env:
1920
MACOSX_DEPLOYMENT_TARGET: "10.13"
2021
# Turbo remote caching
@@ -82,11 +83,29 @@ jobs:
8283
- name: Setup Go
8384
uses: ./.github/actions/setup-go
8485

85-
8686
- uses: jdx/mise-action@v2
87+
if: matrix._.os != 'windows-2022'
8788
with:
8889
install_args: "protoc-gen-go"
8990

91+
- name: Setup Protoc (Windows)
92+
if: matrix._.os == 'windows-2022'
93+
shell: bash
94+
run: |
95+
# Download protoc directly to avoid rate limiting
96+
PROTOC_VERSION="27.1"
97+
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-win64.zip"
98+
unzip -q protoc-${PROTOC_VERSION}-win64.zip -d $HOME/.local
99+
echo "$HOME/.local/bin" >> $GITHUB_PATH
100+
rm protoc-${PROTOC_VERSION}-win64.zip
101+
102+
- name: Install protoc-gen-go (Windows)
103+
if: matrix._.os == 'windows-2022'
104+
run: |
105+
go install google.golang.org/protobuf/cmd/[email protected]
106+
echo "$HOME/go/bin" >> $GITHUB_PATH
107+
shell: bash
108+
90109
- name: Test protoc-gen-go availability
91110
id: protoc_gen_go_setup
92111
shell: bash
@@ -135,7 +154,8 @@ jobs:
135154
--no-default-features
136155
working-directory: engine
137156

138-
- name: Build CFFI Library
157+
- name: Build CFFI Library (Unix)
158+
if: ${{ !contains(matrix._.os, 'windows') }}
139159
shell: bash
140160
run: |
141161
# Set the correct protoc-gen-go path based on whether we're using cross (Linux) or native build
@@ -157,6 +177,13 @@ jobs:
157177
${{ env.CARGO }} build --release -p baml_cffi ${{ env.TARGET_FLAGS }}
158178
working-directory: engine
159179

180+
- name: Build CFFI Library (Windows)
181+
if: ${{ contains(matrix._.os, 'windows') }}
182+
shell: bash
183+
run: |
184+
cargo build --release -p baml_cffi ${{ env.TARGET_FLAGS }}
185+
working-directory: engine
186+
160187
# Determine CFFI library name and artifact suffix based on OS
161188
- name: Set CFFI Lib Info
162189
id: cffi_info

.github/workflows/primary.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,14 @@ jobs:
237237
export LD_LIBRARY_PATH="${RUBY_LIB_PATH}:${LD_LIBRARY_PATH}"
238238
# Build baml_cffi shared library
239239
cargo build --package baml_cffi
240+
echo "Listing release directory:"
241+
ls -la engine/target/release/libbaml_cffi.* || true
242+
ls -la engine/target/release/baml_cffi.* || true
243+
244+
export BAML_LIBRARY_PATH=${{ github.workspace }}/engine/target/debug/libbaml_cffi.so
240245
# Run tests
241-
cargo test --features skip-integ-tests
246+
echo "BAML_LIBRARY_PATH=${{ github.workspace }}/engine/target/debug/libbaml_cffi.so" >> $GITHUB_ENV
247+
cargo test --features skip-integ-tests --verbose -- --nocapture
242248
working-directory: engine
243249

244250
- name: Run Python integration tests

engine/generators/languages/python/generated_tests/array_types/baml_client/__init__.py

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/array_types/baml_client/config.py

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/array_types/baml_client/runtime.py

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/asserts/baml_client/__init__.py

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/asserts/baml_client/config.py

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/asserts/baml_client/runtime.py

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/classes/baml_client/__init__.py

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/generators/languages/python/generated_tests/classes/baml_client/config.py

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)