Skip to content

Commit bf2b428

Browse files
authored
add tracing_subscriber needed rust flags for each binding (#1143)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add Rust flags for `tracing_subscriber` and update GitHub workflows to include `aaron-fix` branch for Python, Ruby, and TypeScript clients. > > - **Rust Configuration**: > - Add `rustflags` for `tracing_unstable` in `.cargo/config.toml` for Python, Ruby, and TypeScript clients. > - Include musl target-specific flags in each language client's configuration. > - **GitHub Workflows**: > - Add `aaron-fix` branch to trigger builds in `build-python-release.reusable.yaml`, `build-ruby-release.reusable.yaml`, and `build-typescript-release.reusable.yaml`. > - Set `RUSTFLAGS` in `build-ruby-release.reusable.yaml` and `build-typescript-release.reusable.yaml` for musl targets. > - **Ruby Extension**: > - Add `extra_rustflags` for `tracing_unstable` in `extconf.rb`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for c72c2f6. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 2439d47 commit bf2b428

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release language_client_python
33
on:
44
workflow_call: {}
55
push:
6-
branches: [manylinux-x86]
6+
branches: [manylinux-x86, aaron-fix]
77

88
concurrency:
99
# suffix is important to prevent a concurrency deadlock with the calling workflow
@@ -44,13 +44,13 @@ jobs:
4444

4545
- target: x86_64-apple-darwin
4646
runs_on: macos-latest
47-
47+
4848
- target: aarch64-apple-darwin
4949
runs_on: macos-latest
50-
50+
5151
- target: x86_64-pc-windows-msvc
5252
runs_on: windows-latest
53-
53+
5454
name: ${{ matrix._.target }}
5555
runs-on: ${{ matrix._.runs_on }}
5656
steps:

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Release engine/language_client_ruby
22

33
on:
44
workflow_call: {}
5+
push:
6+
branches: [aaron-fix]
57

68
permissions:
79
contents: read
@@ -72,6 +74,9 @@ jobs:
7274
mkdir -p "$rb_sys_dock_cache_dir"
7375
echo "RB_SYS_DOCK_CACHE_DIR=$rb_sys_dock_cache_dir" >> $GITHUB_ENV
7476
echo "rb_sys_version=$rb_sys_version" >> $GITHUB_OUTPUT
77+
cat >>$GITHUB_ENV <<EOF
78+
RUSTFLAGS=--cfg tracing_unstable
79+
EOF
7580
7681
- name: Setup rb-sys
7782
shell: bash

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release language_client_typescript
33
on:
44
workflow_call: {}
55
push:
6-
branches: [sam/alpine-warnings]
6+
branches: [sam/alpine-warnings, aaron-fix]
77

88
concurrency:
99
# suffix is important to prevent a concurrency deadlock with the calling workflow
@@ -57,6 +57,7 @@ jobs:
5757
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc
5858
CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
5959
AR_x86_64_unknown_linux_musl=x86_64-linux-musl-ar
60+
RUSTFLAGS=-C target-feature=-crt-static --cfg tracing_unstable
6061
EOF
6162
node_build: pnpm build:napi-release --target x86_64-unknown-linux-musl --use-napi-cross
6263

@@ -66,6 +67,9 @@ jobs:
6667
curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz
6768
tar -xzf aarch64-linux-musl-cross.tgz
6869
echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
70+
cat >>$GITHUB_ENV <<EOF
71+
RUSTFLAGS=-C target-feature=-crt-static --cfg tracing_unstable
72+
EOF
6973
node_build: pnpm build:napi-release --target aarch64-unknown-linux-musl --use-napi-cross
7074

7175
name: ${{ matrix._.target }}
@@ -101,7 +105,7 @@ jobs:
101105
- name: PNPM Install
102106
run: pnpm install --frozen-lockfile
103107
working-directory: engine/language_client_typescript
104-
108+
105109
# per-matrix-entry dependency setup
106110
- name: Build tools setup
107111
run: ${{ matrix._.before }}
@@ -110,7 +114,7 @@ jobs:
110114
- name: PNPM Build
111115
run: ${{ matrix._.node_build }}
112116
working-directory: engine/language_client_typescript
113-
117+
114118
- name: Build TS
115119
run: pnpm build:ts_build
116120
working-directory: engine/language_client_typescript
@@ -120,4 +124,4 @@ jobs:
120124
with:
121125
name: bindings-${{ matrix._.target }}
122126
path: engine/language_client_typescript/*.node
123-
if-no-files-found: error
127+
if-no-files-found: error

engine/language_client_ruby/ext/ruby_ffi/extconf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# - GEM_NAME is the name of the gem in ext/baml
1111
create_rust_makefile("ruby_ffi") do |r|
1212
r.extra_cargo_args += ["--package", "ruby_ffi"]
13+
r.extra_rustflags = ["--cfg=tracing_unstable"]
1314
r.env = {
1415
"MACOSX_DEPLOYMENT_TARGET" => "10.13",
1516
}

0 commit comments

Comments
 (0)