Skip to content

[vcpkg] Improve error messages for incomplete Mono#14948

Merged
ras0219-msft merged 4 commits intomicrosoft:masterfrom
ras0219:dev/roschuma/nuget-errors
Dec 11, 2020
Merged

[vcpkg] Improve error messages for incomplete Mono#14948
ras0219-msft merged 4 commits intomicrosoft:masterfrom
ras0219:dev/roschuma/nuget-errors

Conversation

@ras0219
Copy link
Copy Markdown
Contributor

@ras0219 ras0219 commented Dec 4, 2020

This PR fixes #14784 by providing better error information when the user has an incomplete mono installation (i.e. just mono-runtime instead of mono-complete). It also partially improves #14304 for Ubuntu 18.04 users, noting that they will need to get a newer version of mono than is available in apt.

Example 1

Before:

root@0b923fc8e7fa:/vcpkg# ./vcpkg export --nuget zlib:x86-windows
The following packages are already built and will be exported:
zlib:x86-windows
Exporting package zlib:x86-windows...
Packing nuget package...
Could not automatically acquire mono because there is no entry in /vcpkg/scripts/vcpkgTools.xml for os=linux. You may be able to install mono via your system package manager.

After

root@0b923fc8e7fa:/vcpkg# ./vcpkg.new export --nuget zlib:x86-windows
The following packages are already built and will be exported:
zlib:x86-windows
Exporting package zlib:x86-windows...
Packing nuget package...
Could not automatically acquire mono because there is no entry in /vcpkg/scripts/vcpkgTools.xml for os=linux. You may be able to install mono via your system package manager (e.g. sudo apt install mono-complete). Ubuntu 18.04 users may need a newer version of mono, available at https://www.mono-project.com/download/stable/.

Example 2

Before:

root@0b923fc8e7fa:/vcpkg# ./vcpkg export --nuget zlib:x86-windows
The following packages are already built and will be exported:
zlib:x86-windows
Exporting package zlib:x86-windows...
Packing nuget package...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> /vcpkg/downloads/22ea847d-nuget.exe
Value was null

After:

root@0b923fc8e7fa:/vcpkg# ./vcpkg.new export --nuget zlib:x86-windows
The following packages are already built and will be exported:
zlib:x86-windows
Exporting package zlib:x86-windows...
Packing nuget package...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> /vcpkg/downloads/22ea847d-nuget.exe
Failed at [../src/vcpkg/tools.cpp(236)] with message:
Could not load file or assembly 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x000d8] in <94d83393be9c41c48c8dff90a7cc668d>:0

Failed to get version of /vcpkg/downloads/tools/nuget-5.5.1-linux/nuget.exe
This may be caused by an incomplete mono installation. Full mono is available on some systems via sudo apt install mono-complete. Ubuntu 18.04 users may need a newer version of mono, available at https://www.mono-project.com/download/stable/

@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:internal labels Dec 7, 2020
@ras0219-msft ras0219-msft merged commit c2329ab into microsoft:master Dec 11, 2020
Jimmy-Hu added a commit to Jimmy-Hu/vcpkg that referenced this pull request Dec 11, 2020
[vcpkg] Improve error messages for incomplete Mono (microsoft#14948)
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
* [vcpkg] Improve error messages for incomplete Mono

* [vcpkg] Add mono upgrade notice for Ubuntu 18.04 users

* [vcpkg] Fix always failing to check CMake version due to preferring 'error' constructor in ExpectedS

* [vcpkg] Eagerly display the 'Ubuntu needs new mono' message to avoid users needing to install it twice

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vcpkg Linux nuget export failure

5 participants