Skip to content

Commit

Permalink
add tracing_subscriber needed rust flags for each binding (#1143)
Browse files Browse the repository at this point in the history
<!-- 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 -->
  • Loading branch information
aaronvg authored Nov 4, 2024
1 parent 2439d47 commit bf2b428
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-python-release.reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release language_client_python
on:
workflow_call: {}
push:
branches: [manylinux-x86]
branches: [manylinux-x86, aaron-fix]

concurrency:
# suffix is important to prevent a concurrency deadlock with the calling workflow
Expand Down Expand Up @@ -44,13 +44,13 @@ jobs:

- target: x86_64-apple-darwin
runs_on: macos-latest

- target: aarch64-apple-darwin
runs_on: macos-latest

- target: x86_64-pc-windows-msvc
runs_on: windows-latest

name: ${{ matrix._.target }}
runs-on: ${{ matrix._.runs_on }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-ruby-release.reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release engine/language_client_ruby

on:
workflow_call: {}
push:
branches: [aaron-fix]

permissions:
contents: read
Expand Down Expand Up @@ -72,6 +74,9 @@ jobs:
mkdir -p "$rb_sys_dock_cache_dir"
echo "RB_SYS_DOCK_CACHE_DIR=$rb_sys_dock_cache_dir" >> $GITHUB_ENV
echo "rb_sys_version=$rb_sys_version" >> $GITHUB_OUTPUT
cat >>$GITHUB_ENV <<EOF
RUSTFLAGS=--cfg tracing_unstable
EOF
- name: Setup rb-sys
shell: bash
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/build-typescript-release.reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release language_client_typescript
on:
workflow_call: {}
push:
branches: [sam/alpine-warnings]
branches: [sam/alpine-warnings, aaron-fix]

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

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

name: ${{ matrix._.target }}
Expand Down Expand Up @@ -101,7 +105,7 @@ jobs:
- name: PNPM Install
run: pnpm install --frozen-lockfile
working-directory: engine/language_client_typescript

# per-matrix-entry dependency setup
- name: Build tools setup
run: ${{ matrix._.before }}
Expand All @@ -110,7 +114,7 @@ jobs:
- name: PNPM Build
run: ${{ matrix._.node_build }}
working-directory: engine/language_client_typescript

- name: Build TS
run: pnpm build:ts_build
working-directory: engine/language_client_typescript
Expand All @@ -120,4 +124,4 @@ jobs:
with:
name: bindings-${{ matrix._.target }}
path: engine/language_client_typescript/*.node
if-no-files-found: error
if-no-files-found: error
1 change: 1 addition & 0 deletions engine/language_client_ruby/ext/ruby_ffi/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# - GEM_NAME is the name of the gem in ext/baml
create_rust_makefile("ruby_ffi") do |r|
r.extra_cargo_args += ["--package", "ruby_ffi"]
r.extra_rustflags = ["--cfg=tracing_unstable"]
r.env = {
"MACOSX_DEPLOYMENT_TARGET" => "10.13",
}
Expand Down

0 comments on commit bf2b428

Please sign in to comment.