-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Enable building all of corefx with an "unknown" Unix #4402
Conversation
After all of the shim work that's been done, the vast majority of corefx assemblies now are either platform-agnostic or have a Windows build and a Unix build, without further specialization based on OS in managed code. We do still have a few such assemblies, though (and this is unlikely to change any time soon): - System.Diagnostics.Process - System.IO.FileSystem.Watcher - System.Net.NetworkInformation - System.Runtime.InteropServices.RuntimeInformation As a result, attempting to do a full build for Unix targets other than Linux or OS X currently results in compilation failures. This commit adds a new TargetsUnknownUnix property to the build as well as stub implementations that throw PlatformNotSupportedException for all of the missing functionality that causes such compilation errors. With this change, doing ```build.cmd /p:SkipTests=true /p:OSGroup=FreeBSD" now completes successfully, as does ```build.cmd /p:SkipTests=true /p:OSGroup=Stephenix```.
<TargetsLinux Condition="'$(OSGroup)' == 'Linux'">true</TargetsLinux> | ||
<TargetsOSX Condition="'$(OSGroup)' == 'OSX'">true</TargetsOSX> | ||
<TargetsFreeBSD Condition="'$(OSGroup)' == 'FreeBSD'">true</TargetsFreeBSD> | ||
|
||
<TargetsUnix Condition="'$(TargetsLinux)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsFreeBSD)' == 'true'">true</TargetsUnix> | ||
<TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(OSGroup)' != 'FreeBSD' AND '$(OSGroup)' != 'Linux' AND '$(OSGroup)' != 'OSX'">true</TargetsUnknownUnix> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indentation looks off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will fix.
LGTM. When can I get a Stephenix drop to try this out? 😃 |
😄 |
Thank you @stephentoub. I am in contact with people on FreeBSD IRC channel to seek help with FileSystem stuff. Once I get somewhere, I will send a PR. :) |
Just to be sure; at the moment (aside from making sure all the required shims are available) we have eight |
NetworkInformation stuff looks good to me. FWIW I think a lot of the OSX implementation can eventually be shared for BSD platforms, but it will require some more refactoring, and most importantly someone who is familiar with those 😄 |
Enable building all of corefx with an "unknown" Unix
LGTM. At first glance I couldn't figure out what causes TargetsUnix=true in your case of OSGroup=Stephenix? Is that because you actually build on a flavor of unix? |
Thanks, Wes.
I changed it to say that it TargetsUnix if it doesn't TargetsWindows: |
…uild Enable building all of corefx with an "unknown" Unix Commit migrated from dotnet/corefx@e678832
After all of the shim work that's been done, the vast majority of corefx assemblies now are either platform-agnostic or have a Windows build and a Unix build, without further specialization based on OS in managed code. We do still have a few such assemblies, though (and this is unlikely to change any time soon):
As a result, attempting to do a full build for Unix targets other than Linux or OS X currently results in compilation failures. This commit adds a new TargetsUnknownUnix property to the build as well as stub implementations that throw PlatformNotSupportedException for all of the missing functionality that causes such compilation errors.
With this change, doing
build.cmd /p:SkipTests=true /p:OSGroup=FreeBSD"
now completes successfully, as doesbuild.cmd /p:SkipTests=true /p:OSGroup=Stephenix
.cc: @ellismg, @nguerrera, @weshaggard, @mellinoe