odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.13k stars 551 forks source link

Add FreeBSD to the CI #3733

Closed Feoramund closed 3 weeks ago

Feoramund commented 3 weeks ago

It was mostly file opening procs not being implemented correctly (or at all) that prevented this from working.

I implemented absolute_path_from_handle before realizing that the os package was mistakenly using fstat instead of _fstat, after carefully referencing the NetBSD implementation. I decided to include it anyway, despite it technically not being needed anymore.

(The issue was that fstat depends on absolute_path_from_handle returning a path without error, and since it wasn't implemented on FreeBSD, it failed. fstat was being used in file_size which is being used in read_entire_file_from_handle, so FreeBSD failed every test that had to open a file, even with the incorrect O_* flag values fixed.)

Of note, set -e is necessary for the CI to register any failures. See https://github.com/vmactions/freebsd-vm/issues/72.

Thanks to @andreas-jonsson for the implementation of the NetBSD CI config, from which I have made only slight changes.