Skip to content

Commit

Permalink
Add precompiled NIFs for freebsd (#618)
Browse files Browse the repository at this point in the history
* Add freebsd as target for precomp NIFs

* Use existing target

* Use ubuntu as OS and make use of cross

* Set cross version to v0.2.5

The default is cross v0.2.4 which was created in Juli of 2022 [0]. The
patch to add libmemstat [1] was created in December of 2022, so we need
a newer version of cross.

[0] https://github.com/cross-rs/cross/pkgs/container/x86_64-unknown-freebsd/28076628?tag=0.2.4
[1] cross-rs/cross#1166

* Use ubuntu-22.04 for freebsd target

* Re-enable all disabled targets

* Use ubuntu-22.04 for all cross based targets

* Revert to use ubuntu-20.04 for existing targets

This introduces a new variable `cross-version` which defaults to v0.2.4
and is set to v0.2.5 for freebsd.

It is required because cross v0.2.5 fails to build on ubuntu-20.04.

* Add freebsd to list of targets
  • Loading branch information
maltekrupa authored Jun 19, 2023
1 parent 2005b90 commit bc28ca1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- { target: riscv64gc-unknown-linux-gnu, os: ubuntu-20.04, use-cross: true, disable-polars-json-feature: true }
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
- { target: x86_64-unknown-freebsd, os: ubuntu-22.04, use-cross: true, cross-version: v0.2.5 }

steps:
- name: Checkout source code
Expand Down Expand Up @@ -81,6 +82,7 @@ jobs:
target: ${{ matrix.job.target }}
nif-version: ${{ matrix.nif }}
use-cross: ${{ matrix.job.use-cross }}
cross-version: ${{ matrix.job.cross-version || 'v0.2.4' }}
project-dir: "native/explorer"

- name: Artifact upload
Expand Down
1 change: 1 addition & 0 deletions lib/explorer/polars_backend/native.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule Explorer.PolarsBackend.Native do
x86_64-pc-windows-gnu
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
x86_64-unknown-freebsd
),
mode: mode,
force_build: System.get_env("EXPLORER_BUILD") in ["1", "true"]
Expand Down

0 comments on commit bc28ca1

Please sign in to comment.