Skip to content
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

[SBRP] Add netcoreapp3.0 to 4.7.0 System.Security.Permissions #2438

Closed
MichaelSimons opened this issue Sep 8, 2021 · 4 comments · Fixed by dotnet/source-build-reference-packages#223
Assignees
Labels
area-prebuilts Reducing the number of prebuilt packages in the tarball
Milestone

Comments

@MichaelSimons
Copy link
Member

This is needed for the following runtime error:

  /repos/tarball1/src/runtime.c300b096419523024f2b807ec9db3c2d91df0298/artifacts/source-build/self/package-cache/microsoft.dotnet.cilstrip.sources/6.0.0-beta.21430.1/contentFiles/cs/netstandard2.0/Mono.Cecil/SecurityDeclaration.cs(54,10): error CS0433: The type 'PermissionSet' exists in both 'System.Security.Permissions, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/repos/tarball1/src/runtime.c300b096419523024f2b807ec9db3c2d91df0298/artifacts/source-build/self/src/src/tasks/ILStripTask/ILStrip.csproj]
  /repos/tarball1/src/runtime.c300b096419523024f2b807ec9db3c2d91df0298/artifacts/source-build/self/package-cache/microsoft.dotnet.cilstrip.sources/6.0.0-beta.21430.1/contentFiles/cs/netstandard2.0/Mono.Cecil/SecurityDeclaration.cs(42,3): error CS0433: The type 'PermissionSet' exists in both 'System.Security.Permissions, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/repos/tarball1/src/runtime.c300b096419523024f2b807ec9db3c2d91df0298/artifacts/source-build/self/src/src/tasks/ILStripTask/ILStrip.csproj]

The PermissionSet class was moved from System.Security.Permissions.dll to System.Runtime.dll. The two referenced assemblies are not coherent.

When building in the tarball the following assemblies are used:
/reference:/repos/tarball1/src/runtime.c300b096419523024f2b807ec9db3c2d91df0298/artifacts/source-build/self/package-cache/system.security.permissions/4.7.0/ref/netstandard2.0/System.Security.Permissions.dll
/reference:/repos/tarball1/.dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0-rc.2.21423.6/ref/net6.0/System.Runtime.dll

When building the runtime repo outside of source-build, a netcoreapp3.0 version of System.Security.Permissions.dll is used.

A workaround for the ILStrip.csproj is to exclude it from source-build since it does not appear to be required.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@uweigand
Copy link

Hi @MichaelSimons @dseefeld @akoeplinger this is now causing build failures with source-build on s390x. The problem is that we're a Mono-only platform, and therefore need to enable building Mono even with source-build (dotnet/runtime#58553) - on other platforms Mono is completely disabled with source-build.

But this means that right now we're not just building the Mono runtime, but also the Mono packages from src/mono/nuget/mono-packages.proj, which include Microsoft.NET.Runtime.MonoTargets.Sdk, which packages ILStrip.

However, after applying 0001-Exclude-ILStrip-from-source-build.patch the ILStrip project is no longer built with source-build, and therefore the packaging fails due to missing files.

Now I'm wondering what the way forward is here: it seems in the meantime the underlying problem has been fixed. Is the plan to now revert that patch and build ILStrip again? Otherwise, it seems we also need to disable the packaging with source-build.

@MichaelSimons
Copy link
Member Author

MichaelSimons commented Sep 21, 2021

@uweigand - the patch was a temporary workaround until this issue was fixed. I am will try removing the patch now that 4.7.0 was added to the source-build-reference-packages. The result is that IlStrip should be part of source-build again.

@uweigand
Copy link

@uweigand - the patch was a temporary workaround until this issue was fixed. I am will try removing the patch now that 4.7.0 was added to the source-build-reference-packages. The result is that IlStrip should be part of source-build again.

Excellent, thanks! I can confirm that removing the patch makes the runtime source-build go through successfully for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-prebuilts Reducing the number of prebuilt packages in the tarball
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants