Botched Chocolatey Bazel Install

485 views
Skip to first unread message

Steven Johnson

unread,
Nov 18, 2016, 12:42:44 PM11/18/16
to bazel-discuss
I tried using Chocolatey to install 0.4.0 on a Windows 10 box, but something seems to have gone wrong: Bazel won't run, but neither will it uninstall or reinstall:

$ bazel
Cannot find file at '..\\lib\bazel\bazel.exe' (C:\ProgramData\chocolatey\lib\bazel\bazel.exe). This usually indicates a missing or moved file.

$ choco uninstall bazel --force
Chocolatey v0.10.3
[Pending] Removing incomplete install for 'bazel'
Uninstalling the following packages:
bazel
bazel is not installed. Cannot uninstall a non-existent package.

$ choco install bazel --force
Chocolatey v0.10.3
Installing the following packages:
bazel
By installing you accept licenses for the packages.
bazel v0.4.0 (forced) [Approved]
bazel package files install completed. Performing other installation steps.
bazel not installed. An error occurred during installation:
 Item has already been added. Key in dictionary: 'TMP'  Key being added: 'tmp'
The process cannot access the file 'C:\ProgramData\chocolatey\lib\bazel\.chocolateyPending' because it is being used by another process.

[Note: rebooting does not affect the "used by another process" error]

I'm hoping this is an issue someone else has seen / experienced and can suggest how I can clean this up and start fresh -- I'd rather not just start manually deleting files/directories that look related :-)


László Csomor

unread,
Nov 23, 2016, 9:39:42 AM11/23/16
to Steven Johnson, bazel-discuss, pe...@neverrunwithscissors.com
+@petemounce



--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAM%3DdnvfSj5Op%3DvKsDAS5kq7ez2sz9aJz7x-Hjn6f%3DHVHoWVPMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

peter...@improbable.io

unread,
Nov 23, 2016, 11:51:07 AM11/23/16
to bazel-discuss
I'm inclined to say it looks like a problem with chocolatey itself - "TMP" doesn't feature in the bazel package's chocolateyinstall.ps1.

What's in your environment collection? Environment variables in Windows are case insensitive, but keys in powershell & C# hashtables are not AFAIK. Might be that you have an environment variable called "TMP" already, and removing it will clear this problem? If so, that I think lends more weight to this being a chocolatey issue.

Cheers
Pete

Steven Johnson

unread,
Nov 29, 2016, 12:48:53 PM11/29/16
to peter...@improbable.io, bazel-discuss
Yes, I do already have environment variables named "TMP" (all-caps) in both System and User variables -- but that isn't at all uncommon, and surely that should be a breaking point for chocolatey and/or bazel. 

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

Peter Mounce

unread,
Nov 29, 2016, 12:49:48 PM11/29/16
to Steven Johnson, bazel-discuss
What happens if you downcase them?

To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.

Steven Johnson

unread,
Nov 29, 2016, 2:18:19 PM11/29/16
to Peter Mounce, bazel-discuss
FWIW, I just deleted everything I could find related to Chocolatey and Bazel, rebooted (again), reinstalled everything (again), rebooted (again), and now the install seems to be "correct".

Except that bazel doesn't actually work: in msys2, Powershell, etc., "which bazel" points correctly at the chocolatey-installed version, but actually running bazel does... nothing. No error, no info, no nothing. Zip. Zilch. Nada.

JAVA_HOME and BAZEL_SH are set as per https://www.bazel.io/versions/master/docs/windows.html. Not sure what else to try. Is Bazel-for-Windows just too experimental to install reliably at the present time?


To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

Peter Mounce

unread,
Nov 29, 2016, 2:22:26 PM11/29/16
to Steven Johnson, bazel-discuss

It works on various machines that I manage. Did you follow the instructions that the install writes out after completing relating to msys2 position in PATH?


To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.

Steven Johnson

unread,
Nov 29, 2016, 2:25:41 PM11/29/16
to Peter Mounce, bazel-discuss
On Tue, Nov 29, 2016 at 11:22 AM, Peter Mounce <peter...@improbable.io> wrote:

It works on various machines that I manage. Did you follow the instructions that the install writes out after completing relating to msys2 position in PATH?

Yep, pretty sure I did. I'll go back and double-check to be sure I didn't miss anything.

 

Steven Johnson

unread,
Nov 29, 2016, 3:22:01 PM11/29/16
to Peter Mounce, bazel-discuss
OK, I think I've found the secret to what was wrong:

I had install VS2015 on my system, and while I had been using the command-line tools for months (MSBuild.exe) with no problem, I had never launched the IDE, even once... thus had never signed in as a registered user.

I did so for the first time today (hoping to use the debugger to attach to Bazel when it launched), only to find that bazel is now responding to my command.

Odd unexpected dependency causing a quiet failure somewhere deep in the bowels of Bazel? Not sure how to figure out how and where.


Peter Mounce

unread,
Nov 30, 2016, 7:25:49 PM11/30/16
to Steven Johnson, Dmitry Lomov, bazel-discuss
+Dmitry for discovery about unexpected dependency.
Reply all
Reply to author
Forward
0 new messages