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

vcpkg.exe cannot determine the version of the downloaded nuget.exe. #38940

Closed
kazssym opened this issue May 25, 2024 · 11 comments · Fixed by microsoft/vcpkg-tool#1451 or #39836
Closed
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof

Comments

@kazssym
Copy link

kazssym commented May 25, 2024

Describe the bug
vcpkg.exe cannot determine the version of the downloaded nuget.exe and stops its execution.

Environment

  • OS: Windows 11 Pro 22H2
  • Compiler: Visual Studio Community 2022 17.10.0

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg upgrade --no-dry-run
  2. See error
…(snip)
A suitable version of nuget was not found (required v6.10.0) Downloading portable nuget 6.10.0...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe->F:\vcpkg\downloads\71d7307b-nuget.exe
Downloading https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe
error: nuget (F:\vcpkg\downloads\tools\nuget-6.10.0-windows\nuget.exe) produced unexpected output when attempting to determine the version:
NuGet バージョン: 6.10.0.107
使用方法: NuGet <command> [args] [options]
…(snip)

Expected behavior
vcpkg.exe would continue the upgrade process.

Failure logs
vcpkg.exe did not provide any log locations.

Additional context
My environment uses the Japanese locale. nuget.exe 6.2.1 produced NuGet Version: 6.2.1.2 but 6.10.0 produces NuGet バージョン: 6.10.0.107. The localized output seems to be the cause.

@JonLiu1993 JonLiu1993 added the category:question This issue is a question label May 27, 2024
@JonLiu1993
Copy link
Member

JonLiu1993 commented May 27, 2024

You should use ./vcpkg upgrade --no-dry-run instead of ./vcpkg install upgrade --no-dry-run,
Can you directly use the command https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe to download nuget?

@kazssym
Copy link
Author

kazssym commented May 29, 2024

You should use ./vcpkg upgrade --no-dry-run instead of ./vcpkg install upgrade --no-dry-run,
Can you directly use the command https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe to download nuget?

The command was my mistake. It is indeed .\vcpkg.exe upgrade

@kazssym
Copy link
Author

kazssym commented May 29, 2024

You should use ./vcpkg upgrade --no-dry-run instead of ./vcpkg install upgrade --no-dry-run,
Can you directly use the command https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe to download nuget?

nuget.exe was actually downloaded under downloads\tools. The major difference between the two nuget.exe versions is no "version" strong is found in the 6.10 output.

@DimRochette
Copy link

DimRochette commented May 29, 2024

Same issue with a French OS/Version
Nuget tool is in french now and probably error parsing version

Nuget 6.2 (working)

NuGet Version: 6.2.1.2
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.

Nuget 6.10 (failed)

NuGet Version : 6.10.0.107
utilisation : NuGet <command> [args] [options]
Tapez 'NuGet help <command>' pour obtenir de l'aide sur une commande spécifique.

@kazssym
Copy link
Author

kazssym commented May 31, 2024

I found code in vcpkg-tool expecting a fixed string to extract the nuget version as this:

                    return extract_prefixed_nonwhitespace("NuGet Version: ", Tools::NUGET, std::move(output), exe_path);

@DimRochette
Copy link

So the new space before the : break it

@dg0yt
Copy link
Contributor

dg0yt commented May 31, 2024

So the localisations break it:
en: NuGet Version: 6.2.1.2
fr: NuGet Version : 6.10.0.107
OP: NuGet バージョン: 6.10.0.107

@kazssym
Copy link
Author

kazssym commented Jun 1, 2024

I reverted the changes in f33c861 locally as a workaround to use vcpkg.

@JonLiu1993 JonLiu1993 added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) and removed category:question This issue is a question labels Jun 3, 2024
@easyatm
Copy link

easyatm commented Jun 4, 2024

I found code in vcpkg-tool expecting a fixed string to extract the nuget version as this:

                    return extract_prefixed_nonwhitespace("NuGet Version: ", Tools::NUGET, std::move(output), exe_path);

I recompiled the vcpkg-tool according to this and successfully solved the problem of NuGet outputting localized strings.

@DimRochette
Copy link

If your are here the quick fixes for windows vcpkg main branch failing on non English OS

Either go back 2 months ago to latest official tag working
git checkout tags/2024.04.26

or just revert the problematic commit an use nugget 6.2
git revert f33c861

or recompile a vcpkg with the PR provided
microsoft/vcpkg-tool#1418

@kazssym
Copy link
Author

kazssym commented Jul 8, 2024

microsoft/vcpkg-tool#1451 is another alternative pull request for vcpkg. The change should be minimal to solve this problem IMO.

@BillyONeal BillyONeal added the requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof label Jul 8, 2024
@BillyONeal BillyONeal reopened this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof
Projects
None yet
6 participants