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

Packaging fails after updating dotnet sdk to 2.1.403 #84

Closed
matthid opened this issue Oct 5, 2018 · 3 comments
Closed

Packaging fails after updating dotnet sdk to 2.1.403 #84

matthid opened this issue Oct 5, 2018 · 3 comments

Comments

@matthid
Copy link

matthid commented Oct 5, 2018

In particular the build fails since fsprojects/FAKE@d0cda20 and the only relevant change there seems to be the 402 -> 403 update (which I have confirmed locally).

The issue seems to happen if you use a "local" dotnet cli installation via script (not via installer) combined with a global installation of a different version.

Reproducing the issue

Repro:

  1. Uninstall all dotnet SDK versions
  2. Install 2.1.402 (which is the version installed globally on appveyor at the time of writing)
  3. Run the following code
git clone https://github.com/fsharp/FAKE.git
git checkout 649cb005ffe3c7438167d6439bff822cdc1fdac9
dotnet tool install -g fake-cli
fake build -st DotNetCoreCreateDebianPackage

The script will download and install a local "dotnet sdk" with the version 2.1.403 (as it notices that only 2.1.402 is installed globally). After downloading it will invoke the msbuild target (you can run the printed msbuild command standalone)

Expected result

works

Actual result

  Creating DEB package 'C:\proj\FAKE\src\app\fake-cli\bin\Release\netcoreapp2.1\linux-x64\fake-cli.5.8.3.linux-x64.deb' from folder 'bin\Release\netcoreapp2.1\linux-x64\publish\'
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018: The "DebTask" task failed unexpectedly. [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Packaging.Targets.IO.NativeMethods' threw an exception. ---> System.IO.FileLoadException: Could not load liblzma. On Linux, make sure you've installed liblzma-dev or an equivalent package. [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.NativeMethods..cctor() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    --- End of inner exception stack trace --- [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.NativeMethods.lzma_easy_encoder(LzmaStream& stream, UInt32 preset, LzmaCheck check) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.IO.XZOutputStream..ctor(Stream s, Int32 threads, UInt32 preset, Boolean leaveOpen) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Packaging.Targets.DebTask.Execute() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]
C:\Users\matth\.nuget\packages\packaging.targets\0.1.48\build\Packaging.Targets.targets(90,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\proj\FAKE\src\app\fake-cli\fake-cli.fsproj]

Workaround

Do not use locally installed dotnet cli version?

matthid added a commit to fsprojects/FAKE that referenced this issue Oct 5, 2018
@matthid
Copy link
Author

matthid commented Apr 22, 2019

I just hit this again. Using a global installation still is the workaround...

@qmfrederik
Copy link
Collaborator

@matthid That's an interesting corner case. I've released an update a couple of days ago which packages dotnet-deb as a global .NET Core CLI tool.

Can you give that a try and let me know if it fixes the issue? If not, there are some other things we can try.

@qmfrederik
Copy link
Collaborator

I'm closing this as we now ship this as a global tool. Let me know if this is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants