nextest-rs/nextest

Add support for OpenBSD

lcheylus opened this issue · 3 comments

For a Rust project, I need to add a GitHub workflow for tests on OpenBSD OS (using this GH action vmactions/openbsd-vm).

In this workflow, I'm using nextest to run tests via cargo nextest.

Currently, nextest build fails on OpenBSD because of an error with waitid C function not included in libc crate (included in shared_child crate) => see my PR rust-lang/libc#3490 to fix this issue.

With this patch, build on OpenBSD is OK. I created an initial OpenBSD port for nextest v0.9.66 , see https://github.com/jasperla/openbsd-wip/tree/master/devel/cargo-nextest

I would like to have a specific nextest release for OpenBSD official version to download directly the resulting binary => https://get.nexte.st/latest/openbsd

That would be the simplest solution to download/install nextest in my GH workflow for OpenBSD.

Sure, happy to do an OpenBSD release. But it would seem like we'd need to wait for a libc release with your patch -- is that correct?

But it would seem like we'd need to wait for a libc release with your patch -- is that correct?

Yes, my PR to add waitid function in libc crate is merged => needs a new release to build nextest on OpenBSD

Update for this request

In the future OpenBSD stable version (7.5, scheduled for April/May 2024), cargo-nextest will be available in ports and could be installed as package.

As a temporary solution, I created a GitHub workflow to build cargo-nextest binary for OpenBSD-stable (current version = 7.4) and publish it as a release sync with nextest release.

See me repository https://github.com/lcheylus/cargo-nextest-openbsd

build.sh: shell script to build cargo-nextest on OpenBSD

  • download cargo-nextest sources for a given version
  • git clone libc crate to add my patch for missing waitid function (rust-lang/libc#3490) => now included in the latest version 0.2.152.
  • download and patch Rust crates (openssl-sys-0.9.97, zstd-sys-2.0.9+zstd.1.5.5) according to OpenBSD cargo.port.mk file (https://github.com/openbsd/ports/blob/master/devel/cargo/cargo.port.mk).
  • patch cargo config to use local patched crates
  • disable "self-update" feature
  • patch Cargo.toml file to strip binary
  • build cargo-nextest binary with release profile

"Build and publish" GH workflow :

  • run an OpenBSD-stable VM on GH Ubuntu runner with vmactions/openbsd-vm action
  • build cargo-nextest bianry on OpenBSD VM
  • publish release : archive tar.gz with built cargo-nextest binary.

Build and GH workflow are OK. I publish with it a release for OpenBSD of cargo-nextest version 0.9.66 (latest release) => https://github.com/lcheylus/cargo-nextest-openbsd/releases/tag/0.9.66