-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support FreeBSD #272
Comments
Minor improvement until we hopefully can resolve #272 one day.
Minor improvement until we hopefully can resolve #272 one day.
I, and at least two others, publicly publish net3.1, net5, and net6 SDKs for FreeBSD. Using the Microsoft published SDK outside of FreeBSD to target FreeBSD does however, require manually adding in the FreeBSD RID ( As you have this marked as "Later" I assume this is a longterm goal so when you are ready, let me know and I (and likely others!) would be happy to help you get setup with FreeBSD and dotNET :) |
Very interesting, thanks for the feedback! 👍🏻🙂 I’m not really a FreeBSD user myself (mostly using Linux) but I definitely wouldn’t mind adding support for FreeBSD in the project. Even other BSD:s would be cool (like NetBSD on The CI publishing is done from Linux; snapshots are generated for Linux, macOS and Windows from GitHub Actions. So if/when we add FreeBSD support it would be great if it could be cross-compiled from Linux. I set up an Azure VM with FreeBSD yesterday, so if you have some links I’ll happily try out the .NET SDK. It’s the .NET 6 package that would be interesting in this case. (and btw, thanks for your interest in the project. You’re the first person to ever write a comment in this repo, apart from me and a colleague I involuntarily involved. 😂🎉) |
Ping @Thefrank. 🙂 Do you have a link to your .NET 6 SDK? |
https://github.com/Thefrank/dotnet-freebsd-crossbuild These are built for and target FreeBSD 12.2. They SHOULD work under FreeBSD 12.3+ |
Thanks, nice! 👍 I quickly downloaded it on my FreeBSD (cloud-based) test VM and
So... what would be the next step? I guess something like this, if we want to cross-build from Linux?
The current steps we use for building a release a roughly the following. Note that Lines 13 to 14 in 4afdce4
We also perform link-time "trimming" of the output, to keep the size of the generated binaries down:
|
distribution:
|
Thanks. This gave me the following error:
This is using the native-binaries repo. Perhaps it would be worth mentioning something about this requirement in either the readme for that repo or in https://github.com/Thefrank/dotnet-freebsd-crossbuild? 🤔
After installing this, I got a bit further:
Guessing from https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/freebsd-instructions.md, I installed I wonder if this could be caused by some particular directory structure being required? I just unpacked this into
Using
I tried with
And
I'll try building the Perlang project with this SDK in a minute, hope to post some details about it in a separate comment soon. |
Trying to build Perlang (just checking out the repo and running Here are some of the first errors in the build output:
I remember there was a timestamping related issue on Debian systems a few months ago (NuGet/Home#10491). This probably has similar root causes.... or what do you think? 🤔 |
Doing this seems to work fine btw:
|
whew! so, yeah I should add some instructions there that are not covered elsewhere (https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/freebsd-requirements.md#running-on-freebsd). generally dotnet needs these depends to run:
Recently, For building packages, you also need mv /usr/share/certs/blacklisted/VeriSign_Universal_Root_Certification_Authority.pem /usr/share/certs/trusted
certctl rehash WARNING: You are basically trusting an otherwise blacklisted rootcert. Actual fix: |
Thanks! 🙇 👍 So it was indeed the same root cause as the Debian one I think; there is even a blog post that describes that problem more in depth: https://devblogs.microsoft.com/nuget/net-5-nuget-restore-failures-on-linux-distributions-using-nss-or-ca-certificates/ Anyway, running these commands:
...seemed to make things work much better with these NuGet sources. 🎉 And btw, thanks for making this very clear:
With these changes in place, the Perlang tooling builds without any obvious problems (note, this is in the Debug configuration without R2R or anything like that enabled yet):
Running the result also seems to work (we'll need to make it distinguish between different kind of unices at some point, because
I'll also do some more testing in a minute, again posting that in a separate comment to allow people to follow this in real time. 🙂 |
Alright, so here are some more results of my testing: Running the REPLSeems to work pretty well, but backspace doesn't properly print an erase
Running the testsSeems to work just fine. Some tests are skipped, but that's expected.
Next stepsWe should try cross-building this on Linux as the next step; I won't be looking into this right now so if you like, the task is up for grabs. Otherwise I'll probably look into it in the next few weeks. Should be roughly following these steps from your guide:
The way this currently works for Linux/macOS/Windows is as follows: perlang/.github/workflows/publish-packages.yml Lines 44 to 58 in 4afdce4
We use a build matrix for these, with which we can easily support both |
@Thefrank From the top off your head, what are the odds that official support for FreeBSD will get merged into https://github.com/dotnet/runtime/ and released along with .NET 7? 🤔 I guess just waiting until there is the easiest way out here... once it's included in an official release it should be a trivial oneliner to support it from our POV (just adding it to the CI config and off we go). So if that's like to happen soon, I might just end up until .NET 7 gets released later this year to minimize my own effort. |
@perlun chance of FreeBSD being officially supported is low to none for net7. It still has test failures and would need a good amount of effort put forth by Microsoft to add FreeBSD VMs to their CI system. The advantage the FreeBSD community has from it NOT being officially supported is that we can drop older versions of FreeBSD from support as they move EOL and add in features from newer versions much faster than an officially supported platform would be able to. |
@Thefrank Sorry for the late reply. Understand. 👍 I can also understand why this can be an advantage for you and others in the FreeBSD community. From my POV, things might be a bit different. I am thinking about ease of applying new .NET releases (.NET 7, .NET 8, .NET 9 and so forth). For all our current platforms ( I think this is perhaps also why I'm a bit hesitant to bring in FreeBSD at a too-early stage, when the platform isn't officially supported from upstream. I might be willing to let myself be persuaded if there was a contributor I could trust willing to say "I'll take care of ensuring that it always work, at all times". But given the early stage of the language itself (there is basically not a single person in the world developing programs with Perlang at the moment. 😂 I haven't even myself yet gone further than the point of writing Perlang code in the Perlang-based integration tests, except for a few extremely trivial Perlang-based program(s) which I'm using sparsely) we don't really have that kind of contributors in the project yet. So... "Later" is probably the correct milestone for this for the time being. 🙂 |
Some more on this topic: since our current effort is focusing on #406, I think this will be delayed a bit. Once we have the compiled mode (first via intermediate C++ compilation, then potentially via a full LLVM backend) in place, supporting FreeBSD should be doable and not much more of an effort than "any other platform", where LLVM is supported. In other words, spending time on getting this working in our current .NET implementation is pretty much a waste, and getting it done in the #406 world is "too early" until #409 is merged. Once that is in place, supporting FreeBSD is still not easy because the Perlang interpreter/compiler still requires the .NET runtime to be able to run. We don't have an issue for "making Perlang be self-hosted" AFAIK, but we're reasonably talking about "years" rather than "months" before this can happen. Give me $1,000,000 and a research team and things might change... 😛 |
I'm not yet a millionaire 😉 but here's at least the issue now: #454. |
Moved to GitLab
Please continue to the new version of this issue here: https://gitlab.perlang.org/perlang/perlang/-/issues/272. The GitHub page you are currently reading will not contain the latest information on this issue.
Once the support for FreeBSD (either "official" support or some form of "community support") is there in the .NET platform, we should add support for it in Perlang also. The more platforms we can (easily) support, the better. 🙂
Upstream issues:
More references
The text was updated successfully, but these errors were encountered: