-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix alpine build #106
Fix alpine build #106
Conversation
With $ git clone https://github.com/kekyo/IL2C --single-branch --depth 1 --branch devel
$ cd IL2C
$ ./build-runtime.sh
$ dotnet test il2c.sln With this patch it succeeds the build but fails when "running" the tests because I don't have "mono" installed. We could update MSTest package which supports modern .NET, or perhaps better yet, switch tests to xunit or nunit (since .NET teams are using xunit as well rather than MStest.. 🙂). |
<_runtime>$(NETCoreSdkPortableRuntimeIdentifier)</_runtime> | ||
<_runtime Condition="'$(_runtime)' == ''">$(NETCoreSdkRuntimeIdentifier)</_runtime> | ||
<MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(_runtime)</MicrosoftNetCoreIlasmPackageRuntimeId> |
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.
portable runtime identifer $(NETCoreSdkPortableRuntimeIdentifier)
is a distro-agnostic ID which we need forMicrosoftNetCoreIlasmPackageRuntimeId
.non-portable runtime identifier $(NETCoreSdkRuntimeIdentifier)
on the other hand, is distro-aware. For instance, if the SDK was built with -p:PortableBuild=false. This is the case when some distros (like RHEL, Fedora etc.) build the SDK in their packages. But the one provided by .NET team is always portable.
MicrosoftNetCoreIlasmPackageRuntimeId
requires a portable RID, since the packages are published by .NET team for only portable flavors. Since NETCoreSdkPortableRuntimeIdentifier
is new in .NET 5, if we are building this project on, e.g. Fedora, and we installed dotnet-sdk 3.1 package from the distro, we would need to pass the correct portable RID explicitly dotnet test il2c.proj -p:MicrosoftNetCoreIlasmPackageRuntimeId=linux-x64
in such environment (I think we can live with that since it's not a very common setup and only effects older version of runtimes). Otherwise if we are using SDK 3x provided by .NET team, it will return the correct value of portable RID (linux-x64
) from NETCoreSdkRuntimeIdentifier
.
(Thank you PR, I'm reading now...)
I understood after last merged my PR commit, I applied same patch :)
I think it's a good change. I don't know, why the scripts in the (To be honest, when I saw that code, I thought it was dirty hardcoding :) I'm trying to figure out if I should leave that hardcoding in place when |
Oh... I forgot that the mono runtime was installed. Is mono used because of |
(I agree that this code is for test projects, so it may not make sense to ponder it) It's a very ugly and dirty method :) : If |
After .NET 3.1, three repositories were combined (coreclr, corefx and core-setup) into one (runtime). After that there was a series of consolidation work done in runtime repo. The whole RID stuff is now calculated in the runtime in one place https://github.com/dotnet/runtime/blob/53e8c7/Directory.Build.props#L157. It is to support platforms, which are new and don't have the official identifier assigned. To port runtime to a new platform, we first define the _DistroRID in runtime, OSPlatform and so forth to be able to compile stuff before SDK can be ported. The stuff in IL SDK .targets was a leftover of that consolidation work, which is used in the fallback path. IL SDK was primarily created by runtime team for a shipping assembly: System.Runtime.CompilerServices.Unsafe. This is a real assembly part of Shared Framework (sfx). The said SDK was then used in runtime for test projects like ilverify tests etc. It was also published to nuget.org for public consumption, but there aren't many consumers of it yet, besides the runtime repository itself. I found a bug in Alpine Linux (my personal desktop environment installed on a laptop) when testing out IL2C's devel branch, so I proposed a change upstream (dotnet/runtime#60400). It is approved and will merge soon. This PR is basically pieces took from that PR. :) For public consumption, it makes sense to use |
I encounted tfm specific bugs on porting from Azure Pipeline to GitHub Actions working (#107)... (Maybe bit relating this topic) Could you wait continue reviewing? I will back to discussion immediately. |
#107 closed with some regression errors on ubuntu environment. But maybe ready to build-and-test on linux ;) I will approve your opinion using Is there anything else? I will merge PR if not. |
It looks like a netfx specific project is requiring mono. When I run
but if I pass --framework, There are other test failures, which we can later fix. Some failures are funny as
From my point of view, it is ready. :) |
I recommend it, because I found difference regression test results between net462 and net5.0. I will suppress net462 regression test in future commit.
I feel it too, (unverified) I think the unicode bytes was applied with ansi (standard) C string functions...? ( swprintf() --> sprintf() ) |
Changes in
tests/IL2C.Core.Test.Common/ILSupport.Standard.targets
:/
character as a filepath and gives errors where options are passed. Replacing/
with-
fixes the problem.NETCoreSdkPortableRuntimeIdentifier
.NETCoreSdkRuntimeIdentifier
.Change in
tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj
was based on feedback I got upstream. This allows us to use.entrypoint
in IL if we ever wanted.