Code Monkey home page Code Monkey logo

Comments (1)

Lovesan avatar Lovesan commented on May 29, 2024 1

I'll copy my comment from Reddit in here:

FreeBSD isn't officially supported by .NET. I wasn't even aware that you could even build it here. However, seems like there's a community port now.

So porters for my library are also welcome!

So, to port it to FreeBSD, you need to make a patch, that requires several additions, and probably some nontrivial signal hackery.

First, you should probably add coreclr-freebsd to *features*.

https://github.com/Lovesan/bike/blob/master/src/features.lisp

Next, you need to implement get-exe-path function for your OS. It retrieves the running executable path which is required for .NET runtime initialization:

(defun get-exe-path ()

(the real reason for your error comes from this function)

Probably you should check '/proc/curproc/file', and in case procfs does not exist in the FreeBSD installation, the library is running on, then you would probably need some syscall invocation using CFFI.

Now, to the hardest part.

As you can see from the README, the library actually does some fancy lowlevel signal hackery when it comes to running it on Linux. FreeBSD port would most likely require the same level of workarounds. (actually, macOS would require that too, but I haven't had much access to that OS recently)

First, you should write some signal numbers for FreeBSD and probably reuse some specific function from here

#+coreclr-restore-signals

Next, you should verify, what specific signal numbers are critically required by dotnet, and write some save-restore logic akin to the following:

#+coreclr-restore-signals

You should probably look at FreeBSD .NET port and the patches it applies to the .NET runtime, to look up for this.

At least SIGCHLD and INJECT_ACTIVATION_SIGNAL should be restored to .NET handlers.

INJECT_ACTIVATION_SIGNAL is used by .NET for some thread-related hackery and equals SIGRTMIN on Linux and SIGUSR1 on OSes where SIGRTMIN is not defined in C headers.

It is defined here in the original .NET source.

https://github.com/dotnet/runtime/blob/52c14fb8d01ddd293a0710642aa1e7ef3a438687/src/coreclr/pal/src/exception/signal.cpp#L56

Finally, you should also check where the library uses coreclr-whatever feature, e.g. coreclr-linux and coreclr-macos specifically, and whether some things need to be fixed additionally (some pathnames, file extensions, etc, but probably FreeBSD does not differ from Linux in that regard, and the library already does handle most of the things based on coreclr-windows presence).

from bike.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.