winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Support validation for multiple aliases in a single portable executable

Open sitiom opened this issue 2 years ago β€’ 4 comments

Brief description of your issue

winget validate fails locally for nested portable executables with multiple aliases. Some applications expect multiple aliases from one command, which is why this is important.

Related to https://github.com/microsoft/winget-cli/issues/2523#issue-1376643992:

  • This might be acceptable as long as they have different command aliases?

Perhaps this was overlooked.

Steps to reproduce

  1. Checkout https://github.com/microsoft/winget-pkgs/pull/94699
  2. Validate the Fly-io.flyctl manifest locally with winget validate
  3. Validation fails with this error:
Manifest validation failed.
Manifest Error: Duplicate relative file path found. [RelativeFilePath]
Manifest Error: Duplicate relative file path found. [RelativeFilePath]

Installation works as intended however, creating fly and flyctl aliases for flyctl.exe.

Expected behavior

Validation should succeed

Actual behavior

Validation is failing.

Environment

Windows: Windows.Desktop v10.0.22621.1105
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

sitiom avatar Jan 26 '23 23:01 sitiom

@sitiom,

This scenario seems a bit strange to me. Why are multiple aliases needed for a single executable when one alias could do the job? Could you give me more context on your scenario or your specific package? Is this a "special" case or is this a more common scenario that we had overlooked when implementing the validation. We don't want to open up floodgates and allow a bunch of symlinks/aliases to be generated for only a single executable if it is not absolutely necessary.

ryfu-msft avatar Jan 27 '23 00:01 ryfu-msft

Why are multiple aliases needed for a single executable when one alias could do the job?

Some CLI apps have a shorter alias that users can use for convenience. flyctl is an example (i.e., flyctl and fly as stated in the docs). Users expect both aliases to be available like in other package managers; thus, this case should be supported.

We don't want to open up floodgates and allow a bunch of symlinks/aliases to be generated for only a single executable if it is not absolutely necessary.

Of course, you shouldn't when it's not necessary πŸ™‚

sitiom avatar Jan 27 '23 00:01 sitiom

It sounds more like a new feature then. Are there any other examples like this?

A few more "real world" examples will help justify the work. It's hard to justify for one package given all the other open Issues.

I'd also want a few more πŸ‘on the issue 😊

denelon avatar Jan 27 '23 01:01 denelon

Workaround: Prefix .\ to the other RelativeFilePath (i.e., flyctl.exe and .\flyctl.exe). Validation now succeeds: image

  • https://github.com/microsoft/winget-cli/issues/2887

However, you cannot apply this workaround for non-zip binaries (Example: Genivia.ugrep).

sitiom avatar Jan 27 '23 07:01 sitiom

[Policy] Portable

Trenly avatar Jun 16 '23 03:06 Trenly

Another package that uses multiple aliases https://github.com/microsoft/winget-pkgs/pull/131849

soredake avatar Dec 28 '23 08:12 soredake