Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Not able to trim packages on RHEL 6 platform #758

Closed
AmeetShinde opened this issue May 28, 2018 · 22 comments
Closed

Not able to trim packages on RHEL 6 platform #758

AmeetShinde opened this issue May 28, 2018 · 22 comments
Assignees

Comments

@AmeetShinde
Copy link

We are using following version of Microsoft.Packaging.Tools.Trimming package with the 2.1.3_RC1 build of dotnet SDK on RHEL 6.7 platform

We get the following error on dotnet build command

/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: The "TrimFiles" task failed unexpectedly. [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]
/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: System.Exception: Root package Microsoft.NETCore.App was specified but was not found in PackageDependencies [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]
/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: at Microsoft.DotNet.Build.Tasks.TrimFiles.GetPackageRoots(IDictionary`2 packages, Trimmable trimmable) [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]
/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: at Microsoft.DotNet.Build.Tasks.TrimFiles.Execute() [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]
/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]
/home/SymantecDLP/.nuget/packages/microsoft.packaging.tools.trimming/1.1.0-preview1-25818-01/build/Microsoft.Packaging.Tools.Trimming.targets(55,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/SymantecDLP/Perforce/amit_shinde_RHEL67RHDT61DEV_8991/depot/main/dev/managed/src/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor/OfficeOpenXMLContentExtractor.csproj]

@AmeetShinde
Copy link
Author

can we have this issue assigned?

@AmeetShinde
Copy link
Author

AmeetShinde commented Jun 3, 2018

3rd try, can we get this assigned?

@andrewpsy
Copy link

Getting "Root package Microsoft.NETCore.App was specified but was not found in PackageDependencies" on Mac as well (version 10.12.6).

@rubenprins
Copy link

Same on Windows with official .NET Core SDK 2.1.

@ericstj
Copy link
Member

ericstj commented Jun 7, 2018

Can you guys try the latest package from dotnet-core feed? I suspect this is due to the SDK perf work that no longer raises the PackageDependency items. That was fixed with 673cdc3.

https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.Packaging.Tools.Trimming

If this works I can push a new version to nuget.org.

@feliwir
Copy link

feliwir commented Jun 11, 2018

@ericstj Got the same issue
Tried with the latest version from the feed, getting this:

C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018: Unerwarteter Fehler bei der TrimFiles-Aufgabe. [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018: System.ArgumentNullException: Value cannot be null. [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018: Parameter name: source [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018:    at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate) [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018:    at Microsoft.DotNet.Build.Tasks.TrimFiles.Execute() [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]
C:\Users\Stephan\.nuget\packages\microsoft.packaging.tools.trimming\1.1.0-preview1-26611-01\build\Microsoft.Packaging.Tools.Trimming.targets(72,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [F:\Development\Repositories\OpenSAGE\src\OpenSage.Viewer\OpenSage.Viewer.csproj]

@ericstj
Copy link
Member

ericstj commented Jun 12, 2018

Hmm, that's actually a different stack. That shouldn't ever happen but there may have been a problem earlier on that caused it. I'm adding some logging, would you be able to rerun with diagnostic logging once this is merged: #773.

@feliwir
Copy link

feliwir commented Jun 12, 2018

@ericstj will do

@rubenprins
Copy link

@ericstj Build issues are solved for me, though (.NET Core 2.1, Windows 10).

@ericstj
Copy link
Member

ericstj commented Jun 19, 2018

Can others who experienced this issue please chime in? I’d like to understand if anyone is still reproducing and if so i’d Like to look at logs. Latest package is 1.1.0-preview1-26618-01.

Thanks!
Eric

@AmeetShinde
Copy link
Author

I am not able to find the package, can you please re-post the link

@feliwir
Copy link

feliwir commented Jun 19, 2018

@ericstj
Sorry for not answering. I resolved the error myself by setting RootPackageReference to false

@AmeetShinde
Copy link
Author

AmeetShinde commented Jun 21, 2018

@ericstj The latest package seems to be working correctly on RHEL 6.x platforms. Can you please push this package to nuget? Also by when the release version of this package will be made available?

@AmeetShinde
Copy link
Author

@ericstj Reposting it again - The latest package seems to be working correctly on RHEL 6.x platforms. Can you please push this package to nuget? Also by when the release version of this package will be made available?

@ericstj
Copy link
Member

ericstj commented Jun 25, 2018

@AmeetShinde I already pushed a newer package than the one mentioned in this thread. You can see it here: https://www.nuget.org/packages/Microsoft.Packaging.Tools.Trimming/1.1.0-preview1-26619-01.

At the moment we don't have plans to make this particular package stable, instead other members of the team have been focusing on the ILLink project which can do a lot of the same things, but has deeper knowledge of the application as it can traverse the IL itself.

I'll continue to support this package despite the pre-release tag. Let me know if the pre-release tag is a blocker for any of your scenarios and I can see about spinning this off into a separate repo where I can maintain it independently (and decide when to ship it stable).

@AmeetShinde
Copy link
Author

@ericstj Thanks for the information. One more thing, are there any license consideration for using this preview version of the package.

@ericstj
Copy link
Member

ericstj commented Jun 25, 2018

The package and source both use the MIT license regardless of preview/stable. https://github.com/dotnet/standard/blob/master/LICENSE.TXT.

@andrewpsy
Copy link

I discovered my self-contained DotNet core app doesn't work in the RHEL 6.9 environment at all so I immediately ported my code to Golang and it works just fine.
Now I am not that busy so I tried to play with the self-contained publishing and I accidentally discovered https://github.com/dotnet/corert.
Since my app is relatively simple (doesn't have a lot of dependencies) so CoreRT worked in a non RHEL 6.9 testing environment.
I will report back after testing CoreRT compiled native executable in the RHEL 6.9 environment.

@Petermarcu
Copy link
Member

@andrewpsy the runtime for RHEL 6 and RHEL 7 are different for .NET Core. What did you specify for -r when you published? You will want rhel.6-x64. You will probably also need to install some of the rpm dependencies. .NET Core wasn't initially targeted at anything below RHEL 7. It came a long a little later with some caveats.

@andrewpsy
Copy link

@Petermarcu I tried both rhel.6-x64 and rhel-x64 and none of them worked so I immediately switched to Golang after confirming a Golang compiled HelloWorld binary can be executed in the target environment.
The environment has very strict access controls so I couldn't even run tests myself let alone installing anything.

@ericstj
Copy link
Member

ericstj commented Dec 6, 2018

Trimmer has moved: #788

@ericstj ericstj closed this as completed Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants