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

Bazel chocolatey installation error #2671

Closed
junyongyou opened this issue Mar 13, 2017 · 37 comments
Closed

Bazel chocolatey installation error #2671

junyongyou opened this issue Mar 13, 2017 · 37 comments

Comments

@junyongyou
Copy link

I want to install Bazel on Windows 7 64bit. I am using Chogolatey v0.10.3, and then I ran "choco install bazel", and got an error: Method invocation failed because [System.Object[]] doesn't contain a method named 'Split'.

How can I install Bazel. I have tried to use the binary distribution with no success already. Thanks a lot.

@meteorcloudy
Copy link
Member

@petemounce Do you have any idea about this?

@petemounce
Copy link
Contributor

petemounce commented Mar 14, 2017

@junyongyou please would you more details?

  • Powershell version - run $PSVersionTable.PSVersion within a powershell and paste it here in a code block
  • the log resulting from choco install bazel, again in a code block
    • the error you got doesn't provide me with enough context to figure out which part has failed - please include a full copy/paste of the output.
  • which bazel version you're trying to install

@junyongyou
Copy link
Author

@petemounce Thank you very much. I am using the default PowerShell Windows7 has, and the the version information is:
Major Minor Build Revision 2 0 -1 -1.

The version of Chocolatey is v0.10.3, and I am using "choco install bazel", which should install the latest version of bazel. Actually I can see the Bazel version is v0.4.4.20170306.

Below is the result in the log:
`2017-03-14 13:46:41,058 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2017-03-14 13:46:41,058 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2017-03-14 13:46:41,096 [DEBUG] - XmlConfiguration is now operational
2017-03-14 13:46:41,308 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.update".
2017-03-14 13:46:41,320 [INFO ] - ============================================================
2017-03-14 13:46:41,394 [INFO ] - Chocolatey v0.10.3
2017-03-14 13:46:41,459 [DEBUG] - Chocolatey is running on Windows v 6.1.7601.65536
2017-03-14 13:46:41,465 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2017-03-14 13:46:41,469 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2017-03-14 13:46:41,481 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install bazel
2017-03-14 13:46:41,486 [DEBUG] - Received arguments: install bazel
2017-03-14 13:46:41,549 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2017-03-14 13:46:41,563 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2017-03-14 13:46:41,582 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2017-03-14 13:46:41,638 [DEBUG] - The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
2017-03-14 13:46:41,648 [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.
2017-03-14 13:46:41,676 [DEBUG] - Configuration: CommandName='install'|
CacheLocation='C:\Users\junyong\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='False'|Verbose='False'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='bazel'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='bazel'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='6.1.7601.65536'|
Information.PlatformName='Windows 7'|
Information.ChocolateyVersion='0.10.3.0'|
Information.ChocolateyProductVersion='0.10.3'|
Information.FullName='choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
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.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
2017-03-14 13:46:41,685 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2017-03-14 13:46:41,703 [INFO ] - Installing the following packages:
2017-03-14 13:46:41,772 [INFO ] - bazel
2017-03-14 13:46:41,822 [INFO ] - By installing you accept licenses for the packages.
2017-03-14 13:46:43,757 [INFO ] -
bazel v0.4.4.20170306 [Approved]
2017-03-14 13:46:43,834 [INFO ] - bazel package files install completed. Performing other installation steps.
2017-03-14 13:46:43,964 [DEBUG] - Setting installer args for bazel
2017-03-14 13:46:43,968 [DEBUG] - Setting package parameters for bazel
2017-03-14 13:46:43,972 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1':
2017-03-14 13:46:43,987 [DEBUG] - $ErrorActionPreference = 'Stop'; # stop on all errors
$packageName = 'bazel'

$toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition
$paramsText = get-content "$($toolsDir)\params.txt"
$p = $paramsText.Split("`n")

$packageDir = Split-Path -parent $toolsDir

write-host "Read params from text file"
write-host $p

Install-ChocolateyZipPackage -PackageName "$packageName" -Url64bit "$($p[0])"
-Checksum64 "$($p[1])" -Checksum64Type "sha256"
-UnzipLocation "$packageDir"

write-host "Ensure that msys2 dll is present in PATH to allow bazel to be run from non-msys2 shells"

from docs: https://github.com/chocolatey/choco/wiki/How-To-Parse-PackageParameters-Argument

