Error when installing bazel on windows - bazel

I am trying to install Bazel (version 0.10.0) on windows 7, but i have a problem when i try to excute compile.sh.
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ export BAZEL_VS=c:/Program\ Files\ \(x86\)/Microsoft\ visual\ studio
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ export BAZEL_PYTHON=c:/Users/c.kazdaghli/AppData/Local/Programs/Python/Python36/python.exe
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ ./compile.sh
ERROR: cannot locate python.exe; check your PATH.
You may need to run the following command, or something
similar, depending on where you installed Python:
export PATH="/c/Python27:$PATH"
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ export PATH=/c/Users/c.kazdaghli/AppData/Local/Programs/Python/Python36:$PATH
c.kazdghli#cKAZDGHL-STG-PC MINGW64 /c/Users/c.kazdghli/Downloads/bazel-0.10.0
$ ./compile.sh
ERROR: cannot locate python.exe; check your PATH.
You may need to run the following command, or something
similar, depending on where you installed Python:
export PATH="/c/Python27:$PATH"

Run which python.exe after you export the new PATH and make sure the result is /c/Users/c.kazdaghli/AppData/Local/Programs/Python/Python36/python.exe.
Keep in mind that which operates by looking up the file in directories on the PATH, i.e. the PATH must contain the path to the directory where python.exe is, not the path of python.exe itself.

This problem can be easily solved by the installing bazel from Chocolatey
Install Chocolatey with cmd.exe:
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Then use the following command in cmd to install bazel:
choco install bazel --pre

Related

Docker: Can't locate Tk.pm in #INC (you may need to install the Tk module) on Linux

I am trying to run a simple perl gui made using Tk module on a ubuntu:16.04 container using both perl:latest and activestate/circleci-activeperl:latest images.
I get error Can't locate Tk.pm in #INC (you may need to install the Tk module)
What is the command to install the Tk module on the Linux container environment for perl?
I have used cpan to install Tk as below
$ perl -MCPAN -e shell
cpan> install Tk
I get the below error
apt-get install perl-tk
helped in installation of perl-tk module.

Error installing cygwin in docker container: The system cannot find the path specified. (0x3) error=hcsshim::ImportLayer - failed failed in Win32

I have a simple Dockerfile:
FROM mcr.microsoft.com/windows:1809
# Install chocolatey
RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install cygwin
RUN choco install -y cygwin --version 3.1.2
RUN refreshenv
CMD [ "powershell" ]
The result is
PS C:\vagrant\delme> docker build . -t localhost/async_windows_service
Sending build context to Docker daemon 2.048kB
Step 1/5 : FROM mcr.microsoft.com/windows:1809
---> 2de0138f1799
Step 2/5 : RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
---> Using cache
---> 7ee59b0c4334
Step 3/5 : RUN choco install -y cygwin --version 3.1.2
---> Running in e6c3d1130a4e
Chocolatey v0.10.15
Installing the following packages:
cygwin
By installing you accept licenses for the packages.
Progress: Downloading chocolatey-core.extension 1.3.5.1... 100%
Progress: Downloading Cygwin 3.1.2... 100%
chocolatey-core.extension v1.3.5.1 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
Installed/updated chocolatey-core extensions.
The install of chocolatey-core.extension was successful.
Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
Cygwin v3.1.2 [Approved]
cygwin package files install completed. Performing other installation steps.
Download site: http://mirrors.kernel.org/sourceware/cygwin/
Installing 64-bit Cygwin...
Cygwin has been installed.
Added C:\ProgramData\chocolatey\bin\Cygwin.exe shim pointed to 'c:\tools\cygwin\cygwin.bat'.
Copying cygwin package manager (setup) to C:\tools\cygwin
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
ShimGen has successfully created a shim for setup-x86.exe
The install of cygwin was successful.
Software installed to 'C:\tools\cygwin'
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
re-exec error: exit status 1: output: time="2020-06-02T22:03:52+02:00" level=error msg="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" error="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" importFolderPath="C:\\ProgramData\\docker\\tmp\\hcs292836507" path="\\\\?\\C:\\ProgramData\\docker\\windowsfilter\\eeae1d5f886b0b035f4466cf124056f7c1924283548cd960e0024a33d1219984"
hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)
I tried different version of cygwin, also modified the storage size, as suggested e.g. here.
It is strange. The installation seems to go fine but docker cannot find the file (a layer I suppose) with path="\\\\?\\C:\\ProgramData\\docker\\windowsfilter\\eeae1d5f886b0b035f4466cf124056f7c1924283548cd960e0024a33d1219984"
And indeed, in my C:\ProgramData\docker\windowsfilter directory, there is no folder starting with eeae1d...
Note that only cygwin is causing problems. I can install all kinds of other software.
It seems that it is hardlinks which Cygwin uses a lot are not handled correctly by Docker. And in particular when Docker tries to commit an image it fails with "hcsshim::ImportLayer - cannot find the path" error.
I run in the same problem recently and after I got rid of the hardlinks in Cygwin installation I was able to commit the image without problems.
To get rid of the hardlinks I have zipped and unzipped Cygwin folder.

Lumber: Command 'lumber' not found

I just setup a Rails Application in my Ubuntu 18 machine, and I want to connect it to Forest Admin. However, Forest Admin requires that I set up a Node Application using npm first. The node application requires the installation of Lumber CLI tool in order to install Forest Admin.
I have however installed Lumber CLI tool by running the command below:
npm install -g lumber-cli#latest -s
When I run the command below npm lumber -version in my command line terminal, I get the response:
6.13.4
But when I try to generate the Forest Admin using the command below:
lumber generate "my_project"...
I get the following error:
Command 'lumber' not found
I need some help. Thank you.
Here's how I solved it:
The issue is because NPM does not have the write access to the directory that will contain the package you want to install (here lumber-cli).
To solve this issue, override the default directory where your global NPM packages will be stored:
mkdir ~/.npm-global
Then, configure NPM to use this directory instead of the default one:
npm config set prefix '~/.npm-global'
Then, make the node executables accessible from your PATH. To do so, export the environment variable PATH by opening or creating the file ~/.profile and add this line at the end:
export PATH=~/.npm-global/bin:$PATH
Finally, reload the ~/.profile file:
source ~/.profile
Try installing lumber cli again using the command below:
npm install -g lumber-cli#latest -s
It should be able to install lumber without any error, and also display the directory where lumber-cli is installed.
Reference: Prevent permission errors at installation
That's all
I hope this helps

sudo luarocks command not found on centos7

I installed luarocks on centos7, then I execute 'luarocks install luacheck', there is an error:
'Error: Your user does not have write permissions in /usr/local/lib/luarocks/rocks
-- you may want to run as a privileged user or use your local tree with --local.'
So, I execute 'sudo luarocks install luacheck', but there is also an error:
'sudo luarocks command not found'.
I confirm that luarocks has installed correctly, bucause when I execte 'luarocks --version' shows:
/usr/bin/luarocks 2.4.2
As luarocks isn't installed using the native package manager its installed to /usr/local/bin. This isn't in the PATH variable available in the sudo context - you can see (and edit) the configured paths in the secure_path property in the sudoers file.
Workaround that I use it to add a symbolic link to a path included in the secure_path property: sudo ln -s /usr/local/bin/luarocks /usr/bin/luarocks
You can either use
sudo /usr/bin/luarocks install luacheck
to install luacheck system-wide
or
luarocks --local install luacheck
to install to your user only. To use the second option, you also need to run
eval $(luarocks path --bin)
to make sure that the Lua paths are updated in your shell. To make these Lua paths permanent, you can add the above line to your shell config file (~/.bash_profile or similar).

How to run iex as normal user?

I'm following this link to install elixir and erlang on fedora 21... After i installed when i tried to run interactive elixir(iex) i get the following error
/home/hari/.asdf/installs/elixir/1.4.2/bin/elixir: line 126: exec: erl: not found
Commands i used to install :
asdf install erlang 19.0
asdf install elixir 1.3.2
But if i run as a root user its working correctly!!! What's the mistake im commiting here?
It’s a path issue. Please do the following to detect the problem root:
sudo su -c 'which erl'
#⇒ /usr/local/bin/erl # OR LIKE
It seems that this directory is not on your user’s path. Add it to test:
export PATH=`dirname $(sudo su -c 'which erl')`:$PATH
Try running elixir (it should succeed.) Now just put the hardcoded path in the very end of your shell start script (~/.bashrc if you use bash, etc):
export PATH=/usr/local/bin:$PATH

Resources