bazel: Using WSL's bash instead of MSYS64 - bazel

I am having problems using Bazel on Windows because of MSYS64:
ERROR: C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/external/java_image_base/image/BUILD:6:1: error executing shell command: 'bazel-out/host/bin/external/gzip/gzip.exe -d < external/java_image_base/image/000.tar.gz > bazel-out/x64_windows-fastbuild/bin/external/java_image_base/image/000.tar.gz.nogz' failed (Exit 127): bash.exe failed: error executing command
cd C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/execroot/com_telefonica_baikal
C:/msys64/usr/bin/bash.exe -c bazel-out/host/bin/external/gzip/gzip.exe -d < external/java_image_base/image/000.tar.gz > bazel-out/x64_windows-fastbuild/bin/external/java_image_base/image/000.tar.gz.nogz
C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/execroot/com_telefonica_baikal/bazel-out/host/bin/external/gzip/gzip: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
I have tried running the same commands using WSL's bash and gzip and it works perfectly fine. Is there any easy way to tell Bazel to use the built-in WSL bash instead of MSYS64?

Sorry, Bazel doesn't support WSL yet. See https://github.com/bazelbuild/bazel/issues/1608
If there are enough interest, we can dump up the priority of this issue.

Related

bazel building tensorflow serving error

I am running a tensorflow serving container referring to this , all the previous steps are good, but in the last block I met some problems:
git clone --recurse-submodules https://github.com/tensorflow/serving
cd serving/
bazel build -c opt tensorflow_serving/...
root#15bb1c2766e3:/serving# bazel build -c opt tensorflow_serving/...
ERROR:
/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/third_party/clang_toolchain/cc_configure_clang.bzl:3:1:
file '#bazel_tools//tools/cpp:cc_configure.bzl' does not contain
symbol 'cc_autoconf_impl'. ERROR: error loading package '': Extension
file 'third_party/clang_toolchain/cc_configure_clang.bzl' has errors.
ERROR: error loading package '': Extension file
'third_party/clang_toolchain/cc_configure_clang.bzl' has errors. INFO:
Elapsed time: 0.107s ERROR: Couldn't start the build. Unable to run
tests. And in my container, the bazel version is 0.9.0:
I just came across this error. First please check whether your Bazel version is 0.5.4 by typing the command bazel version.
If the bazel version is 0.5.4 you need to upgrade it to 0.12.0 . For updating you could change Dockerfile.devel BAZEL_VERSION to 0.12.0 and re run all the steps.
Or you could update bazel directly in the docker container by
Download bazel--installer-linux-x86_64.sh from
https://github.com/bazelbuild/bazel/releases location
chmod +x ./bazel--installer-linux-x86_64.sh
./bazel--installer-linux-x86_64.sh
I have already answered this on github and it worked. Please refer to the links https://github.com/tensorflow/serving/issues/851 and https://github.com/tensorflow/serving/issues/854

Bazel fails to run command, by hand it works. How to debug?

I am trying to compile tensorflow in a bit difficult environment (Centos 6.2 with a load of "own" compilations).
A lot of problems I have solved already, but the one baffling me is a SWIG error. I run with "--verbose_failures" and I can see the command that bazel tries to run:
(cd /home/../.cache/bazel/_bazel../[long-hexa]/execroot/org_tensorflow && \
exec env - \
bazel-out/host/bin/external/swig/swig -c++ ...
It fails with "Exit 1: swig failed: error executing command.
However, when I cd to the mentioned directory and run the mentioned bazel-out/../swig command it succeeds! What I have understood is that this probably is a problem of bazel trying to sanitize the environment.
How can I go to debug this? Is there a way to show what environment variables bazel is using?

Compass compile on Jenkins CI

I have the following execute script on my CI environment
cd /var/www/html
php vendor/bin/phpunit app/tests --log-junit /var/lib/jenkins/jobs/Closecall/workspace/tests/reports/junit.xml
php vendor/bin/phinx migrate -e development
sudo compass compile
SSHing onto the CI and compiling myself works fine, however when the CI executes this on build I get the following error
+ sudo compass compile
sudo: no tty present and no askpass program specified
Build step 'Execute shell' marked build as failure
Recording test results
Finished: FAILURE
Any ideas?
sudo by default tries to open /dev/tty for read-write. You might not have /dev/tty available on the machine you use to build. The need for tty is configured in the /etc/sudoers file.
sudo has an option -S to read the password from standard input instead of /dev/tty. You should be able to compile using sudo -S.
The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device. The password must be followed by a newline character.
http://linux.die.net/man/8/sudo

fpm is not recognised if executing script with jenkins and ssh

I am trying to execute a script over ssh connexion with Jenkins. I am using the SSH plugin and it is well configured. I arrive to execute the first part of the script, but when I try to execute a fpm command it says:
fpm: command not found
If I connect to the instance and run the same script that I call via Jenkins it runs and there is no error (fpm is installed).
So, I have created a test like a script test.sh:
#!/bin/bash -x
fpm
but, with Jenkins, I get the same error: fpm: command not found, while if I execute it I get a normal "parameter needed":
Missing required -s flag. What package source did you want? {:level=>:warn}
Missing required -t flag. What package output did you want? {:level=>:warn}
No parameters given. You need to pass additional command arguments so that I know what you want to build packages from. For example, for '-s dir' you would pass a list of files and directories. For '-s gem' you would pass a one or more gems to package from. As a full example, this will make an rpm of the 'json' rubygem: `fpm -s gem -t rpm json` {:level=>:warn}
Fix the above problems, and you'll be rolling packages in no time! {:level=>:fatal}
What am I missing? Why it cannot find fpm if it is installed?
Make sure fpm is in /usr/bin..
It seems that the problem came because the fpm was installed in the /home/user2connect/bin/, and the command was not recognised. For fixing this I had to call it wit the whole path:
/home/user2connect/bin/fpm ...
I have chosen to reinstall the fpm using sudo, so now it works.

Unable to execute Ubuntu bash command with Process.run

I have a simple command I want to execute and process the result back in Dart, but I am failing to do this on my Ubuntu server.
On my Windows desktop, I can execute this without problems, but I am not able to create the correct command in Ubuntu.
This is what I am trying (I got this from Why can't Dart's "Process.start" execute an Ubuntu command when the command works in Ubuntu terminal?):
Process.run('bash', ['-c', '/usr/bin/python -V']).then((ProcessResult results) {
print(results.stdout);
print(results.stderr);
});
When I execute this, I get the following error:
bash: /usr/bin/python: No such file or directory
Obviously, python is installed, available at /usr/bin/python and is working fine.
The strange thing is, executing this works fine:
Process.run('bash', ['-c', 'git version']).then((ProcessResult results) {
print(results.stdout);
print(results.stderr);
});
I can't see any difference in executing the python command versus the git command...
Can anyone see something wrong?
Thanks in advance!

Resources