-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[WIP - Do not merge] Generate Microsoft.NETCore.Runtime.CoreCLR nuget packages #3043
Conversation
@dotnet-bot test this please |
CPUName=$(uname -p) | ||
# Some Linux platforms report unknown for platform, but the arch for machine. | ||
if [ $CPUName = "unknown" ]; then | ||
if [ $CPUName == "unknown" ]; then |
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.
Shell portability issue. This will fail on NetBSD. ==
is extension in test
(1).
I forgot that Hopefully there will be added NetBSD platform soon too. |
..but if you like, converting it to |
build.sh
Outdated
if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then | ||
export __DistroName=ubuntu | ||
elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then | ||
export __DistroName=centos |
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.
I think @ellismg is changing this to rhel.
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.
@ellismg Let me know if rhel is the final naming for centos scenario and I will do the needful.
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.
Yes, please change __DistroName to rhel
. It should be fine to have both centos and rhel builds produce packages with the rhel.7
RID for now.
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.
At some point, we are going to need to extend these checks to bring in the version of the distro so we don't produce packages with an Ubuntu 14.04 RID when building on Ubuntu 15.10. I wouldn't let that block progress here, but we should file an issue so we know to follow up. I think @ericstj has a similar issue in CoreFX around building the "wrong" packages on Linux because today the build doesn't know about which Linux distro it is targeting and so we just produce all the packages.
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.
I think that is fine. We should have this function/capability be present in buildtools package (or akin). For me, I picked up the logic from https://github.com/dotnet/cli/blob/a7f438f85d5a68c8f4c61bb422c39bbf3c1e1822/scripts/common/_rid.sh.
Needless to say, there shouldnt be multiple copies for such a function.
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.
I agree we should unify this. I oepend dotnet/buildtools#437 to track.
Why aren't mscorlib and coreclr co-located in the package itself? |
mscorlib needs to satisfy guardrails so it must be in lib. Ref side is design time facade in portable compatibility pack (for mscorlib-based PCLs). |
I think we need it in both places then. It's impossible to use CoreCLR from a package because mscorlib needs to be next to coreclr.dll. We're hitting this right now with the CLI and the only workaround would be to xcopy those 2 dlls into the output path or edit the package cache in place (eek!) |
I see, how about both in lib? Lib+ native would bin clash. Alternatively we could have the il in lib and ni in native. |
That could work, but now thinking about it, package size might me an issue? Also we'll end up with both the ni and non ni in the output folder. Bin clashing seems better here. Another question to @gkhanna79 @schellap @jkotas would be to understand why coreclr and mscorlib need to be side by side in the same folder? Maybe the code can be changed so that it looks in the usual places (like the TPA list) for assemblies... |
@ericstj @davidfowl We dont need IL version of mscorlib since the NI can satisfy that requirement.
@ericstj Can you please elaborate on this? |
Why do we need both mscorlib.ni.dll and mscorlib.dll? mscorlib.ni.dll should be enough. If the .ni.dll suffix is a problem, we can rename it mscorlib.ni.dll to mscorlib.dll. |
Can't this be in another package? Why would that be in the runtime package... |
I have a vested interest in the raw mscorlib.dll being available from packages somehow. The code-coverage runs we do in CoreFX will not instrument code from mscorlib.ni.dll, last I checked, so being able to restore a version of the run-time that didn't use native images would be great. It may also be helpful in bootstrapping scenarios (e.g. do we know that mscorlib.ni.dll compiled for Linux would work on FreeBSD/OSX/Some Other Linux Distro?) |
@@ -0,0 +1,248 @@ | |||
{ |
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.
This is out of date with what we have in CoreFX for the RID graph, but if you do what @ericstj says above, you can delete this file.
@jkotas ni.dll isn't a problem, I was just suggesting something that would permit an entry in both lib and native without a binclash. @gkhanna79 gaurdrails is the feature in nuget that caluculates if a package is compatible with a given framework/RID pair. It looks at the compile entries in the compile graph and the runtime entries in the runtime graph and makes sure that every compile assembly has a matching runtime assembly. If not it means the package is not compatible with targeted runtime/framework. https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/CompatilibityChecker.cs
The design-time facade is in another package. On net-native (where we don't have mscorlib) there is a corresponding runtime facade. On coreclr we can't have a runtime facade since it has a real mscorlib. The right thing to do here is have the real mscorlib satisfy the gaurdrails check for the design-time facade because that accurately models what actually happens at runtime: a v1 PCL with an mscorlib reference will bind directly to the real mscorlib when running on coreclr. We can't have any other package with this mscorlib because it would either a) clash with this one or b) not clash but be unused IL. I did a quick check to see if native would satisfy the compat check and it does not. We could move the entire runtime to the lib folder which would work on windows, but not on unix since lib is filtered to just dll. |
<Version>1.0.1</Version> | ||
<RuntimeOSPath>$(OutputRootPath)CentOs.7.1.1503</RuntimeOSPath> | ||
<SkipPackageFileCheck>true</SkipPackageFileCheck> | ||
<PackageTargetRuntime>centos.7.1-$(PackagePlatform)</PackageTargetRuntime> |
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.
When you change this stuff to rhel, please use rhel.7
as the prefix in the RID. See dotnet/corefx@f71d339 for the changes I made for RHEL support in CoreFX.
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.
Fixed.
That sounds much better. |
Yeah, I'm inclined to do that. It means we'd only en up downloading the IL in the case of someone using the PCL v1 compat package (a legacy package) or directly referencing it. |
4a212a9
to
1293e43
Compare
@ellismg @ericstj Incorporated PR feedback. For now, I am packaging both mscorlib.dll (in lib) and mscorlib.ni.dll (next to CoreCLR). I would like to keep this change moving unblocked, so we should figure out how to remove the IL version of mscorlib and get nuget railguard verification still working. |
865b61b
to
a8fbc6c
Compare
@mmitche Since we now build mscorlib.dll on the respective OS, as part of this change, I have updated the CI groovy script to no longer build non-Windows mscorlib on Windows. PTAL and let me know if anything else is missing/needs to be done. |
Theoretically, CoreCLR and mscorlib could be in different folders and made to work. However, the semantic to keep in mind is that, logically, CoreCLR and mscorlib.dll are a single artifact - they just happen to live in managed and native implementations. Mscorlib is the managed part of the runtime though, due to historical reasons, has had non-runtime specific FX code as well. To maintain the above semantic, it is important that they are packaged together and deployed together, which has a good side-effect of them being next to each other and also results in Mscorlib's path on TPA to be derived from CoreCLR's path. |
a8fbc6c
to
78e69d3
Compare
I see that CentOS CI invoked the build as " + ./build.sh skipmscorlib verbose checked x64" from a custom shell script. @mmitche Is this CI specific shell script or generated in the repo? I need to have it no longer pass skipmscorlib argument for non-Windows platforms. |
@mmitche The Windows build failed due to the following: d:\j\workspace\dotnet_coreclr\debug_windows_nt_bld_prtest>build.cmd debug x64 linuxmscorlib This is inspite of my changes in netci.groovy. Is there any other place I need to make change to? |
The groovy changes in a PR don't impact that PR. You should do @dotnet-bot test ci please to ask Jenkins to generate the new job definitions, inspect them for correctness and then merge the PR. The changes will be picked up for future jobs. |
(Note that because of how the groovy stuff works, it's best to pull the changes into a separate PR and stage your changes so that you can update the CI definitions after updating the product to ensure you don't break the world) |
d78ce32
to
8ab8ba3
Compare
Once this goes through, we should also fix corefx CI to start using mscorlib native image on Unix (right now, the script is deleting it - https://github.com/dotnet/corefx/blob/master/run-test.sh#L169 - it was workaround for Windows native image getting picked up on Unix by accident). |
64067d8
to
78bda72
Compare
@piotrpMSFT @Sridhar-MS What is the latest version of CLI that works on CentOS? Does restore operation work on CentOS? |
build.cmd
Outdated
if /i "%1" == "clean" (set __CleanBuild=1&shift&goto Arg_Loop) | ||
|
||
REM CI_TODO: Remove this once CI stops building mscorlib for non-Windows OS on Windows. | ||
REM Need to keep FreeBSD until .NET CLI Exists for it. |
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.
I would really like to keep the ability to cross compile mscorlib for other OS's on Windows. We support this in CoreFX for the rest of the managed code and it's very useful for both bootstrapping and local development.
cc85cb9
to
3190154
Compare
3190154
to
f025f9c
Compare
@dotnet-bot test Ubuntu x64 Checked Build and Test |
Generate Microsoft.NETCore.Runtime.CoreCLR nuget packages
They are generated for Windows, Linux (Centos, Debian, Ubuntu) and OSX.
SOS is placed next to CoreCLR.
@weshaggard @ericstj PTAL. Also, the following are outstanding: