dtgm / chocolatey-packages

chocolateynuget packages published on chocolatey.org
https://chocolatey.org/profiles/dtgm
Apache License 2.0
48 stars 109 forks source link

arduinoidegalileo - extracted install path exceeds limit #12

Closed dtgm closed 4 years ago

dtgm commented 9 years ago
DEBUG: Tracking current state of 'C:\bin\arduinogalileo'
DEBUG: Calling 'C:\ProgramData\chocolatey\tools\7za.exe x -aoa -o"C:\bin\arduinogalileo" -y
"C:\Users\UserX\AppData\Local\Temp\chocolatey\arduinogalileo\arduinogalileoInstall.zip"'

Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 26
 0 characters, and the directory name must be less than 248 characters.
 At C:\ProgramData\chocolatey\helpers\functions\Write-FileUpdateLog.ps1:29 char:18
 +   $newContents = Get-ChildItem -Recurse $locationToMonitor | Select-O ...
 +                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : ReadError: (C:\bin\arduinog...poky-linux\bits:String) [Get-ChildItem], PathTooLongExcept
    ion
     + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand
 DEBUG: 7za exit code: 0

arduinoidegalileo is based on Arduino and released by Intel for their Galileo development board.

The package is released as an archived 7z.

The chocolatey package installs the 7z to $Env:ChocolateyBinRoot\$chocoPackageName. For example, $installDir = C:\bin\arduinoidegalileo

Extracting arduinoidegalileo.7z creates a sub-directory such as, arduino-1.5.3-Intel.1.0.4 in $installDir. These 25 characters, while useful if multiple versions of arduinoidegalileo are to be installed, are wasteful to the 260 path character limit.

So the final path would be something like C:\bin\arduinoidegalileo\arduino-1.5.3-Intel.1.0.4

C:\bin\ == set by the user -- with environment variable $Env:ChocolateyBinRoot arduinoidegalileo\ == set by the package maintainer -- and is the chocolatey package ID arduino-1.5.3-Intel.1.0.4 == set by the developer

$ cd /cygdrive/c && find arduino-1.5.3-Intel.1.0.4/ -print | awk '{ print length($0), $0 }' | sort -n | tail -1 238 arduino-1.5.3-Intel.1.0.4/hardware/tools/edison/sysroots/core2-32-poky-linux/usr/src/debug/gcc-runtime/4.8.2-r0/gcc-4.8.2/build.i586-poky-linux.i586-poky-linux/i586-poky-linux/libstdc++-v3/include/i586-poky-linux/bits/c++locale_internal.h

> Get-ChildItem .\arduino-1.5.3-Intel.1.0.4 -Recurse | where {$_.PSIsContainer } | foreach {$_.FullName.Length} | sort-object

Or to see the problem files: > Get-ChildItem .\arduino-1.5.3-Intel.1.0.4 -Recurse | where {$_.PSIsContainer } | foreach {$_.FullName} | sort-object -property length

Get-ChildItem : path, file name, or both are too long
fully qualified file name must be <260 characters
directory name must be <248 characters

directory name C:\ == 3 characters C:\x == 4 characters C:\x\y == 6 characters

fully qualified file name (FQFN) a.txt == 4 characters C:\a.txt == 3 + 4 = 7 characters

\a.txt == 5 characters C:\x\a.txt == 4 + 5 = 8 characters C:\x\y\a.txt == 6 + 5 = 11 characters

Setting reasonable directories: $Env:ChocolateyBinRoot = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root

PS> $Env:SystemDrive
C:
PS> $Env:SystemDrive.Length
2
PS> $Env:Chocolatey_Bin_Root
\bin
PS> $Env:Chocolatey_Bin_Root.Length
4
PS> $Env:ChocolateyBinRoot
C:\bin
PS> $Env:ChocolateyBinRoot.Length
6
tunisiano187 commented 4 years ago

This software is for an old board that seems abandonned

gep13 commented 4 years ago

@tunisiano187 thank you for looking into this.