$msys2Path = "c:\tools\msys64"
if ($packageParameters)
{
$match_pattern = "/(?([a-zA-Z]+)):(?(["'])?([a-zA-Z0-9- _\\:\.]+)(["'])?)|/(?([a-zA-Z]+))"
$option_name = 'option'
$value_name = 'value'

if ($packageParameters -match $match_pattern)
{
$results = $packageParameters | Select-String $match_pattern -AllMatches
$results.matches | % {
$arguments.Add(
$.Groups[$option_name].Value.Trim(),
$
.Groups[$value_name].Value.Trim())
}
}
else
{
Throw "Package Parameters were found but were invalid (REGEX Failure)"
}

if ($arguments.ContainsKey("msys2Path")) {
$msys2Path = $arguments["msys2Path"]
Write-Host "msys2Path Argument Found: $msys2Path"
}
}
Install-ChocolateyPath -PathToInstall "$msys2Path\usr\bin" -PathType "Machine"

$addToMsysPath = ($packageDir -replace '^([a-zA-Z]):\(.*)','/$1/$2') -replace '\','/'
write-host @"
bazel installed to $packageDir

To use it in powershell or cmd, you should ensure your PATH environment variable contains
$($msys2Path)\usr\bin
BEFORE both
c:\windows\system32 (because bash-on-windows' bash.exe will be found here, if it's installed)
any references to msysgit (like c:\program files (x86)\git\bin or c:\program files (x86)\git\cmd) (because git's vendored version of msys2 will interfere with the real msys2)

To use it in msys2, you should add that to your msys2 PATH:
export PATH=$($addToMsysPath):`$PATH

You also need, in your msys2 environment (adjust paths for your system):
export JAVA_HOME="$(ls -d C:/Program\ Files/Java/jdk* | sort | tail -n 1)"
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
export BAZEL_PYTHON=c:/tools/python2/python.exe

See also https://bazel.build/docs/windows.html
"@

2017-03-14 13:46:43,991 [INFO ] - The package bazel wants to run 'chocolateyinstall.ps1'.
2017-03-14 13:46:44,027 [INFO ] - Note: If you don't run this script, the installation will fail.
2017-03-14 13:46:44,090 [INFO ] - Note: To confirm automatically next time, use '-y' or consider setting
'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
2017-03-14 13:46:44,200 [INFO ] - Do you want to run the script?
2017-03-14 13:46:44,254 [INFO ] - 1) yes
2017-03-14 13:46:44,306 [INFO ] - 2) no
2017-03-14 13:46:44,377 [INFO ] - 3) print
2017-03-14 13:46:46,227 [INFO ] - Choice selected: 'yes'
2017-03-14 13:46:46,328 [DEBUG] - Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters ''']
2017-03-14 13:46:46,360 [DEBUG] - Redirecting System.Management.Automation.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35, requested by ''
2017-03-14 13:46:47,818 [DEBUG] - Host version is 2.0, PowerShell Version is '2.0' and CLR Version is '4.0.30319.42000'.
2017-03-14 13:46:48,067 [INFO ] - VERBOSE: Exporting function 'Format-FileSize'.
2017-03-14 13:46:48,116 [INFO ] - VERBOSE: Exporting function 'Get-ChecksumValid'.
2017-03-14 13:46:48,151 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
2017-03-14 13:46:48,186 [INFO ] - VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
2017-03-14 13:46:48,270 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariable'.
2017-03-14 13:46:48,309 [INFO ] - VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
2017-03-14 13:46:48,344 [INFO ] - VERBOSE: Exporting function 'Get-FtpFile'.
2017-03-14 13:46:48,379 [INFO ] - VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
2017-03-14 13:46:48,427 [INFO ] - VERBOSE: Exporting function 'Get-ToolsLocation'.
2017-03-14 13:46:48,476 [INFO ] - VERBOSE: Exporting function 'Get-UACEnabled'.
2017-03-14 13:46:48,541 [INFO ] - VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
2017-03-14 13:46:48,588 [INFO ] - VERBOSE: Exporting function 'Get-VirusCheckValid'.
2017-03-14 13:46:48,634 [INFO ] - VERBOSE: Exporting function 'Get-WebFile'.
2017-03-14 13:46:48,672 [INFO ] - VERBOSE: Exporting function 'Get-WebFileName'.
2017-03-14 13:46:48,750 [INFO ] - VERBOSE: Exporting function 'Get-WebHeaders'.
2017-03-14 13:46:48,810 [INFO ] - VERBOSE: Exporting function 'Install-BinFile'.
2017-03-14 13:46:48,870 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
2017-03-14 13:46:48,916 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
2017-03-14 13:46:48,956 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
2017-03-14 13:46:49,037 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
2017-03-14 13:46:49,097 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
2017-03-14 13:46:49,181 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPackage'.
2017-03-14 13:46:49,268 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPath'.
2017-03-14 13:46:49,326 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
2017-03-14 13:46:49,391 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
2017-03-14 13:46:49,451 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
2017-03-14 13:46:49,488 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
2017-03-14 13:46:49,524 [INFO ] - VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
2017-03-14 13:46:49,584 [INFO ] - VERBOSE: Exporting function 'Install-Vsix'.
2017-03-14 13:46:49,641 [INFO ] - VERBOSE: Exporting function 'Set-EnvironmentVariable'.
2017-03-14 13:46:49,708 [INFO ] - VERBOSE: Exporting function 'Set-PowerShellExitCode'.
2017-03-14 13:46:49,744 [INFO ] - VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
2017-03-14 13:46:49,798 [INFO ] - VERBOSE: Exporting function 'Test-ProcessAdminRights'.
2017-03-14 13:46:49,834 [INFO ] - VERBOSE: Exporting function 'Uninstall-BinFile'.
2017-03-14 13:46:49,905 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
2017-03-14 13:46:49,954 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
2017-03-14 13:46:50,001 [INFO ] - VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
2017-03-14 13:46:50,059 [INFO ] - VERBOSE: Exporting function 'Update-SessionEnvironment'.
2017-03-14 13:46:50,111 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateyFailure'.
2017-03-14 13:46:50,163 [INFO ] - VERBOSE: Exporting function 'Write-ChocolateySuccess'.
2017-03-14 13:46:50,237 [INFO ] - VERBOSE: Exporting function 'Write-FileUpdateLog'.
2017-03-14 13:46:50,289 [INFO ] - VERBOSE: Exporting function 'Write-FunctionCallLogMessage'.
2017-03-14 13:46:50,341 [INFO ] - VERBOSE: Exporting alias 'Get-ProcessorBits'.
2017-03-14 13:46:50,392 [INFO ] - VERBOSE: Exporting alias 'Get-OSBitness'.
2017-03-14 13:46:50,466 [INFO ] - VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
2017-03-14 13:46:50,527 [INFO ] - VERBOSE: Exporting alias 'Generate-BinFile'.
2017-03-14 13:46:50,573 [INFO ] - VERBOSE: Exporting alias 'Add-BinFile'.
2017-03-14 13:46:50,668 [INFO ] - VERBOSE: Exporting alias 'Start-ChocolateyProcess'.
2017-03-14 13:46:50,731 [INFO ] - VERBOSE: Exporting alias 'Invoke-ChocolateyProcess'.
2017-03-14 13:46:50,782 [INFO ] - VERBOSE: Exporting alias 'Remove-BinFile'.
2017-03-14 13:46:50,830 [INFO ] - VERBOSE: Exporting alias 'refreshenv'.
2017-03-14 13:46:50,884 [INFO ] - VERBOSE: Importing function 'Format-FileSize'.
2017-03-14 13:46:50,927 [INFO ] - VERBOSE: Importing function 'Get-ChecksumValid'.
2017-03-14 13:46:50,964 [INFO ] - VERBOSE: Importing function 'Get-ChocolateyUnzip'.
2017-03-14 13:46:51,006 [INFO ] - VERBOSE: Importing function 'Get-ChocolateyWebFile'.
2017-03-14 13:46:51,092 [INFO ] - VERBOSE: Importing function 'Get-EnvironmentVariable'.
2017-03-14 13:46:51,173 [INFO ] - VERBOSE: Importing function 'Get-EnvironmentVariableNames'.
2017-03-14 13:46:51,270 [INFO ] - VERBOSE: Importing function 'Get-FtpFile'.
2017-03-14 13:46:51,338 [INFO ] - VERBOSE: Importing function 'Get-OSArchitectureWidth'.
2017-03-14 13:46:51,411 [INFO ] - VERBOSE: Importing function 'Get-ToolsLocation'.
2017-03-14 13:46:51,465 [INFO ] - VERBOSE: Importing function 'Get-UACEnabled'.
2017-03-14 13:46:51,540 [INFO ] - VERBOSE: Importing function 'Get-UninstallRegistryKey'.
2017-03-14 13:46:51,591 [INFO ] - VERBOSE: Importing function 'Get-VirusCheckValid'.
2017-03-14 13:46:51,638 [INFO ] - VERBOSE: Importing function 'Get-WebFile'.
2017-03-14 13:46:51,695 [INFO ] - VERBOSE: Importing function 'Get-WebFileName'.
2017-03-14 13:46:51,732 [INFO ] - VERBOSE: Importing function 'Get-WebHeaders'.
2017-03-14 13:46:51,786 [INFO ] - VERBOSE: Importing function 'Install-BinFile'.
2017-03-14 13:46:51,823 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyDesktopLink'.
2017-03-14 13:46:51,875 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyEnvironmentVariable'.
2017-03-14 13:46:51,912 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyExplorerMenuItem'.
2017-03-14 13:46:51,969 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyFileAssociation'.
2017-03-14 13:46:52,014 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyInstallPackage'.
2017-03-14 13:46:52,063 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPackage'.
2017-03-14 13:46:52,150 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPath'.
2017-03-14 13:46:52,228 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPinnedTaskBarItem'.
2017-03-14 13:46:52,273 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyPowershellCommand'.
2017-03-14 13:46:52,354 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyShortcut'.
2017-03-14 13:46:52,423 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyVsixPackage'.
2017-03-14 13:46:52,484 [INFO ] - VERBOSE: Importing function 'Install-ChocolateyZipPackage'.
2017-03-14 13:46:52,536 [INFO ] - VERBOSE: Importing function 'Install-Vsix'.
2017-03-14 13:46:52,596 [INFO ] - VERBOSE: Importing function 'Set-EnvironmentVariable'.
2017-03-14 13:46:52,646 [INFO ] - VERBOSE: Importing function 'Set-PowerShellExitCode'.
2017-03-14 13:46:52,702 [INFO ] - VERBOSE: Importing function 'Start-ChocolateyProcessAsAdmin'.
2017-03-14 13:46:52,747 [INFO ] - VERBOSE: Importing function 'Test-ProcessAdminRights'.
2017-03-14 13:46:52,787 [INFO ] - VERBOSE: Importing function 'Uninstall-BinFile'.
2017-03-14 13:46:52,833 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyEnvironmentVariable'.
2017-03-14 13:46:52,869 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyPackage'.
2017-03-14 13:46:52,906 [INFO ] - VERBOSE: Importing function 'Uninstall-ChocolateyZipPackage'.
2017-03-14 13:46:52,948 [INFO ] - VERBOSE: Importing function 'Update-SessionEnvironment'.
2017-03-14 13:46:52,986 [INFO ] - VERBOSE: Importing function 'Write-ChocolateyFailure'.
2017-03-14 13:46:53,035 [INFO ] - VERBOSE: Importing function 'Write-ChocolateySuccess'.
2017-03-14 13:46:53,112 [INFO ] - VERBOSE: Importing function 'Write-FileUpdateLog'.
2017-03-14 13:46:53,167 [INFO ] - VERBOSE: Importing function 'Write-FunctionCallLogMessage'.
2017-03-14 13:46:53,250 [INFO ] - VERBOSE: Importing alias 'Add-BinFile'.
2017-03-14 13:46:53,301 [INFO ] - VERBOSE: Importing alias 'Generate-BinFile'.
2017-03-14 13:46:53,339 [INFO ] - VERBOSE: Importing alias 'Get-InstallRegistryKey'.
2017-03-14 13:46:53,376 [INFO ] - VERBOSE: Importing alias 'Get-OSBitness'.
2017-03-14 13:46:53,412 [INFO ] - VERBOSE: Importing alias 'Get-ProcessorBits'.
2017-03-14 13:46:53,475 [INFO ] - VERBOSE: Importing alias 'Invoke-ChocolateyProcess'.
2017-03-14 13:46:53,528 [INFO ] - VERBOSE: Importing alias 'refreshenv'.
2017-03-14 13:46:53,591 [INFO ] - VERBOSE: Importing alias 'Remove-BinFile'.
2017-03-14 13:46:53,674 [INFO ] - VERBOSE: Importing alias 'Start-ChocolateyProcess'.
2017-03-14 13:46:53,745 [DEBUG] - Running 'ChocolateyScriptRunner' for bazel v0.4.4.20170306 with packageScript 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\bazel', installArguments: '', packageParameters: '',
2017-03-14 13:46:53,763 [DEBUG] - Running 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1'
2017-03-14 13:46:53,817 [ERROR] - ERROR: Method invocation failed because [System.Object[]] doesn't contain a method named 'Split'.
2017-03-14 13:46:53,883 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.
2017-03-14 13:46:53,897 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2017-03-14 13:46:53,918 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2017-03-14 13:46:54,079 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\bazel'
2017-03-14 13:46:54,098 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\bazel.nupkg'
with checksum 'D8CB440A653D7B87B4F306F926DB29D2'
2017-03-14 13:46:54,108 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\bazel.nuspec'
with checksum 'E79B10A8DD746B3AE5271A6DBC898683'
2017-03-14 13:46:54,116 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateybeforemodify.ps1'
with checksum 'C2FE025B4BA9DDC701C03A7282892FD3'
2017-03-14 13:46:54,124 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1'
with checksum 'F42043ED57B033C20327E00787F65C6B'
2017-03-14 13:46:54,134 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyuninstall.ps1'
with checksum '2E4C8D495344D85465DD481A901197A1'
2017-03-14 13:46:54,142 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\LICENSE'
with checksum '56C36F9E66D5CC18E0914555441730D6'
2017-03-14 13:46:54,148 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\LICENSE.txt'
with checksum '57CE07A6F8F8903517678FBAC94B4FC0'
2017-03-14 13:46:54,155 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\params.txt'
with checksum '1171BCC7451D61D4814AC46492D6E3E4'
2017-03-14 13:46:54,161 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\bazel\tools\VERIFICATION.txt'
with checksum '2D1B6F9FF5F96DADA1E09E2680E488DE'
2017-03-14 13:46:54,190 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\bazel.0.4.4.20170306.files.update".
2017-03-14 13:46:54,206 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\bazel.0.4.4.20170306.sxs".
2017-03-14 13:46:54,217 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\bazel.0.4.4.20170306.pin".
2017-03-14 13:46:54,242 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\bazel".
2017-03-14 13:46:54,278 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2017-03-14 13:46:54,296 [ERROR] - The install of bazel was NOT successful.
2017-03-14 13:46:54,394 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1'.
See log for details.
2017-03-14 13:46:54,473 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\bazel'
to 'C:\ProgramData\chocolatey\lib-bad\bazel'
2017-03-14 13:46:56,505 [DEBUG] - Attempting to delete file "C:\Users\junyong\AppData\Local\NuGet\Cache\bazel.0.4.4.20170306.nupkg".
2017-03-14 13:46:56,549 [WARN ] -
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2017-03-14 13:46:56,636 [INFO ] -
2017-03-14 13:46:56,696 [ERROR] - Failures
2017-03-14 13:46:56,763 [ERROR] - - bazel (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\bazel\tools\chocolateyinstall.ps1'.
See log for details.
2017-03-14 13:46:56,824 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2017-03-14 13:46:56,878 [DEBUG] - Exiting with -1
`

@petemounce
Copy link
Contributor

petemounce commented Mar 14, 2017

bazel.0.4.4.20170306 is the package fix that I pushed to remove the dependency on powershell v3 a week or so ago, so that's legit.

Based on 2017-03-14 13:46:53,817 [ERROR] - ERROR: Method invocation failed because [System.Object[]] doesn't contain a method named 'Split'. it might be while executing

$toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition
$paramsText = get-content "$($toolsDir)\params.txt"
$p = $paramsText.Split("`n")

(the error doesn't give the line number within the chocolateyinstall.ps1 :( ).

Please would you try (in powershell):

  1. download the bazel nupkg - Invoke-webrequest https://chocolatey.org/api/v2/package/bazel/0.4.4.20170306 -outfile bazel.0.4.4.20170306.zip
  2. unzip it - 7z e .\bazel.0.4.4.20170306.zip -obazel0.4.4.20170306 -r -spf
  3. cd bazel0.4.4.20170306

Then the following statements one by one

# you should now be in the unzipped directory, from above
cat .\tools\params.txt

$toolsDir = ".\tools"
$paramsText = get-content "$($toolsDir)\params.txt"
write-host "paramsText: $paramsText"
write-host $paramsText.GetType()
$p = $paramsText.Split("`n")
write-host "split: $p"

... and paste me back what happens?

@junyongyou
Copy link
Author

@petemounce Thank you. I just downloaded the bazel nupkg from "https://chocolatey.org/api/v2/package/bazel/0.4.4.20170306", not using "Invoke-webrequest https://chocolatey.org/api/v2/package/bazel/0.4.4.20170306 -outfile bazel.0.4.4.20170306.zip", because I am not familiar with PowerShell (and also didn't figure out how to copy the output in PwerShell console yet). Then I unzipped it and entered the bazel0.4.4.20170306 folder. Then:

$toolsDir = ".\tools"
Nothing happened.

$paramsText = get-content "$($toolsDir)\params.txt"
Nothing happened.

write-host "paramsText: $paramsText"
paramsText: https://github.com/bazelbuild/bazel/releasese/download/0.4.4/bazel-0.4.4-windows-x86_64.zip "here is a long string start with fb633"

write-host $paramsText.GetType()
System.Object[]

$p = $paramsText.Split("`n")
Method invocation failed because [System.object[]] doesn't contain a method named 'Split'
At line: 1 Char:23

  • $p=$paramsText.Split <<<< ("'n")
  • CategoryInfo:....

@junyongyou
Copy link
Author

@petemounce So actually I couldn't run write-host "split: $p" at all.

@petemounce
Copy link
Contributor

Ok, great - please now try (in the same powershell if it's still open)

$paramsText[0]
# should show the url to the release
$paramsText[1]
# should show the hash starting with "fb633"

@junyongyou
Copy link
Author

@petemounce Yes, they showed up.

@petemounce
Copy link
Contributor

Perfect. I think bazel.0.4.4.20170314 will fix your problem - please try it out from https://chocolatey.org/packages/bazel/0.4.4.20170314.

@junyongyou
Copy link
Author

@petemounce Thanks a lot. I have downloaded this version and unzipped it. Could you please tell me how I install it? Using Chocolatey?

@junyongyou
Copy link
Author

Can I use the command: choco install https://chocolatey.org/packages/bazel/0.4.4.20170314? Sorry again, this is actually my first time to use PowerShell, Chocolatey...

@petemounce
Copy link
Contributor

petemounce commented Mar 14, 2017

Oh, sorry - run, in an administrator prompt, choco install bazel --version 0.4.4.20170314

@junyongyou
Copy link
Author

@petemounce Great, thanks a lot. Now Bazel has been installed. Thank you very much.

@petemounce
Copy link
Contributor

@junyongyou my pleasure :)

@meteorcloudy turns out I did. Please would you process #2671? I've already pushed fixes for 0.4.4 stable and 0.4.5-rc7.

@meteorcloudy
Copy link
Member

@petemounce The issue is already closed by our user. Thanks for helping us!!

@junyongyou
Copy link
Author

junyongyou commented Mar 14, 2017

@petemounce Sorry, maybe I closed this issue too early. Even though it seems I have installed Bazel 0.4.4, it seems it doesn't run. After the first time I installed it, and then I typed "bazel" in cmd, and got some information. After that, when I tried to use it to build something, nothing happened. Now if I type "bazel" in cmd, nothing happens. I tried to reinstall it again, but still, bazel doesn't run.

In my path environment, there are D:\msys64\usr\bin;C:\ProgramData\chocolatey\lib\msys2;C:\tools\msys64. I put them at first before any others. I believe the first was installed by me, and the last two should be installed by chocolatey.

But anyway, why does bazel not run? Thank you very much.

@junyongyou
Copy link
Author

@petemounce There was one thing. As I said, bazel could run for the first time. After that, I entered a path which has a space in the name, and then I tried to build TensorFlow. The bazel said it couldn't run in the path name with space, and then quit. After that, bazel didn't run any more.

@junyongyou junyongyou reopened this Mar 14, 2017
@petemounce
Copy link
Contributor

petemounce commented Mar 14, 2017

It's important that the msys64 installation's \usr\bin (on my machine that's c:\tools\msys64\usr\bin) appears ahead of any reference to git in your PATH environment variable.

The bazel package will install msys2 from chocolatey if it thinks msys2 is not already installed. It is not intelligent enough to realise that you have installed it outside of chocolatey, sadly (that would be magical :) ). So, from what you posted, it's likely you now have 2 msys2 installs on your machine.

Suggestions:

  • If you edit your PATH to make it appear first and retry, does that solve your problem?
  • Have you tried moving your TensorFlow clone to a path on your drive that has no spaces in it?

(It helps us to diagnose your problem if you copy/paste the commands that you ran and their output, and the directory path that you ran from into issues like these.)

@petemounce
Copy link
Contributor

@meteorcloudy I meant the linked PR that adjusts the package so that @junyongyou can install it successfully.

@junyongyou
Copy link
Author

@petemounce Thank you. Actually my PATH environment variable like this: D:\msys64\usr\bin;C:\ProgramData\chocolatey\lib\msys2;C:\tools\msys64;d:\Anaconda3;... D:\msys64\usr\bin is the first one. I actually tried to move TensorFlow to a path without space, and then I found bazel doesn't work.

Now when I type bazel in cmd, wherever the path is, nothing shows up.

@junyongyou
Copy link
Author

@petemounce I also tried to put C:\tools\msys64 at the first, and then ran bazel, but still, nothing showed.

@meteorcloudy
Copy link
Member

@petemounce Oh, you mean #2678, I'll take care of it.

And @junyongyou , you should make sure C:\tools\msys64\usr\bin is before anything starts with D:\msys64

@junyongyou
Copy link
Author

@meteorcloudy Yes, I did that, put C:\tools\msys64\usr\bin at the first place. But again, nothing shows after typing bazel in cmd.

@petemounce
Copy link
Contributor

petemounce commented Mar 14, 2017

If you run first bazel, then, afterwards,

  • (if you're using cmd) run echo %LASTEXITCODE%
  • (if you're using powershell) run echo $LASTEXITCODE

what happens?

Please also paste us the result of echo %PATH% (if cmd) or echo $env:PATH (if powershell)?

Also, what is contained by c:\tools\msys64\usr\bin on your system? Please paste the result of running dir c:\tools\msys64\usr\bin?

@junyongyou
Copy link
Author

@petemounce Sorry for the late response. I tried to run echo %LASTEXITCODE% after running bazel in cmd, and got "%LASTEXITCODE%"; also tried echo $LASTEXITCODE in powershell, and got 541541187.

@junyongyou
Copy link
Author

But a strange thing is that: I tried to run echo %LASTEXITCODE% several times, during which I ran bazel once, and got the information output (I mean guidance about using bazel). However, when I tried to repeat it, running bazel didn't give me anything.

@junyongyou
Copy link
Author

@petemounce It seems you pushed a commit that can fix my issue. Could you please tell me how I can install bazel now? Should I uninstall the previous v0.4.4.20170314 and then install a new one? If so, what version would it be? Thank you very much.

@petemounce
Copy link
Contributor

That notification was because the PR for the original fix was closed. I think you now have a second issue.

@junyongyou
Copy link
Author

@petemounce Here is the result of echo %PATH%:
C:\tools\msys64\usr\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\libnvvp;
;C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn;
D:\OpenCV3.0.0\opencv\build\x86\vc11\bin;
C:\Program Files\MATLAB\R2014a\bin;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files (x86)\Windows Live\Shared;
D:\apache-maven-3.3.3\bin;
D:\Program Files\nodejs;
C:\ProgramData\chocolatey\bin;
C:\Program Files\Java\jdk1.8.0_121\bin;
c:\tools\msys64\usr\bin;
C:\tools\msys64;
C:\ProgramData\chocolatey\lib\msys2;
d:\Anaconda3;
d:\Anaconda3\Scripts;
d:\Anaconda3\Library\bin;
D:\MexNet\prebuildbase_win10_x64_vc14\lib;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\cudnn\bin;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\cudart;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\opencv;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\vc;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\gnuwin;
D:\MexNet\prebuildbase_win10_x64_vc14\3rdparty\openblas\bin;
C:\Users\junyong\AppData\Roaming\npm

And I put a snapshot of my c:\tools\msys64\usr\bin here: https://www.dropbox.com/s/7pl9ag61tmclz9a/msys64.png?dl=0

@junyongyou
Copy link
Author

C:\tools\msys64\usr\bin appears twice in PATH because I set it as the first one in "User variables", but maybe I should put it in System variables, so I put it as the first one in System variables. But again, running bazel doesn't give me anything...

@petemounce
Copy link
Contributor

Hm, I'm mystified. @laszlocsomor @dslomov ?

@laszlocsomor
Copy link
Contributor

In "cmd", you need to run echo %ERRORLEVEL% to get the last exit code, not echo %LASTEXITCODE%.

@junyongyou : Some questions:

  1. How long do you wait for Bazel to print anything?

  2. Does it exit on its own, or do you have to kill it from Task Manager?

  3. Can you try starting an MSYS shell, and running bazel from there, instead of running it from cmd.exe? What happens?

  4. Please show us the exact command you run and its output (unless the output is long; in that case, please attach it to this issue as a text file). This is how I run bazel from cmd.exe for example:

    C:\work\bazel2>D:/l90hcebl/execroot/bazel2/bazel-out/msys_x64-opt/bin/src/bazel.exe --batch --output_user_root=/c/tmp2 --client_debug build --curses=no --color=no -- examples/cpp:hello-world
    CLIENT: Debug logging active
    ____Loading package: examples/cpp
    ____Loading package: @bazel_tools//tools/cpp
    ____Loading package: @local_config_xcode//
    ____Loading package: @local_jdk//
    WARNING: C:/tmp2/l90hcebl/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
    Auto-Configuration Warning: 'BAZEL_PYTHON' is not set, start looking for python in PATH.
    .
    WARNING: C:/tmp2/l90hcebl/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
    Auto-Configuration Warning: Python found at C:/Python27/python.exe
    .
    WARNING: C:/tmp2/l90hcebl/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
    Auto-Configuration Warning: 'BAZEL_VC' is not set, start looking for the latest Visual C++ installed.
    .
    ____Loading package: @local_config_cc//
    WARNING: C:/tmp2/l90hcebl/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
    Auto-Configuration Warning: Looking for VS%VERSION%COMNTOOLS environment variables,eg. VS140COMNTOOLS
    .
    WARNING: C:/tmp2/l90hcebl/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
    Auto-Configuration Warning: Visual C++ build tools found at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
    .
    ____Loading complete.  Analyzing...
    ____Found 1 target...
    ____Building...
    ____[0 / 9] Writing file examples/cpp/libhello-lib.a-2.params
    Target //examples/cpp:hello-world up-to-date:
      C:/tmp2/l90hcebl/execroot/bazel2/bazel-out/msvc_x64-fastbuild/bin/examples/cpp/hello-world.exe
    ____Elapsed time: 11.433s, Critical Path: 1.42s
    

    Try running with these flags (pay attention to which flags are before build and which are after). Their meanings are:

    • --output_user_root=/c/tmp2 will set the output directory of Bazel to c:\tmp2
    • --batch will make bazel run in a one-shot mode, and not start a Java server daemon; let's try running it like this for you, it can be useful when diagnosing problems
    • --client_debug will print some extra debugging info
    • --curses=no --color=no will simplify the output so it won't have unreadable control characters in cmd.exe

@laszlocsomor
Copy link
Contributor

Note also that in my point (4) in the example command, there's a single "--" before "examples/cpp:hello-world". Notice that there's a space between them. The role of "--" is to tell Bazel that the rest of the command line is the targets to build, not flags. It's optional, I could've left it out. I wrote it in my example command to clarify exactly what flags I'm passing (though it may have had the opposite effect...)

@junyongyou
Copy link
Author

@laszlocsomor Thanks a lot. Now I manage to make bazel run. What I have to do is to first run C:\tools\msys64\usr\bin\bash.exe, and then bazel can run. I don't know why, or maybe this is the way that bazel runs? But thank you very much for your help.

@junyongyou
Copy link
Author

@laszlocsomor I also found that bazel can run in cmd, just if I am running the bash.exe. But if I close bash.exe, bazel doesn't run in cmd.

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Mar 15, 2017

@junyongyou : That's great news! Thanks for bearing with us. I think it's safest to always run Bazel from the MSYS shell, though I think it should also work from cmd.exe... apparently it doesn't.

FYI, we're working hard to detach Bazel from MSYS, and are very close now. Follow #2107 if you're interested.

And @petemounce , you're awesome, thanks for your efforts in helping @junyongyou !

@junyongyou
Copy link
Author

@laszlocsomor @petemounce Thank you soooo much for your helps. I really appreciate. I will follow #2107 and thank you again for making bazel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants