Error when building bazel 0.2.3 from source

172 views
Skip to first unread message

free...@gmail.com

unread,
Jun 22, 2016, 10:11:01 PM6/22/16
to bazel-discuss
Hi,

I'm trying to build a binary from source for bazel 0.2.3 on a Centos5 environment, the kernel version is 2.6.54. It is pretty old but I cannot control this thing. I encountered some problems:

I commented out the target "//src/main/tools:namespace-sandbox" from BUILD files to avoid some problems based on the discussion: https://groups.google.com/forum/#!msg/bazel-discuss/WWGNIlNq4fU/pxoakp1nfWcJ


But I encountered another ERROR: /home/nlu/bazel/bazel-0.2.3/third_party/grpc/BUILD:49:1: C++ compilation of rule '//third_party/grpc:grpc_unsecure' failed: gcc failed: error executing command
h->epoll_fd = epoll_create1(EPOLL_CLOEXEC);

Any suggestion on how to resolve the second error?

free...@gmail.com

unread,
Jun 22, 2016, 10:12:20 PM6/22/16
to bazel-discuss, free...@gmail.com
The complete error message is as follows:

third_party/grpc/src/core/iomgr/pollset_multipoller_with_epoll.c: In function 'epoll_become_multipoller':
third_party/grpc/src/core/iomgr/pollset_multipoller_with_epoll.c:293:31: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)
h->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
^

Brian Silverman

unread,
Jun 23, 2016, 2:07:56 AM6/23/16
to free...@gmail.com, bazel-discuss
That looks like an issue with grpc and your glibc version. This discussion on their mailing list includes a patch that looks like it should fix the problem. Can you give that a try (apply it to the grpc tree in third_party/grpc)?

It doesn't look like that patch made it into current grpc master, so if it helps you, I think the next steps are to work with the grpc people to get it merged and then get the new version into Bazel afterwards.

--
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-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cde2e361-c9e6-46eb-85db-867316f593fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

free...@gmail.com

unread,
Jun 23, 2016, 7:53:27 PM6/23/16
to bazel-discuss, free...@gmail.com
Hi Brian,

Thanks for the replying. I changed the source based the discussion you mentioned. After that, I got the following errors:

src/main/native/unix_jni.cc: In function 'void Java_com_google_devtools_build_lib_unix_NativePosixFiles_utime(JNIEnv*, jclass, jstring, jboolean, jint)':
src/main/native/unix_jni.cc:479:34: error: 'UTIME_OMIT' was not declared in this scope
struct timespec spec[2] = {{0, UTIME_OMIT}, {modtime, now ? UTIME_NOW : 0}};
^
src/main/native/unix_jni.cc:479:63: error: 'UTIME_NOW' was not declared in this scope
struct timespec spec[2] = {{0, UTIME_OMIT}, {modtime, now ? UTIME_NOW : 0}};
^
src/main/native/unix_jni.cc:480:7: error: '::utimensat' has not been declared
if (::utimensat(AT_FDCWD, path_chars, spec, 0) == -1) {
^
Target //src:bazel failed to build

I think it's kind of similar to the previous problem, I'm trying to fix this. And will update when I have some findings.

n...@twitter.com

unread,
Jun 24, 2016, 7:41:01 PM6/24/16
to bazel-discuss, free...@gmail.com
I was able to have a executable binary bazel after fixing the last issue.

One more question, is there any way to build a .sh installer(like, bazel-0.3.0-installer-linux-x86_64.sh) from the source code?

free...@gmail.com

unread,
Jun 24, 2016, 7:51:19 PM6/24/16
to bazel-discuss, free...@gmail.com, n...@twitter.com
NVM, I found the rule in scripts/package/BUILD file
Reply all
Reply to author
Forward
0 new messages