From bc28ca18b7d3cfed29e40ef9a574a881bf7070b2 Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 19 Jun 2023 20:04:25 +0200 Subject: [PATCH] Add precompiled NIFs for freebsd (#618) * 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] https://github.com/cross-rs/cross/pull/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 --- .github/workflows/release.yml | 2 ++ lib/explorer/polars_backend/native.ex | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 783af92e7..a0e01a34f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/lib/explorer/polars_backend/native.ex b/lib/explorer/polars_backend/native.ex index d059062cc..da2f056ab 100644 --- a/lib/explorer/polars_backend/native.ex +++ b/lib/explorer/polars_backend/native.ex @@ -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"]