From 36ecbe9a4a51e24e74f62fb36c76747d9a16c114 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Wed, 24 Jul 2024 08:32:14 -0700 Subject: [PATCH 1/5] build older linux --- .../build-python-release.reusable.yaml | 66 +++++++++++++++++++ .github/workflows/release.yml | 42 ++++++------ engine/baml-runtime/build.rs | 3 +- 3 files changed, 91 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build-python-release.reusable.yaml diff --git a/.github/workflows/build-python-release.reusable.yaml b/.github/workflows/build-python-release.reusable.yaml new file mode 100644 index 0000000000..6de17c1f45 --- /dev/null +++ b/.github/workflows/build-python-release.reusable.yaml @@ -0,0 +1,66 @@ +name: Release language_client_python + +on: + workflow_call: {} + +concurrency: + # suffix is important to prevent a concurrency deadlock with the calling workflow + group: ${{ github.workflow }}-${{ github.ref }}-build-python + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + _: + - runs_on: ubuntu-latest + target: x86_64 + name: x86_64-unknown-linux-gnu + + - runs_on: ubuntu-latest + target: aarch64 + name: aarch64-unknown-linux-gnu + + - runs_on: macos-latest + target: x86_64 + name: x86_64-apple-darwin + + - runs_on: macos-latest + target: aarch64 + name: aarch64-apple-darwin + + - runs_on: windows-latest + target: x64 + name: x86_64-pc-windows-msvc + + runs-on: ${{ matrix._.runs_on }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.8" + architecture: ${{ matrix._.runs_on == 'windows-latest' && 'x64' || null }} + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix._.target }} + command: build + args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml + sccache: "true" + manylinux: ${{ matrix._.runs_on == 'ubuntu-latest' && 'auto' || null }} + before-script-linux: | + if command -v yum &> /dev/null; then + yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic + else + # If we're running on debian-based system. + apt update -y && apt-get install -y libssl-dev openssl pkg-config + fi + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix._.name }} + path: engine/language_client_python/dist + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cca937b0a8..15d7febb8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,6 +94,9 @@ jobs: path: typescript/vscode-ext/packages/web-panel/dist if-no-files-found: error + build-python-release: + uses: ./.github/workflows/build-python-release.reusable.yaml + build-ruby-release: uses: ./.github/workflows/build-ruby-release.reusable.yaml @@ -150,10 +153,10 @@ jobs: steps: - uses: actions/checkout@v4 # Install python set up - - uses: actions/setup-python@v5 - with: - python-version: "3.8" - architecture: ${{ matrix._.setup-python-architecture }} + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.8" + # architecture: ${{ matrix._.setup-python-architecture }} - uses: jdx/mise-action@v2 if: ${{ matrix._.mise }} @@ -198,21 +201,21 @@ jobs: working-directory: engine/language_client_typescript # Build Python - - name: Build Python - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix._.target }} - command: build - args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml - container: off - - # Upload - - name: Upload Python - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix._.target }} - path: engine/language_client_python/dist - if-no-files-found: error + # - name: Build Python + # uses: PyO3/maturin-action@v1 + # with: + # target: ${{ matrix._.target }} + # command: build + # args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml + # container: off + + # # Upload + # - name: Upload Python + # uses: actions/upload-artifact@v4 + # with: + # name: wheels-${{ matrix._.target }} + # path: engine/language_client_python/dist + # if-no-files-found: error - name: Upload artifact uses: actions/upload-artifact@v4 @@ -226,6 +229,7 @@ jobs: runs-on: ubuntu-latest needs: - build-release + - build-python-release - build-ruby-release - build-wasm steps: diff --git a/engine/baml-runtime/build.rs b/engine/baml-runtime/build.rs index 947381dc4f..25922c128e 100644 --- a/engine/baml-runtime/build.rs +++ b/engine/baml-runtime/build.rs @@ -113,5 +113,6 @@ fn main() { return; } - panic!("Build checks failed"); + // comment this out - might cause a build break + // panic!("Build checks failed"); } From 6a0241eb2e1f5d0d4680b40e88b0e95531564592 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Wed, 24 Jul 2024 08:32:36 -0700 Subject: [PATCH 2/5] build on push --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15d7febb8e..476052c730 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ on: tags: - "test-release/*.*" - "*.*" + branches: [sam/fix-abi] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 6e8bfeba908b0400bec5de5d2c1b5de56ab9e085 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Wed, 24 Jul 2024 08:46:19 -0700 Subject: [PATCH 3/5] build arm hopefully --- .github/workflows/build-python-release.reusable.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-python-release.reusable.yaml b/.github/workflows/build-python-release.reusable.yaml index 6de17c1f45..14c03d284b 100644 --- a/.github/workflows/build-python-release.reusable.yaml +++ b/.github/workflows/build-python-release.reusable.yaml @@ -17,10 +17,12 @@ jobs: - runs_on: ubuntu-latest target: x86_64 name: x86_64-unknown-linux-gnu + manylinux: 'auto' - runs_on: ubuntu-latest target: aarch64 name: aarch64-unknown-linux-gnu + manylinux: '2_28' - runs_on: macos-latest target: x86_64 @@ -49,7 +51,7 @@ jobs: command: build args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml sccache: "true" - manylinux: ${{ matrix._.runs_on == 'ubuntu-latest' && 'auto' || null }} + manylinux: ${{ matrix._.manylinux }} before-script-linux: | if command -v yum &> /dev/null; then yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic From f7ec35a687858cef82bf73249706d80353c5ffe5 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Wed, 24 Jul 2024 08:56:08 -0700 Subject: [PATCH 4/5] no branch push --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 476052c730..15d7febb8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ on: tags: - "test-release/*.*" - "*.*" - branches: [sam/fix-abi] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From a7c1d6d32c565d38b85e7d919d3900102b75fe7e Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Wed, 24 Jul 2024 08:59:07 -0700 Subject: [PATCH 5/5] retrigger CI