Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to build Bazel (4.0) in a rootless environment on Ubuntu Jammy #3

Closed
Tracked by #1
j-rivero opened this issue Feb 21, 2023 · 2 comments · Fixed by #4
Closed
Tracked by #1

Try to build Bazel (4.0) in a rootless environment on Ubuntu Jammy #3

j-rivero opened this issue Feb 21, 2023 · 2 comments · Fixed by #4
Labels
enhancement New feature or request

Comments

@j-rivero
Copy link
Collaborator

Part of #1

After the works in #2 we probably require Bazel 4.0 to build Drake on Ubuntu Jammy. The Bazel from source compilation uses a previous version of Bazel to bootstrap new Bazel so there is a chance that we can build Bazel 4.0 under a non root account using the system 3.5.1 version on Ubuntu Jammy and use that version to compile Drake instead of the system one.

@j-rivero j-rivero added the enhancement New feature or request label Feb 21, 2023
@j-rivero
Copy link
Collaborator Author

j-rivero commented Feb 21, 2023

A quick run for testing shown that it should be possible but there are compilers errors:

#10 41.75 INFO: Analyzed target //src:bazel-dev (326 packages loaded, 8662 targets configured).
#10 41.76 INFO: Found 1 target...
#10 41.91 [0 / 638] [Prepa] Writing file src/embedded_tools_jdk_allmodules.params
#10 49.06 [19 / 834] Compiling external/com_google_protobuf/src/google/protobuf/arena.cc; 1s processwrapper-sandbox ... (3 actions, 2 running)
#10 56.50 [37 / 834] Compiling external/com_google_protobuf/src/google/protobuf/generated_message_table_driven_lite.cc; 2s processwrapper-sandbox ... (4 actions, 3 running)
#10 64.69 INFO: From Compiling external/com_google_protobuf/src/google/protobuf/message_lite.cc [for host]:
#10 64.71 In file included from /usr/include/string.h:535,
#10 64.71                  from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
#10 64.71                  from external/com_google_protobuf/src/google/protobuf/stubs/macros.h:34,
#10 64.71                  from external/com_google_protobuf/src/google/protobuf/stubs/common.h:46,
#10 64.71                  from external/com_google_protobuf/src/google/protobuf/message_lite.h:45,
#10 64.71                  from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
#10 64.71 In function 'void* memcpy(void*, const void*, size_t)',
#10 64.71     inlined from 'google::protobuf::uint8* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, google::protobuf::uint8*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:699:16,
#10 64.71     inlined from 'virtual google::protobuf::uint8* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(google::protobuf::uint8*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:85:28,
#10 64.71     inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:419:30:
#10 64.71 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
#10 64.71    29 |   return __builtin___memcpy_chk (__dest, __src, __len,
#10 64.71       |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#10 64.71    30 |                                  __glibc_objsize0 (__dest));
#10 64.71       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
#10 64.73 [59 / 834] Compiling external/com_google_protobuf/src/google/protobuf/repeated_field.cc [for host]; 2s processwrapper-sandbox ... (4 actions, 3 running)
#10 74.03 [76 / 834] Compiling external/com_google_protobuf/src/google/protobuf/generated_message_util.cc [for host]; 3s processwrapper-sandbox ... (4 actions, 3 running)
#10 84.76 [171 / 834] Compiling external/com_github_grpc_grpc/src/core/lib/debug/trace.cc; 0s processwrapper-sandbox ... (4 actions, 3 running)
#10 91.23 ERROR: /home/buildfarm/.cache/bazel/_bazel_buildfarm/ee8532c5c69dfff0fd0d0cf9658f23d3/external/com_google_absl/absl/synchronization/BUILD.bazel:30:11: C++ compilation of rule '@com_google_absl//absl/synchronization:graphcycles_internal' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 31 argument(s) skipped)
#10 91.23 
#10 91.23 Use --sandbox_debug to see verbose messages from the sandbox
#10 91.23 external/com_google_absl/absl/synchronization/internal/graphcycles.cc: In member function 'void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)':
#10 91.23 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:26: error: 'numeric_limits' is not a member of 'std'
#10 91.23   451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
#10 91.23       |                          ^~~~~~~~~~~~~~
#10 91.23 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before '>' token
#10 91.23   451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
#10 91.23       |                                                 ^
#10 91.23 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:52: error: '::max' has not been declared; did you mean 'std::max'?
#10 91.23   451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
#10 91.23       |                                                    ^~~
#10 91.23       |                                                    std::max
#10 91.23 In file included from /usr/include/c++/11/algorithm:62,
#10 91.23                  from external/com_google_absl/absl/synchronization/internal/graphcycles.cc:38:
#10 91.23 /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here
#10 91.23  3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
#10 91.23       |     ^~~
#10 91.37 Target //src:bazel-dev failed to build
#10 91.38 Use --verbose_failures to see the command lines of failed build steps.

Seems to be reported in bazelbuild/bazel#12756. Still open.

@j-rivero
Copy link
Collaborator Author

Patching it is able to compile 🚀 around 21 min in Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz old MacMini.

@j-rivero j-rivero changed the title Get the required version of Bazel (4.0) into the ros_buildfarm for supported platforms Try to build Bazel (4.0) in a rootless enviroment on Ubuntu Jammy Feb 21, 2023
@j-rivero j-rivero changed the title Try to build Bazel (4.0) in a rootless enviroment on Ubuntu Jammy Try to build Bazel (4.0) in a rootless environment on Ubuntu Jammy Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant