Skip to content

fix(*bsd): add missing source files for BSD OS - #14

Merged
torque merged 2 commits into
allyourcodebase:masterfrom
Willaaaaaaa:patch-fix_bsd
Oct 5, 2026
Merged

torque merged 2 commits into
allyourcodebase:masterfrom
Willaaaaaaa:patch-fix_bsd

Conversation

@Willaaaaaaa

Copy link
Copy Markdown
Contributor

Problem:
FreeBSD, NetBSD and OpenBSD were missing some source files which upstream adds on all BSDs.

Solution:
Add them to *bsd source lists, matching upstream CMakeLists.txt.

Ref: https://github.com/libuv/libuv/blob/49b1c064714b412d7f7a2f5e7146c977554e57f9/CMakeLists.txt#L288-L306

Problem:
FreeBSD, NetBSD and OpenBSD were missing some source files which
upstream adds on all BSDs.

Solution:
Add them to *bsd source lists, matching upstream CMakeLists.txt.
@Willaaaaaaa

Willaaaaaaa commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Should I also add CI jobs for BSD OS? Maybe FreeBSD and OpenBSD?

@torque

torque commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

If it's straightforward to set up BSD (using a VM, I guess?) in CI, that would be good in order to keep these targets from drifting. If you're willing to that, it would be a nice contribution. I'll leave this PR open for now so you can add that to it, but if you'd prefer to do it in a separate PR just let me know.

Comment thread .github/workflows/ci.yaml
- os: freebsd
packages: pkg install -y curl
- os: openbsd
packages: pkg_add -I curl xz # OpenBSD tar cannot decompress .tar.xz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE:
It turns out that tar in OpenBSD has no -J option and cannot extract .tar.xz files.
Unlike OpenBSD (base tar is pax), FreeBSD (base tar is bsdtar) can extract .tar.xz well.

Ref:
https://github.com/openbsd/src/blob/dfaf7899c030e92af72bff3730d9aa52f6059072/bin/pax/Makefile#L9
https://github.com/openbsd/src/blob/dfaf7899c030e92af72bff3730d9aa52f6059072/bin/pax/options.c#L1790-L1798
https://www.mail-archive.com/tech@openbsd.org/msg08996.html

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unsurprising. I think using xzcat so the two BSD targets have the same job definition is fine.

Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
prepare: |
${{ matrix.packages }}
mkdir -p /usr/local/zig
curl -fsSL https://ziglang.org/download/${{ matrix.zig-version }}/zig-x86_64-${{ matrix.os }}-${{ matrix.zig-version }}.tar.xz -o /usr/local/zig/zig.tar.xz

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll see if I can upstream a feature to override the mlugg/setup-zig auto host machine detection since I'd rather not have a CI job directly pulling from ziglang.org if we can avoid it. That's not a blocker for merging this, though.

Comment thread .github/workflows/ci.yaml
@torque

torque commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks for fixing these targets and adding the CI coverage!

@torque
torque merged commit 7f3fa69 into allyourcodebase:master Oct 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants