Skip to content

File not found error when using --source=cygwin to install packages #2953

Closed

Description

@egor-tensin

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.

What You Are Seeing?

New versions of choco cannot install packages w/ --source cygwin. It looks like this:

wtf

Adding --noop shows that choco for some reason doesn't set the root installation directory in the command line:

noop

What is Expected?

Packages should be installed, obviously.

How Did You Get This To Happen?

  1. Install a new version of Chocolatey (1.2.0+).
  2. Install Cygwin using choco install cygwin -y --package-parameters='/InstallDir:C:\cg'
  3. Run choco install cmake --source=cygwin.

This doesn't happen if after installing Chocolatey you downgrade it using choco install chocolatey --version 1.1.0 --allow-downgrade -y.

In both cases (with a new and an older version), I can see that choco reads HKLM\Software\Cygwin\setup\rootdir using procmon.

System Details

  • Operating System: 10.0.20348.0
  • Windows PowerShell version: 5.1.20348.1366
  • Chocolatey CLI Version: 1.2.1
  • Chocolatey Licensed Extension version: 1.2.1
  • Chocolatey License type:
  • Terminal/Emulator: CMD

Installed Packages

Chocolatey v1.2.1
chocolatey 1.2.1
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
Cygwin 3.4.3
sysinternals 2022.11.28
5 packages installed.

Output Log

2023-01-02 01:05:24,617 1156 [DEBUG] - XmlConfiguration is now operational
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'WebPiService' for type 'ISourceRunner' from assembly 'choco'
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'WindowsFeatureService' for type 'ISourceRunner' from assembly 'choco'
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'CygwinService' for type 'ISourceRunner' from assembly 'choco'
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'PythonService' for type 'ISourceRunner' from assembly 'choco'
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'RubyGemsService' for type 'ISourceRunner' from assembly 'choco'
2023-01-02 01:05:24,680 1156 [DEBUG] - Adding new type 'SystemStateValidation' for type 'IValidation' from assembly 'choco'
2023-01-02 01:05:24,836 1156 [DEBUG] - Registering new command 'template' in assembly 'choco'
2023-01-02 01:05:24,836 1156 [DEBUG] - Registering new command 'upgrade' in assembly 'choco'
2023-01-02 01:05:24,836 1156 [DEBUG] - Registering new command 'export' in assembly 'choco'
2023-01-02 01:05:24,836 1156 [DEBUG] - Registering new command 'list' in assembly 'choco'
2023-01-02 01:05:24,836 1156 [DEBUG] - Registering new command 'info' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'help' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'config' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'features' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'new' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'outdated' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'pack' in assembly 'choco'
2023-01-02 01:05:24,851 1156 [DEBUG] - Registering new command 'pin' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'push' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'apikey' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'source' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'uninstall' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'unpackself' in assembly 'choco'
2023-01-02 01:05:24,883 1156 [DEBUG] - Registering new command 'install' in assembly 'choco'
2023-01-02 01:05:25,023 1156 [INFO ] - ============================================================
2023-01-02 01:05:25,211 1156 [INFO ] - Chocolatey v1.2.1
2023-01-02 01:05:25,242 1156 [DEBUG] - Chocolatey is running on Windows v 10.0.20348.0
2023-01-02 01:05:25,258 1156 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2023-01-02 01:05:25,258 1156 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2023-01-02 01:05:25,289 1156 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install cmake --source cygwin --debug --verbose
2023-01-02 01:05:25,305 1156 [DEBUG] - Received arguments: install cmake --source cygwin --debug --verbose
2023-01-02 01:05:25,367 1156 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2023-01-02 01:05:25,398 1156 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2023-01-02 01:05:25,414 1156 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2023-01-02 01:05:25,476 1156 [DEBUG] - Performing validation checks.
2023-01-02 01:05:25,492 1156 [DEBUG] - Global Configuration Validation Checks:
2023-01-02 01:05:25,492 1156 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2023-01-02 01:05:25,492 1156 [DEBUG] - System State Validation Checks:
2023-01-02 01:05:25,492 1156 [DEBUG] -  Reboot Requirement Checks:
2023-01-02 01:05:25,492 1156 [DEBUG] -  - Pending Computer Rename = Checked
2023-01-02 01:05:25,508 1156 [DEBUG] -  - Pending Component Based Servicing = Checked
2023-01-02 01:05:25,508 1156 [DEBUG] -  - Pending Windows Auto Update = Checked
2023-01-02 01:05:25,508 1156 [DEBUG] -  - Pending File Rename Operations = Ignored
2023-01-02 01:05:25,508 1156 [DEBUG] -  - Pending Windows Package Installer = Checked
2023-01-02 01:05:25,508 1156 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2023-01-02 01:05:25,523 1156 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2023-01-02 01:05:25,539 1156 [DEBUG] - The source 'cygwin' evaluated to a 'cygwin' source type
2023-01-02 01:05:25,555 1156 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2023-01-02 01:05:25,570 1156 [DEBUG] - Configuration: CommandName='install'|
CacheLocation='C:\Users\Administrator\AppData\Local\Temp\2\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='cygwin'|SourceType='cygwin'|Debug='True'|Verbose='True'|
Trace='False'|Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|DisableCompatibilityChecks='False'|
AcceptLicense='False'|AllowUnofficialBuild='False'|Input='cmake'|
AllVersions='False'|SkipPackageInstallProvider='False'|
SkipHookScripts='False'|PackageNames='cmake'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.20348.0'|
Information.PlatformName='Windows Server 2016'|
Information.ChocolateyVersion='1.2.1.0'|
Information.ChocolateyProductVersion='1.2.1'|
Information.FullName='choco, Version=1.2.1.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Administrator'|
Information.UserDomainName='EC2AMAZ-VDKJE1B'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='True'|Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\Users\Administrator'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|
2023-01-02 01:05:25,586 1156 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2023-01-02 01:05:25,586 1156 [DEBUG] - Running list with the following filter = ''
2023-01-02 01:05:25,601 1156 [DEBUG] - --- Start of List ---
2023-01-02 01:05:25,836 1156 [DEBUG] - chocolatey 1.2.1
2023-01-02 01:05:25,851 1156 [DEBUG] - chocolatey-compatibility.extension 1.0.0
2023-01-02 01:05:25,851 1156 [DEBUG] - chocolatey-core.extension 1.4.0
2023-01-02 01:05:25,867 1156 [DEBUG] - Cygwin 3.4.3
2023-01-02 01:05:25,867 1156 [INFO ] - Installing the following packages:
2023-01-02 01:05:25,867 1156 [INFO ] - cmake
2023-01-02 01:05:25,867 1156 [INFO ] - By installing, you accept licenses for the packages.
2023-01-02 01:05:25,914 1156 [DEBUG] - Calling command ['"cygwinsetup.exe" --quiet-mode --no-desktop --no-startmenu --root  --local-package-dir \packages --site http://mirrors.kernel.org/sourceware/cygwin/ --packages cmake']
2023-01-02 01:05:25,961 1156 [WARN ] - 
Chocolatey installed 0/0 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2023-01-02 01:05:25,961 1156 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2023-01-02 01:05:25,976 1156 [ERROR] - Chocolatey had an error occur:
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at chocolatey.infrastructure.commands.CommandExecutor.execute_static(String process, String arguments, Int32 waitForExitInSeconds, String workingDirectory, Action`2 stdOutAction, Action`2 stdErrAction, Boolean updateProcessPath, Boolean allowUseWindow, Boolean waitForExit)
   at chocolatey.infrastructure.commands.CommandExecutor.execute(String process, String arguments, Int32 waitForExitInSeconds, String workingDirectory, Action`2 stdOutAction, Action`2 stdErrAction, Boolean updateProcessPath, Boolean allowUseWindow)
   at chocolatey.infrastructure.app.services.CygwinService.install_run(ChocolateyConfiguration config, Action`1 continueAction)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func`2 function)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action`1 parseArgs)
   at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container)
   at chocolatey.console.Program.Main(String[] args)
2023-01-02 01:05:25,976 1156 [DEBUG] - Exiting with 1

Additional Context

No response

Activity

  1. added
    BugIssues where something has happened which was not expected or intended.
    on Jan 2, 2023
  2. pauby commented on Jan 2, 2023

    @pauby
    Member

    cygwinsetup doesn't appear to be an executable that can be called either because it's no longer there or it's not on the path. So this:

    Calling command ['"cygwinsetup.exe" --quiet-mode --no-desktop --no-startmenu --root  --local-package-dir \packages --site http://mirrors.kernel.org/sourceware/cygwin/ --packages cmake']
    

    Isn't going to work. The workaround would obviously be to install the cmake package natively in cygwin for the time being.

  3. added
    0 - TriagingIssue is accepted, but a milestone has yet to be added for the issue.
    on Jan 2, 2023
  4. egor-tensin commented on Jan 2, 2023

    @egor-tensin
    Author

    The workaround would obviously be to install the cmake package natively in cygwin for the time being.

    Sure. The issue is for a fairly useful script, which uses choco to install Cygwin & packages programmatically.

  5. added this to the 1.3.0 milestone on Jan 12, 2023
  6. added
    0 - BacklogIssue is accepted, but is not ready to be worked on or not in current sprint.
    and removed
    0 - TriagingIssue is accepted, but a milestone has yet to be added for the issue.
    on Jan 12, 2023
  7. added 3 commits that reference this issue on Feb 13, 2023
  8. added
    2 - WorkingA user or team member has started working on the issue.
    and removed
    0 - BacklogIssue is accepted, but is not ready to be worked on or not in current sprint.
    on Feb 14, 2023
  9. added a commit that references this issue on Feb 14, 2023
  10. added
    3 - ReviewCode has been added, and is available for review as a pull request.
    and removed
    2 - WorkingA user or team member has started working on the issue.
    on Feb 14, 2023
  11. changed the title [-]Cannot install packages with Cygwin as source[/-] [+]File not found error when using --source=cygwin to install packages[/+] on Feb 14, 2023
  12. added 2 commits that reference this issue on Feb 14, 2023
  13. added a commit that references this issue on Feb 15, 2023
  14. added
    4 - DoneCode has been added to the repository, and has been reviewed by a team member.
    and removed
    3 - ReviewCode has been added, and is available for review as a pull request.
    on Feb 15, 2023
  15. added
    5 - ReleasedThe issue has been resolved, and released to the public for consumption.
    and removed
    4 - DoneCode has been added to the repository, and has been reviewed by a team member.
    on Feb 15, 2023
  16. vexx32 commented on Feb 15, 2023

    @vexx32
    Member

    🎉 This issue has been resolved in version 1.3.0 🎉

    The release is available on:

    Your GitReleaseManager bot 📦🚀

  17. added a commit that references this issue on Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    5 - ReleasedThe issue has been resolved, and released to the public for consumption.BugIssues where something has happened which was not expected or intended.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions