Build error in Bazel

2,467 views
Skip to first unread message

Santosh kumar Panda

unread,
Nov 9, 2018, 4:45:26 AM11/9/18
to ONOS Developers
Hi,

I have tried to build ONOS with Bazel. The Bazel version is 0.17. I got the error as per the attached file.

Thanks,
Santosh
Bazel_build_error.JPG

laszl...@hubersuhner.com

unread,
Nov 9, 2018, 5:39:19 AM11/9/18
to santosh...@gmail.com, onos...@onosproject.org
Please do not use images for compilation errors as it is difficult to google the text from it, even with online OCR software. Just copy and paste the text in the future.

By the way, I also get an early build error after cloning onos:

bazel run onos-local -- clean debug
Extracting Bazel installation...
WARNING: detected http_proxy set in env, setting no_proxy for localhost.
Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/rules_nodejs/archive/0.11.5.tar.gz) = 7997f40731eb77ca765784ae562a81a987b87fb8bdefd5a2491d282b3532e7e1
INFO: SHA256 (https://github.com/bazelbuild/buildtools/archive/a90c3a9f00e27973d3e759d17f2e2e7d9702d91b.zip) = 0bdd22f4aaa7f4e8d3249f1bc76ce29e41b26be500f5dd61fbf3fdbd8c745e63
INFO: SHA256 (https://github.com/bazelbuild/rules_go/releases/download/0.14.0/rules_go-0.14.0.tar.gz) = 5756a4ad75b3703eb68249d50e23f5d64eaf1593e886b9aa931aa6e938c4e301
INFO: Analysed target //:onos-local (735 packages loaded, 11706 targets configured).
INFO: Found 1 target...
ERROR: /home/lpapp/Projects/polatis/onos/tools/build/cfgdef/BUILD:8:1: Building tools/build/cfgdef/cfgdef_generator.jar (1 source file) failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at /home/lpapp/.cache/bazel/_bazel_lpapp/37d256ed3bc0e6d6e5e84277e71146b7/bazel-workers/worker-0-Javac.log ---8<---8<---
Unrecognized VM option 'CompactStrings'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
---8<---8<--- End of log ---8<---8<---
Target //:onos-local failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 101.828s, Critical Path: 5.44s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 6 processes: 6 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully




For information
concerning the processing of your personal data according to Art. 13, 14 GDPR
please refer to our Data Protection Statement at
https://www.hubersuhner.com/en/data-protection-statement.

This message
is confidential. It may also be privileged or otherwise protected by work
product immunity or other legal rules. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. Please note that any views or opinions presented
in this email are solely those of the author and do not necessarily represent
those of the company. All deliveries and services are subject to our General
Terms and Conditions of Sales.

Although the company has taken reasonable
precautions to ensure no viruses are present in this email, the company cannot
accept responsibility for any loss or damage arising from the use of this email
or attachments.


_______________________________________
From: Santosh kumar Panda [santosh...@gmail.com]
Sent: 09 November 2018 09:45
To: ONOS Developers
Subject: [onos-dev] Build error in Bazel
--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org<mailto:onos-dev+u...@onosproject.org>.
To post to this group, send email to onos...@onosproject.org<mailto:onos...@onosproject.org>.
Visit this group at https://groups.google.com/a/onosproject.org/group/onos-dev/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/294926d1-9b2d-4d85-be01-693ba2cfcd03%40onosproject.org<https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/294926d1-9b2d-4d85-be01-693ba2cfcd03%40onosproject.org?utm_medium=email&utm_source=footer>.

Thomas Vachuska

unread,
Nov 9, 2018, 12:25:10 PM11/9/18
to laszl...@hubersuhner.com, santosh...@gmail.com, onos...@onosproject.org
Please note that if you have any local changes that involve CLI, configurable properties, and other SCR or OSGi annotations, you will have to convert them to the revised form per the document. 

Thomas
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To post to this group, send email to onos...@onosproject.org.

laszl...@hubersuhner.com

unread,
Nov 12, 2018, 6:34:10 AM11/12/18
to santosh...@gmail.com, onos...@onosproject.org
I fixed this issue.

It seems that my JAVA_HOME environment variable is set to the Java 8 OpenJDK location. This is historical. I had to update it to point to the Java 10 OpenJDK location in my ~/.bashrc file.

Interestingly enough, the wiki, that used to refer to the requirement of setting JAVA_HOME, no longer mentions this.



For information
concerning the processing of your personal data according to Art. 13, 14 GDPR
please refer to our Data Protection Statement at
https://www.hubersuhner.com/en/data-protection-statement.

This message
is confidential. It may also be privileged or otherwise protected by work
product immunity or other legal rules. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. Please note that any views or opinions presented
in this email are solely those of the author and do not necessarily represent
those of the company. All deliveries and services are subject to our General
Terms and Conditions of Sales.

Although the company has taken reasonable
precautions to ensure no viruses are present in this email, the company cannot
accept responsibility for any loss or damage arising from the use of this email
or attachments.


________________________________________
From: Papp Laszlo
Sent: 09 November 2018 10:39
To: Santosh kumar Panda; ONOS Developers
Subject: RE: [onos-dev] Build error in Bazel

Please do not use images for compilation errors as it is difficult to google the text from it, even with online OCR software. Just copy and paste the text in the future.

By the way, I also get an early build error after cloning onos:

bazel run onos-local -- clean debug
Extracting Bazel installation...
WARNING: detected http_proxy set in env, setting no_proxy for localhost.
Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/rules_nodejs/archive/0.11.5.tar.gz) = 7997f40731eb77ca765784ae562a81a987b87fb8bdefd5a2491d282b3532e7e1
INFO: SHA256 (https://github.com/bazelbuild/buildtools/archive/a90c3a9f00e27973d3e759d17f2e2e7d9702d91b.zip) = 0bdd22f4aaa7f4e8d3249f1bc76ce29e41b26be500f5dd61fbf3fdbd8c745e63
INFO: SHA256 (https://github.com/bazelbuild/rules_go/releases/download/0.14.0/rules_go-0.14.0.tar.gz) = 5756a4ad75b3703eb68249d50e23f5d64eaf1593e886b9aa931aa6e938c4e301
INFO: Analysed target //:onos-local (735 packages loaded, 11706 targets configured).
INFO: Found 1 target...
ERROR: /home/lpapp/Projects/polatis/onos/tools/build/cfgdef/BUILD:8:1: Building tools/build/cfgdef/cfgdef_generator.jar (1 source file) failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at /home/lpapp/.cache/bazel/_bazel_lpapp/37d256ed3bc0e6d6e5e84277e71146b7/bazel-workers/worker-0-Javac.log ---8<---8<---
Unrecognized VM option 'CompactStrings'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
---8<---8<--- End of log ---8<---8<---
Target //:onos-local failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 101.828s, Critical Path: 5.44s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 6 processes: 6 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

Message has been deleted

Victor ocheri

unread,
Oct 20, 2020, 7:31:53 PM10/20/20
to ONOS Developers, tom, santosh...@gmail.com, onos...@onosproject.org, laszlo.papp
Sorry to phrase my question clearly, When I try to builds ONOS with bazel 3.6.0,  I get stuck on the error given below

  'build' options: --javabase=@org_onosproject_onos//tools/build/jdk:default_jdk --host_javabase=@org_onosproject_onos//
tools/build/jdk:default_jdk --java_toolchain=@org_onosproject_onos//tools/build/jdk:default_toolchain --host_java_toolch
ain=@org_onosproject_onos//tools/build/jdk:default_toolchain --host_force_python=PY2 --nouse_ijars --experimental_strict
_action_env --incompatible_new_actions_api=false --incompatible_generated_protos_in_virtual_imports=false --incompatible
_depset_union=false --define=angular_ivy_enabled=True
ERROR: --incompatible_depset_union=false :: Unrecognized option: --incompatible_depset_union=false

Could any of help me find what might be wrong?

Thanks

Eder Ollora Zaballa

unread,
Oct 20, 2020, 8:03:55 PM10/20/20
to Victor ocheri, tom, santosh...@gmail.com, onos...@onosproject.org, laszlo.papp
Hi Victor,

 I am on my phone but if you check the wiki, when it comes to build ONOS now the process does not involve using an specific Bazel version but devs recommend using Bazelisk which is in charge of downloading the appropriate version of Bazel for you. Maybe the error might be that you are using an incorrect version of Bazel. Try using Bazelisk :) 

Victor ocheri

unread,
Oct 21, 2020, 7:56:56 AM10/21/20
to ONOS Developers, Eder Ollora, onos...@onosproject.org
Hi Eder,

I installed Bazelisk, but I still get the same error. I 'm trying to build ONOS 3.0.0 with bazel, to be specific.

Details of the error:

INFO: Reading rc options for 'build' from c:\users\voche\onos\.bazelrc:

'build' options: --javabase=@org_onosproject_onos//tools/build/jdk:default_jdk --host_javabase=@org_onosproject_onos//
tools/build/jdk:default_jdk --java_toolchain=@org_onosproject_onos//tools/build/jdk:default_toolchain --host_java_toolch
ain=@org_onosproject_onos//tools/build/jdk:default_toolchain --host_force_python=PY2 --nouse_ijars --experimental_strict
_action_env --incompatible_new_actions_api=false --incompatible_generated_protos_in_virtual_imports=false --incompatible
_depset_union=false --define=angular_ivy_enabled=True
ERROR: --incompatible_depset_union=false :: Unrecognized option: --incompatible_depset_union=false

You would find it to be the same.

It is advisable to use an older version of bazel to build ONOS?


Eder Ollora

unread,
Oct 21, 2020, 9:12:12 AM10/21/20
to ONOS Developers, Victor ocheri, Eder Ollora, onos...@onosproject.org

Hi Victor,

ONOS 3.0.0 does not exist yet, the latest tagged version is 2.4, I think. Try to checkout ONOS 2.3, 2.4 or even master. 


I think that you sometimes have problems if you have installed a Bazel version on your own and then use Bazelisk so try to uninstall any Bazel version you have installed on your own at the beggining.

If you still have an error, please, post the command you run and the output :).

Thanks!

Sean Condon

unread,
Oct 21, 2020, 9:22:33 AM10/21/20
to Eder Ollora, Victor ocheri, onos...@onosproject.org
Please use Bazelisk to get the appropriate version of Bazel for the version of ONOS that you are building. It reads from the .bazelversion file

See:



--
Sean Condon
Member of Technical Staff
Open Networking Foundation

Victor ocheri

unread,
Oct 21, 2020, 1:42:32 PM10/21/20
to ONOS Developers, se...@opennetworking.org, Victor ocheri, onos...@onosproject.org, Eder Ollora
Eder and Sean,

Thanks  for your help so far.  

I tried all the procedures you pointed me to in the project's wiki (using Baselisk) and I'm face with a new error when i try to build ONOS. Detail of what I did and the error is shown below:

PS C:\Users\voche> cd .\onos\
PS C:\Users\voche\onos> bazelisk version
Bazelisk version: v1.7.1
Extracting Bazel installation...

Starting local Bazel server and connecting to it...
Build label: 3.0.0
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Apr 6 12:56:01 2020 (1586177761)
Build timestamp: 1586177761
Build timestamp as int: 1586177761

PS C:\Users\voche\onos> bazelisk build onos
INFO: Call stack for the definition of repository 'gui1_npm' which is a npm_install (rule definition at C:/users/voche/_
bazel_voche/x3hfsdwv/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:309:15):
- <builtin>
- C:/users/voche/_bazel_voche/x3hfsdwv/external/build_bazel_rules_nodejs/index.bzl:80:5
- C:/users/voche/onos/WORKSPACE:179:1
ERROR: An error occurred during the fetch of repository 'gui1_npm':
npm_install failed:
> onos-gu...@2.3.0 postinstall C:\Users\voche\onos\tools\gui
> ppid=$(ps -p ${1:-$$} -o ppid=;); ppid=$(echo ${ppid}|tr -d '[[:space:]]'); if [ -z ${npm_config_tmp} ]; then npm_conf
ig_tmp=/tmp; fi; rm -rf "${npm_config_tmp}"/npm-${ppid}*

('ppid' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! onos-gu...@2.3.0 postinstall: `ppid=$(ps -p ${1:-$$} -o ppid=;); ppid=$(echo ${ppid}|tr -d '[[:space:]]');
if [ -z ${npm_config_tmp} ]; then npm_config_tmp=/tmp; fi; rm -rf "${npm_config_tmp}"/npm-${ppid}*`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the onos-gu...@2.3.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\voche\AppData\Roaming\npm-cache\_logs\2020-10-21T17_24_04_478Z-debug.log
)

Sean, I noted a previous comment you made  here on removing previous npm installation, so I got rid of mine before attempting to build ONOS.

Am new to this, so the version number  I assigned for ONOS in my previous post was actually the bazel version number for building ONOS in the .baselversion file.  

Victor

Sean Condon

unread,
Oct 21, 2020, 2:42:18 PM10/21/20
to Victor ocheri, onos...@onosproject.org, Eder Ollora
It looks like you are trying to build on Windows 

Only Linux and MacOS are supported
Message has been deleted

Eder Ollora

unread,
Oct 21, 2020, 3:01:43 PM10/21/20
to ONOS Developers, se...@opennetworking.org, onos...@onosproject.org, Eder Ollora, Victor ocheri
Sean is right, I didn't even notice it when reading the error :)

Victor ocheri

unread,
Oct 21, 2020, 4:29:36 PM10/21/20
to ONOS Developers, Eder Ollora, se...@opennetworking.org, onos...@onosproject.org, Victor ocheri
I see. Thanks for this. 

I switched to using Ubuntu in Windows Subsystem for Linux (WSL)  and the build appears to be going well. Will give update when it is done.

Just a thought. It might be helpful to state explicitly on the project's wiki that Windows OS is not supported. It might be helpful newbies like me. 

I'm Immensely grateful for the help.

Sean Condon

unread,
Oct 21, 2020, 4:44:38 PM10/21/20
to Victor ocheri, Eder Ollora, onos...@onosproject.org

Victor ocheri

unread,
Oct 22, 2020, 3:22:43 AM10/22/20
to ONOS Developers, se...@opennetworking.org, Eder Ollora, onos...@onosproject.org, Victor ocheri
Hi again,

I tired the build again, but I get the following error:

viktorock@DESKTOP-96EUSQO:/mnt/c/Users/voche$ cd onos/
viktorock@DESKTOP-96EUSQO:/mnt/c/Users/voche/onos$ bazel version
Bazelisk version: v1.7.3

Starting local Bazel server and connecting to it...
Build label: 3.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Apr 6 12:52:37 2020 (1586177557)
Build timestamp: 1586177557
Build timestamp as int: 1586177557

viktorock@DESKTOP-96EUSQO:/mnt/c/Users/voche/onos$ bazel build onos
INFO: Analyzed target //:onos (1662 packages loaded, 56514 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /home/viktorock/.cache/bazel/_bazel_viktorock/1826cf887035299999b2b87da46a454f/sandbox
ERROR: /mnt/c/Users/voche/onos/web/api/BUILD:11:1: Building Java resource jar failed (Exit 1) singlejar_local failed: er
ror executing command external/remote_java_tools_linux/java_tools/src/tools/singlejar/singlejar_local --normalize --dont
_change_compression --exclude_build_data --output ... (remaining 33 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
singlejar_local: ./src/tools/singlejar/mapped_file_posix.inc:54: mmap web/api/src/main/resources/docs/css/typography.css
:: Exec format error
singlejar_local: src/tools/singlejar/output_jar.cc:958: web/api/src/main/resources/docs/css/typography.css: Exec format
error
Target //:onos failed to build

Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 911.401s, Critical Path: 85.31s
INFO: 1 process: 1 local.

FAILED: Build did NOT complete successfully

What could be the problem?

Thanks

Sean Condon

unread,
Oct 22, 2020, 3:28:05 AM10/22/20
to Victor ocheri, Eder Ollora, onos...@onosproject.org
I have not seen this before. You have Java 11 installed?
I would suggest running the build again - maybe something times out - I can see you're up to 911 seconds

ramon.c...@gmail.com

unread,
Oct 22, 2020, 3:44:14 AM10/22/20
to Sean Condon, Victor ocheri, Eder Ollora, onos...@onosproject.org

Hi

 

Just a hint, in case it helps.

 

“exec format error” appears often within the Windows Subsystem for Linux (WSL) . There have been bugs in the WSL subsystem that have triggered this; for example: https://github.com/microsoft/WSL/issues/3451

 

I would start with :

 

- What windows version are you using (1803, etc)

 

- What WSL version (1 or 2)

 

I usually recommend WSL 2 when possible

Victor ocheri

unread,
Oct 22, 2020, 7:20:02 AM10/22/20
to ONOS Developers, Ramon Casellas, Eder Ollora, onos...@onosproject.org, se...@opennetworking.org, Victor ocheri
Hi Ramon, Sean and Eder,

After upgrading from WSL 1 to WSL 2, I finally got a successful build:



Now I would go ahead and take ONOS for a spin.

So much thanks to you all for your patience. Looking forward to helping were I can.

Victor

Eder Ollora

unread,
Oct 22, 2020, 7:21:36 AM10/22/20
to ONOS Developers, Ramon Casellas, Eder Ollora, onos...@onosproject.org, se...@opennetworking.org, Victor ocheri
I'm happy to see that. Such a good catch from @Ramon! no idea about this issues with WSL :)

Sean Condon

unread,
Oct 22, 2020, 7:31:27 AM10/22/20
to Eder Ollora, Ramon Casellas, onos...@onosproject.org, Victor ocheri
Yes - thanks Ramon - I thank God for every day I do not have to use Windows
Reply all
Reply to author
Forward
0 new messages