Open ghuntley opened 9 years ago
There seems to be agreement as far as https://github.com/dotnet/corefx/issues/1576 is concerned.
When we also have a decision on https://github.com/dotnet/corefx/issues/1625 we should be able to start shipping some code.
Agreement on dotnet/runtime#14536 has been reached by the portteam, unless MSFT chooses otherwise it will be FreeBSD
. Issue dotnet/corefx#1999 will potentially be the issue that introduces the definition into the public API.
Agreement on dotnet/runtime#14536 has been reached by the portteam, unless MSFT chooses otherwise it will be FreeBSD
If I read that right, this means that when https://github.com/dotnet/corefx/pull/1999 is merged, we can consider this MSFT approving of the new public API, and can therefore press forward on the remaining issues with regular pull-requests without need for MSFT approval.
If so, that sounds good to me.
Next steps as per https://github.com/dotnet/corefx/pull/1999#issuecomment-111279577 are:
- The "FreeBSD port team" continues their work to get a FreeBSD version of CoreFX produced (tracked by dotnet/corefx#1626).
- The port team brings up enough of the CoreFX and CoreCLR stack on FreeBSD such that we can start running the CoreFX unit tests on FreeBSD.
- The tests reach some minimal quality level. I don't know exactly what this looks like yet, but I expect it means something like a majority of the tests pass. Ideally we would not have a bunch of specific tests disabled for only FreeBSD (compared to Linux and OSX, we wouldn't want to hold FreeBSD to a higher standard than the other *NIX platforms we have there).
- Working with the FreeBSD port team, the CoreFX team gets the CoreFX tests added to our CI system running on FreeBSD.
- Discuss merging a PR based for issue dotnet/runtime#14536, which adds the property.
That sounds like a fully reasonable plan to me.
Okay, then let's start the work on getting corefx to work.
First obstacle in building corefx on FreeBSD seems to be mono. The build-script insists version 4.1 is required. @ajensenwaud did some work on this on the Frankfurt-host, but I'm not sure how complete it is.
I'll queue a build for now and see what the output looks like.
Edit: The (mono) build crashes with the following kicker at the end:
Making all in mini
make[1]: "/usr/home/josteink/mono/mono/mini/Makefile" line 2906: warning: duplicate script for target "%.exe" ignored
make[1]: "/usr/home/josteink/mono/mono/mini/Makefile" line 2899: warning: using previous script for "%.exe" defined here
CC genmdesc-genmdesc.o
In file included from genmdesc.c:9:0:
mini.h:17:34: fatal error: ./mono/metadata/loader.h: Too many levels of symbolic links
#include <mono/metadata/loader.h>
^
compilation terminated.
*** Error code 1
Stop.
make[1]: stopped in /usr/home/josteink/mono/mono/mini
*** Error code 1
Stop.
First obstacle in building corefx on FreeBSD seems to be mono
FWIW, I personally don't think this is the first obstacle. There are two build related issues:
(1) is critical, and is I believe what this issue is meant to be about. (2) is very nice to have, but lack of it doesn't prevent the creation of a great system for running managed code on FreeBSD.
You're of course free to prioritize however you see fit, but my recommendation would be to focus on (1) rather than (2).
Note that we still have issues building corefx on Linux and building it on OSX, such that our CI system builds the assemblies for those platforms on Windows; it then shuttles the resulting assemblies over to the target platform to execute the tests.
That's fair enough. I just assumed that it would be easier to get general FreeBSD platform support baked into corefx if we could actually build it ourselves on FreeBSD.
I'll make do with Windows-initiated building for now and attempt to ninja together a build-configuration.
@josteink btw. corefx should now build on Mono 4.0.1.44.
@akoeplinger Nice. That leaves me some hope we can get it running on FreeBSD too :)
Good points. However if we really want corefx to be part of the FreeBSD environment, we really need it to be able to compile from source to get it into the Ports system.
I did hear that Mono 4.0.1.44 fixes a lot of these issues but have not had time to play with it yet. I know the ports team are updating the port Makefile as well as we speak with a new patch.
On 12 Jun 2015, at 20:21, Stephen Toub notifications@github.com wrote:
First obstacle in building corefx on FreeBSD seems to be mono
FWIW, I personally don't think this is the first obstacle. There are two build related issues:
Building assemblies that work correctly on FreeBSD Building those assemblies on FreeBSD (1) is critical, and is I believe what this issue is meant to be about. (2) is very nice to have, but lack of it doesn't prevent the creation of a great system for running managed code on FreeBSD.
You're of course free to prioritize however you see fit, but my recommendation would be to focus on (1) rather than (2).
Note that we barely have corefx building-on-Linux and building-on-OSX, such that our CI system builds the assemblies for those platforms on Windows; it then shuttles the resulting assemblies over to the target platform to execute the tests.
— Reply to this email directly or view it on GitHub.
Yes, I'm in no way disagreeing... being able to build corefx on Linux, OSX, and FreeBSD is important. I'm simply suggesting that from a priority perspective it's more important to be able to actually run corefx on Linux, OSX, and FreeBSD. :wink: If both can be worked on in parallel, all the better.
@ghuntley, would be super :cool: if we have a markdown task checklist outlining what what is remaining:
- [x] task 1
- [ ] task 2
- [ ] task 3
renders as:
This will probably encourage others to score those feats and FreeBSD support will land rather sooner than anticipated! :sunglasses:
To my knowledge the following pieces of work in CoreFX are required for FreeBSD support:
13 Assemblies do not compile on their own and need FreeBSD specific changes. Mostly the Interop pieces that already exist for Linux/OS X (order by the occurrence in the build output):
System.Private.URI
(done, PR dotnet/corefx#2032 merged)System.Console
(done, PR dotnet/corefx#2031 merged)System.Diagnostics.Debug
(done, PR dotnet/corefx#2039 merged)System.Diagnostics.Process
(discussion dotnet/corefx#2070, PR dotnet/corefx#3257)System.IO.Compression.ZipFile
(done, PR dotnet/corefx#2041 merged)System.IO.FileSystem.DriveInfo
(discussion dotnet/corefx#2526, PR dotnet/corefx#2606)System.IO.FileSystem.Watcher
(discussion dotnet/corefx#2046, PR dotnet/corefx#3257)System.IO.FileSystem
(done, PR dotnet/corefx#2049 merged)System.IO.MemoryMappedFiles
(discussion dotnet/corefx#2527, PR dotnet/corefx#3143)System.IO.Pipes
(discussion dotnet/corefx#2528, PR dotnet/corefx#2974)System.Net.NameResolution
(discussion dotnet/corefx#2988, PR dotnet/corefx#3471)System.Security.Cryptography.Hashing.Algorithms
(done, PR dotnet/corefx#2040 merged)System.Security.SecureString
(done, PR dotnet/corefx#2039 merged)System.Runtime.Environment
(blocked by dotnet/corefx#1999 )System.Runtime.InteropServices.RuntimInformation
(done, PR dotnet/corefx#2068 merged)I will try to update that list based on PRs opened and merged.
FYI: PR dotnet/corefx#2039 merged
Just trying to be ahead of the curve here... How do we plan to implement System.IO.FileSystem.Watcher
?
Iirc FreeBSD has no inotify
such as Linux and Windows does (which is also why there is no Dropbox last time I checked). Will this be a potential source of trouble coming our way? Or does anyone have an idea for how to work around this?
I suggest we stub that out for the moment and throw a PlatformNotSupportedException as Stephen Toub suggested in the other topic (https://github.com/dotnet/corefx/pull/2021#issuecomment-111602342). Then we have at least a complete set of assemblies and we can continue to work on that particular issue without blocking further steps.
Would you mind opening a separate issue for that?
Let's move System.IO.FileSystem.Watcher
discussions to dotnet/corefx#2046
Guys is there any such blocker for System.Diagnostics.Process
?
@jasonwilliams200OK added FreeBSD to S.RT.I.RI early this morning which was merged but the FreeBSD tests within CheckPlatformTests
had to be backed out until dotnet/buildtools
is updated.
[Fact,PlatformSpecific(PlatformID.FreeBSD)]
tests to CheckPlatformTests - see https://github.com/dotnet/corefx/pull/2068#discussion_r32570244 and https://github.com/dotnet/corefx/pull/2068#discussion_r32570244public static OSPlatform FreeBSD
to https://github.com/dotnet/corefx/pull/2068@jasonwilliams200OK there were some discussions last night about System.Diagnostics.Process
in gitter which have been formalized into https://github.com/dotnet/corefx/issues/2070
@ghuntley, thanks. I actually read those messages. System.Diagnostics.Process
is a tricky one. AFAIK, io.js team had similar challenges with FreeBSD process management. Mono team has probably nailed it, so lets hope if @akoeplinger and co. could enlighten us on this matter? :)
System.IO.FileSystem.DriveInfo
As discussed in the gitter, For this one I tried looking into basic usage of getmntinfo
:
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
#include <stdio.h>
int main() {
struct statfs *mntbuf;
int mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
for( int i = 0; i < mntsize; i++ ) {
printf("%s\n", mntbuf[i].f_mntonname);
}
}
Running that sample yielded this output:
$ ./a.out
/
/dev
/tmp
/usr/home
/usr/ports
/usr/src
/var/crash
/var/log
/var/mail
/var/tmp
/dev/fd
/usr/compat/linux/proc
/proc
$
So it seems it does what we need. The question is, should we do any type of filtering on the results?
Looking at the "intent" of the DriveInfo
object, coming from the Windows world of .NET it has often been to enumerate the available locations to store or retrieve files (C:
, D:
, etc). But when using Unix hierarchical file-systems, returning /
would be adequate to cover those needs.
So what should we return? What would be useful? Should even consider it being useful or not?
The Linux-version just dumps everything, except things set to be ignored:
I tried putting in the following filter, but it didn't really change anything in terms of output:
if ((mntbuf[i].f_flags != MNT_IGNORE)) {
printf("%s\n", mntbuf[i].f_mntonname);
}
Any opinions?
@josteink, great diggings! Based on https://github.com/dotnet/corefx/issues/815#issuecomment-113825960 and https://github.com/dotnet/corefx/issues/1729, I think we should collaborate with @sokket to come up with a solution with works across different Unices.
I have a version running on OSX that uses getmntinfo and statfs to get information about each mount point, which seems like the most logical mapping from the Windows Drive concept. I'll double check that the function and struct definitions on OSX match the FreeBSD definitions and, if so, my commit for OSX will work for BSD as well.
I'll be sure to add you to my PR @josteink
Sounds good. Thanks for the heads up and thanks for giving FreeBSD some love too.
I looked into some basic pinvoke for these functions, and it seems like we need to do all the marshalling and conversions ourselves, so if anyone else has already put in the effort, who am I to say no? ;)
No problem...looks like the main difference was with the struct declarations; since we'll probably hit this more in the future, I'm doing some refactoring that will allow us to share a lot of the PInvoke signatures. I'll add a bigger description in my PR (today or tomorrow, based on how the test run) but I basically added the PInvoke signatures and struct signatures for FreeBSD (based on the headers I found online) and it compiles. I've tested it on Mac so it should (in theory...) work on FreeBSD since it's just a struct declaration change, but your milage may vary :). If it doesn't, you'll have the DriveInfo class and PInvokes 99% of the way there and will just require some tweaking based on FreeBSD nuances.
Excellent news @sokket. I've created you an account on the machine the port-team uses for development, it's european based but it's always on and has heaps of memory and processing power. Hopefully this will help out and remove some of the friction when working w/FreeBSD.
# ssh sokket@freebsd-frankfurt.zbsd.org
Password authentication is disabled, use one of your keys.
@josteink see also issue: https://github.com/dotnet/corefx/issues/815 (System.IO.FileSystem.DriveInfo for Mac/FreeBSD)
Are there any updates? Did anybody implement the remaining assemblies on FreeBSD?
I've been busy attending my new baby, haven't had time for any coding anywhere.
I've suspected that issues like these have been lying dormant and I guess this confirms it to a certain extent.
For the assemblies that are still not implemented, I linked the "how to implement"-issue in the list above. I hope that helps coordinating the effort to get these remaining assemblies implemented.
I must admit I was having difficulties keeping track of what we have done and where, so that's definitely a good move. Good job :)
Where do I find that? Would be grat to get the remaining assemblies implemented.
On 25/07/15 22:10, Jan Henke wrote:
For the assemblies that are still not implemented, I linked the "how to implement"-issue in the list above. I hope that helps coordinating the effort to get these remaining assemblies implemented.
— Reply to this email directly or view it on GitHub https://github.com/dotnet/corefx/issues/1626#issuecomment-124838781.
This comment here: https://github.com/dotnet/corefx/issues/1626#issuecomment-111800540
I am right now waiting for the native shims to be finished, as these should take over most of the work for getting these assemblies working on FreeBSD.
@nguerrera would be great if you can keep us posted on the progress. :)
Update:
@janhenke confirmed that with https://github.com/dotnet/corefx/pull/2974 merged, System.IO.Pipes
builds on FreeBSD! :sunglasses:
Update:
dotnet/corefx#2527 closed, System.IO.MemoryMappedFiles
builds on FreeBSD.
Thanks @janhenke for the confirmation!
Thanks to the shims approach, it just comes down to make sure the shims compile on FreeBSD. Thankfully that makes life a lot easier. :)
dotnet/corefx#3257 should bring us both System.Diagnostic.Process
and System.IO.FileSystem.Watcher
leaving just System.Net.NameResolution
unresolved. (I will check the mentioned two assemblies once the PR is merged and works on FreeBSD)
dotnet/corefx#3471 should bring us System.Net.NameResolution
and complete the list above.
dotnet/corefx#3471 was just merged :)
@sokket, thanks for the update. I built master (f467911) on FreeBSD using this guide: https://gist.github.com/jasonwilliams200OK/6efa7907e66275df2d24. Current blocker is https://github.com/dotnet/buildtools/issues/292, which is fixed in upstream but waiting for next buildtools roll-out. :)
Update: new buildtools with fix for dotnet/buildtools#292 has landed in CoreFX master. Next stopper from buildtools is https://github.com/dotnet/buildtools/issues/300: missing OS specific tool to be able to run the tests.
@janhenke, you have marked System.Diagnostics.Process
(#2070) and System.IO.FileSystem.Watcher
(#2046) as done; but they are neither implemented nor do they compile on FreeBSD. Have you actually verified the list by compiling the managed code?
Based on my recent experience with commit 60c78da3c918b0d256cc1f878de06d351dbe3342 (see msbuild.log), following assemblies do not compile:
As far as I recall I verified the associated shims compile. Since the managed code should be free of FreeBSD specific code. Those shims you mention should have been shimed out with the PRs linked above.
But I have also run a full compile in between. At the very least System.Diagnostics.ThreadInfo
and System.IO.FileSystemWatcher
did compile. So something must have regressed.
Those shims you mention should have been shimed out with the PRs linked above.
Actually, PR https://github.com/dotnet/corefx/pull/3257 is not related to shim. There is still some PAL code within the managed projects (the old approach), therefore it is required to build managed assemblies to be absolutely sure.
Actually, PR dotnet/corefx#3257 is not related to shim.
I disagree. It is refactoring the P/Invoke code to the System.Native shim. Also as I edited above, I am recalling at least some of the assemblies compiled in between.
I disagree
https://github.com/dotnet/corefx/pull/3257/files: see the instances of .Unix.cs
and .Linux.cs
for System.Diagnostics.
. Note that .OSX.cs
is untouched.
It is refactoring the P/Invoke code to the System.Native shim
Yes it does refactor some common helpers under System.Native
, but not System.Diagnostics.*
et al.
Even when these assemblies are only P/Invoking to System.* libs, there may still be FreeBSD work required for some of them, e.g. System.Diagnostics.Process and System.IO.FileSystem.Watcher. They are using functionality specific to Linux and OS X, and we don't plan to try to abstract that behind native shims. The goal of the shims isn't to end up with a single managed binary for Unix, though that's a very nice property when it comes from the work; the primary goal is to avoid ABI differences that cause fragility. I expect at least a handful of assemblies will continue to have Linux/OS X specific binaries, where a FreeBSD binary would also be needed.
FYI, there are no corefx assemblies named System.Diagnostics.ProcessManager, System.Diagnostics.ThreadInfo, System.IO.FileSystemWatcher, or System.Net.SocketAddress. Those are types in other assemblies.
Updated proposal from 2017/9
Proposal (by @karelz - https://github.com/dotnet/corefx/issues/1626#issuecomment-329840518) will be updated in top-post based on further discussion and proposal changes.
We discussed community-driven port for FreeBSD with @RussellHaley (from FreeBSD community) and @wfurt (from .NET Core team) who both expressed interest in the work. Here's a plan proposal we put together (feedback / suggestions are welcome):
Operation principles:
If anyone is interested in helping, please let us know here. We can easily distribute work items from [2] & [3] above once we are far enough with [1].
Original proposal from @ghuntley from 2015/5
This issue is to discuss unit(s) of work to actually produce FreeBSD assemblies for corefx.
Related issue(s)
/cc: @janhenke @josteink