← 输入框|github.com|刷新
Skip to content

FreeBSD need overrides to not fail the tests #372

Backlog

Description

@Renkoto

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

  1. 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.
  2. No apphost is available for this SDK build (NETSDK1084). I used -p:UseAppHost=false.
  3. net11.0 fails with CS8795 in MonoMod.Utils (Unix.Uname, OSX.Uname). RoslynVersion is 5.3.0, but the SDK's generators need 5.12.0, so LibraryImportGenerator does not load (CS9057). I removed the Microsoft.Net.Compilers.Toolset reference 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

  1. nike4613 commented on Nov 29, 2026

    @nike4613
    Member

    Would be substantially easier to review as a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions