Repository navigation
Description
I am currently getting tModLoader to work on FreeBSD and the results are going well, though there are some difficulties due to the lack of official Microsoft builds for this platform (significantly mitigated by the .NET port project and the .NET port in the ports tree, but for other dotnet versions including 11 you still need resort to third-party packages). Mod loading in tModLoader works once compatible native libraries are provided, for now with a local patch to MonoMod.Core.
Edit: The PR adding FreeBSD x86-64 support was merged.
Following up on the 2023 comments about FreeBSD, I have a branch with patches for FreeBSD x86_64.
1. separate FreeBSDSystem, with the shared Unix code moved out of LinuxSystem.
2. FreeBSD is detected from the first field of uname(). Other BSDs still throw, as I have no NetBSD or OpenBSD install to test.
3. Loaded modules are enumerated with dl_iterate_phdr, so neither procfs nor libprocstat is needed, but I don't know if you might want other solutions, dl_iterate_phdr is available in both glibc and BSDs, and as far as I know in musl as well..
4. The Linux x86_64 exception helper is reused unchanged, in my tModLoader tests has proven to work there too.
Environment
FreeBSD 15.1 amd64, a FreeBSD-built .NET SDK 11.0.100 from here, .NET 8 runtime from ports.
Build overrides
- Restore fails with NU1102: the pinned Zig toolset 0.14.1.1 is not available for
Vezel.Zig.Toolsets.freebsd-x64. I used-p:_ZigToolsetPackageVersion=0.15.0.1. - No apphost is available for this SDK build (NETSDK1084). I used
-p:UseAppHost=false. - net11.0 fails with CS8795 in
MonoMod.Utils(Unix.Uname,OSX.Uname).RoslynVersionis 5.3.0, but the SDK's generators need 5.12.0, soLibraryImportGeneratordoes not load (CS9057). I removed theMicrosoft.Net.Compilers.Toolsetreference locally to use the SDK compiler.
I have not checked whether (3) also happens with the official SDK on other platforms.
Tests on FreeBSD, Debug and Release, with the build overrides:
| Framework | Total | Passed | Skipped |
|---|---|---|---|
| net8.0 | 351 | 339 | 12 |
| net11.0 | 352 | 348 | 4 |
I have not run the test suite on Linux or macOS with these changes.
I'm still unsure whether to use separate FreeBSDSystem for this platform or have LinuxSystem parametrized instead.
Activity
nike4613 commentedon Nov 29, 2026
Would be substantially easier to review as a PR.