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

Unable to find bvar package on Ubuntu 20.04+ #15614

Closed
minhanghuang opened this issue Dec 14, 2024 · 8 comments
Closed

Unable to find bvar package on Ubuntu 20.04+ #15614

minhanghuang opened this issue Dec 14, 2024 · 8 comments

Comments

@minhanghuang
Copy link

minhanghuang commented Dec 14, 2024

System information

  • OS Platform and Distribution: Ubuntu 20.04(x86_64)
  • Apollo installed from: source
  • Apollo version: master(v10)

Describe the bug

hi @daohu527, I am encountering an issue where I am unable to install the bvar package on Ubuntu 20.04+ systems using APT. The package is available and installable on Ubuntu 18.04, but on newer versions (such as Ubuntu 20.04 and 22.04), the package is not found in the repository.

image

  1. Add Apollo's APT repository to the system
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://apollo-pkg-beta.cdn.bcebos.com/neo/beta/key/deb.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/apolloauto.gpg
sudo chmod a+r /etc/apt/keyrings/apolloauto.gpg

echo \
    "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/apolloauto.gpg] https://apollo-pkg-beta.cdn.bcebos.com/apollo/core"\
    $(. /etc/os-release && echo "$VERSION_CODENAME") "main" | \
    sudo tee /etc/apt/sources.list.d/apolloauto.list
sudo apt-get update
  1. Attempt to install the bvar package
sudo apt install bvar
  1. Expected behavior:
    bvar package should be installed successfully on Ubuntu 20.04+.

  2. Actual behavior:
    The package cannot be found in the repository on Ubuntu 20.04+ (but it is available on Ubuntu 18.04).

Could you please assist with making bvar available for newer Ubuntu versions, or provide guidance on how to install it on Ubuntu 20.04+?

Thank you for your help.

@ycraurora
Copy link

ycraurora commented Dec 16, 2024

bvar is a component of bRPC. The source code can be found at the provided reference link, and it can be built from source. To build only bvar, the directories src/butil and src/bvar are required. These components depend on protobuf, gflags, and libssl-dev.

@minhanghuang
Copy link
Author

bvar is a component of bRPC. The source code can be found at the provided reference link, and it can be built from source. To build only bvar, the directories src/butil and src/bvar are required. These components depend on protobuf, gflags, and libssl-dev.

What version of bvar is used in Apollo?

@ycraurora
Copy link

ycraurora commented Dec 16, 2024

I'm not certain about that. I believe the latest version should be fine. I don't recall making any modifications while introducing the latest bvar, but not entirely sure about it.

@hearto1314
Copy link
Contributor

Hi @minhanghuang ,we recommend using Ubuntu 22.04 in host mode,and you can use docker container mode on ubuntu 20.04, please use aem start without -b host hava a try.

https://apollo.baidu.com/community/Apollo-Homepage-Document?doc=BYFxAcGcC4HpYIbgPYBtXIHQCMEEsATAV0wGNkBbWA5UyRFdZWVBEAU0hFgoIH0adPgCY%2BADwCiAVnEBBCeIAcATnETFcgMxKZkgGxKAwkoDsa3YoAi45WdGTd8paskaxs7WMW6JBr8a8zByVrMVtMUApUIA

@HanyuWu
Copy link

HanyuWu commented Dec 16, 2024

@minhanghuang , I finally build libcyber.so and examples upon your cmake-built version (tag: V10rc1) , as previously discussed, butil and bvar are needed, and we should choose the exact files we need in butil, or compile errors will show up. Here is my SRCs setup (just ignore the third_party_src path-prefix...):

set(BUTILS_SRCS 
    third_party_src/third_party/var/butil/third_party/dmg_fp/g_fmt.cc
    third_party_src/third_party/var/butil/third_party/dmg_fp/dtoa_wrapper.cc
    third_party_src/third_party/var/butil/third_party/dynamic_annotations/dynamic_annotations.c
    third_party_src/third_party/var/butil/third_party/icu/icu_utf.cc
    third_party_src/third_party/var/butil/third_party/superfasthash/superfasthash.c
    third_party_src/third_party/var/butil/third_party/modp_b64/modp_b64.cc
    third_party_src/third_party/var/butil/third_party/symbolize/demangle.cc
    third_party_src/third_party/var/butil/third_party/symbolize/symbolize.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy-sinksource.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy-stubs-internal.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy.cc
    third_party_src/third_party/var/butil/third_party/murmurhash3/murmurhash3.cpp
    third_party_src/third_party/var/butil/arena.cpp
    third_party_src/third_party/var/butil/at_exit.cc
    third_party_src/third_party/var/butil/atomicops_internals_x86_gcc.cc
    third_party_src/third_party/var/butil/base64.cc
    third_party_src/third_party/var/butil/base64url.cc
    third_party_src/third_party/var/butil/big_endian.cc
    third_party_src/third_party/var/butil/cpu.cc
    third_party_src/third_party/var/butil/debug/alias.cc
    third_party_src/third_party/var/butil/debug/asan_invalid_access.cc
    third_party_src/third_party/var/butil/debug/crash_logging.cc
    third_party_src/third_party/var/butil/debug/debugger.cc
    third_party_src/third_party/var/butil/debug/debugger_posix.cc
    third_party_src/third_party/var/butil/debug/dump_without_crashing.cc
    third_party_src/third_party/var/butil/debug/proc_maps_linux.cc
    third_party_src/third_party/var/butil/debug/stack_trace.cc
    third_party_src/third_party/var/butil/debug/stack_trace_posix.cc
    third_party_src/third_party/var/butil/environment.cc
    third_party_src/third_party/var/butil/files/file.cc
    third_party_src/third_party/var/butil/files/file_posix.cc
    third_party_src/third_party/var/butil/files/file_enumerator.cc
    third_party_src/third_party/var/butil/files/file_enumerator_posix.cc
    third_party_src/third_party/var/butil/files/file_path.cc
    third_party_src/third_party/var/butil/files/file_path_constants.cc
    third_party_src/third_party/var/butil/files/memory_mapped_file.cc
    third_party_src/third_party/var/butil/files/memory_mapped_file_posix.cc
    third_party_src/third_party/var/butil/files/scoped_file.cc
    third_party_src/third_party/var/butil/files/scoped_temp_dir.cc
    third_party_src/third_party/var/butil/file_util.cc
    third_party_src/third_party/var/butil/file_util_posix.cc
    third_party_src/third_party/var/butil/guid.cc
    third_party_src/third_party/var/butil/guid_posix.cc
    third_party_src/third_party/var/butil/hash.cc
    third_party_src/third_party/var/butil/lazy_instance.cc
    third_party_src/third_party/var/butil/location.cc
    third_party_src/third_party/var/butil/memory/aligned_memory.cc
    third_party_src/third_party/var/butil/memory/ref_counted.cc
    third_party_src/third_party/var/butil/memory/ref_counted_memory.cc
    third_party_src/third_party/var/butil/memory/singleton.cc
    third_party_src/third_party/var/butil/memory/weak_ptr.cc
    third_party_src/third_party/var/butil/posix/file_descriptor_shuffle.cc
    third_party_src/third_party/var/butil/posix/global_descriptors.cc
    third_party_src/third_party/var/butil/process_util.cc
    third_party_src/third_party/var/butil/rand_util.cc
    third_party_src/third_party/var/butil/rand_util_posix.cc
    third_party_src/third_party/var/butil/fast_rand.cpp
    third_party_src/third_party/var/butil/safe_strerror_posix.cc
    third_party_src/third_party/var/butil/sha1_portable.cc
    third_party_src/third_party/var/butil/strings/latin1_string_conversions.cc
    third_party_src/third_party/var/butil/strings/nullable_string16.cc
    third_party_src/third_party/var/butil/strings/safe_sprintf.cc
    third_party_src/third_party/var/butil/strings/string16.cc
    third_party_src/third_party/var/butil/strings/string_number_conversions.cc
    third_party_src/third_party/var/butil/strings/string_split.cc
    third_party_src/third_party/var/butil/strings/string_piece.cc
    third_party_src/third_party/var/butil/strings/string_util.cc
    third_party_src/third_party/var/butil/strings/string_util_constants.cc
    third_party_src/third_party/var/butil/strings/stringprintf.cc
    third_party_src/third_party/var/butil/strings/utf_offset_string_conversions.cc
    third_party_src/third_party/var/butil/strings/utf_string_conversion_utils.cc
    third_party_src/third_party/var/butil/strings/utf_string_conversions.cc
    third_party_src/third_party/var/butil/synchronization/cancellation_flag.cc
    third_party_src/third_party/var/butil/synchronization/condition_variable_posix.cc
    third_party_src/third_party/var/butil/synchronization/waitable_event_posix.cc
    third_party_src/third_party/var/butil/threading/non_thread_safe_impl.cc
    third_party_src/third_party/var/butil/threading/platform_thread_posix.cc
    third_party_src/third_party/var/butil/threading/simple_thread.cc
    third_party_src/third_party/var/butil/threading/thread_checker_impl.cc
    third_party_src/third_party/var/butil/threading/thread_collision_warner.cc
    third_party_src/third_party/var/butil/threading/thread_id_name_manager.cc
    third_party_src/third_party/var/butil/threading/thread_local_posix.cc
    third_party_src/third_party/var/butil/threading/thread_local_storage.cc
    third_party_src/third_party/var/butil/threading/thread_local_storage_posix.cc
    third_party_src/third_party/var/butil/threading/thread_restrictions.cc
    third_party_src/third_party/var/butil/threading/watchdog.cc
    third_party_src/third_party/var/butil/time/clock.cc
    third_party_src/third_party/var/butil/time/default_clock.cc
    third_party_src/third_party/var/butil/time/default_tick_clock.cc
    third_party_src/third_party/var/butil/time/tick_clock.cc
    third_party_src/third_party/var/butil/time/time.cc
    third_party_src/third_party/var/butil/time/time_posix.cc
    third_party_src/third_party/var/butil/version.cc
    third_party_src/third_party/var/butil/logging.cc
    third_party_src/third_party/var/butil/class_name.cpp
    third_party_src/third_party/var/butil/errno.cpp
    third_party_src/third_party/var/butil/find_cstr.cpp
    third_party_src/third_party/var/butil/status.cpp
    third_party_src/third_party/var/butil/string_printf.cpp
    third_party_src/third_party/var/butil/thread_local.cpp
    third_party_src/third_party/var/butil/thread_key.cpp
    third_party_src/third_party/var/butil/unix_socket.cpp
    third_party_src/third_party/var/butil/endpoint.cpp
    third_party_src/third_party/var/butil/fd_utility.cpp
    third_party_src/third_party/var/butil/files/temp_file.cpp
    third_party_src/third_party/var/butil/files/file_watcher.cpp
    third_party_src/third_party/var/butil/time.cpp
    third_party_src/third_party/var/butil/zero_copy_stream_as_streambuf.cpp
    third_party_src/third_party/var/butil/crc32c.cc
    third_party_src/third_party/var/butil/containers/case_ignored_flat_map.cpp
    third_party_src/third_party/var/butil/iobuf.cpp
    third_party_src/third_party/var/butil/iobuf_profiler.cpp
    third_party_src/third_party/var/butil/binary_printer.cpp
    third_party_src/third_party/var/butil/recordio.cc
    third_party_src/third_party/var/butil/popen.cpp
    third_party_src/third_party/var/butil/file_util_linux.cc
    third_party_src/third_party/var/butil/threading/platform_thread_linux.cc
    third_party_src/third_party/var/butil/strings/sys_string_conversions_posix.cc
)

I haven't installed google-perftools yet, so I ignored the sub-directory mainboard and tools.

1734352696_grim

By the way, eProsima namespace and eProsima_wrap is tricky too, I work-around a bit by rewriting some source codes in Cyber to make it compiled.

@minhanghuang
Copy link
Author

Hi @minhanghuang ,we recommend using Ubuntu 22.04 in host mode,and you can use docker container mode on ubuntu 20.04, please use aem start without -b host hava a try.

https://apollo.baidu.com/community/Apollo-Homepage-Document?doc=BYFxAcGcC4HpYIbgPYBtXIHQCMEEsATAV0wGNkBbWA5UyRFdZWVBEAU0hFgoIH0adPgCY%2BADwCiAVnEBBCeIAcATnETFcgMxKZkgGxKAwkoDsa3YoAi45WdGTd8paskaxs7WMW6JBr8a8zByVrMVtMUApUIA

@hearto1314 Thank you very much! This is a great solution. However, I hope to use Cyber standalone on different versions of Ubuntu

@minhanghuang
Copy link
Author

@minhanghuang , I finally build libcyber.so and examples upon your cmake-built version (tag: V10rc1) , as previously discussed, butil and bvar are needed, and we should choose the exact files we need in butil, or compile errors will show up. Here is my SRCs setup (just ignore the third_party_src path-prefix...):

set(BUTILS_SRCS 
    third_party_src/third_party/var/butil/third_party/dmg_fp/g_fmt.cc
    third_party_src/third_party/var/butil/third_party/dmg_fp/dtoa_wrapper.cc
    third_party_src/third_party/var/butil/third_party/dynamic_annotations/dynamic_annotations.c
    third_party_src/third_party/var/butil/third_party/icu/icu_utf.cc
    third_party_src/third_party/var/butil/third_party/superfasthash/superfasthash.c
    third_party_src/third_party/var/butil/third_party/modp_b64/modp_b64.cc
    third_party_src/third_party/var/butil/third_party/symbolize/demangle.cc
    third_party_src/third_party/var/butil/third_party/symbolize/symbolize.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy-sinksource.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy-stubs-internal.cc
    third_party_src/third_party/var/butil/third_party/snappy/snappy.cc
    third_party_src/third_party/var/butil/third_party/murmurhash3/murmurhash3.cpp
    third_party_src/third_party/var/butil/arena.cpp
    third_party_src/third_party/var/butil/at_exit.cc
    third_party_src/third_party/var/butil/atomicops_internals_x86_gcc.cc
    third_party_src/third_party/var/butil/base64.cc
    third_party_src/third_party/var/butil/base64url.cc
    third_party_src/third_party/var/butil/big_endian.cc
    third_party_src/third_party/var/butil/cpu.cc
    third_party_src/third_party/var/butil/debug/alias.cc
    third_party_src/third_party/var/butil/debug/asan_invalid_access.cc
    third_party_src/third_party/var/butil/debug/crash_logging.cc
    third_party_src/third_party/var/butil/debug/debugger.cc
    third_party_src/third_party/var/butil/debug/debugger_posix.cc
    third_party_src/third_party/var/butil/debug/dump_without_crashing.cc
    third_party_src/third_party/var/butil/debug/proc_maps_linux.cc
    third_party_src/third_party/var/butil/debug/stack_trace.cc
    third_party_src/third_party/var/butil/debug/stack_trace_posix.cc
    third_party_src/third_party/var/butil/environment.cc
    third_party_src/third_party/var/butil/files/file.cc
    third_party_src/third_party/var/butil/files/file_posix.cc
    third_party_src/third_party/var/butil/files/file_enumerator.cc
    third_party_src/third_party/var/butil/files/file_enumerator_posix.cc
    third_party_src/third_party/var/butil/files/file_path.cc
    third_party_src/third_party/var/butil/files/file_path_constants.cc
    third_party_src/third_party/var/butil/files/memory_mapped_file.cc
    third_party_src/third_party/var/butil/files/memory_mapped_file_posix.cc
    third_party_src/third_party/var/butil/files/scoped_file.cc
    third_party_src/third_party/var/butil/files/scoped_temp_dir.cc
    third_party_src/third_party/var/butil/file_util.cc
    third_party_src/third_party/var/butil/file_util_posix.cc
    third_party_src/third_party/var/butil/guid.cc
    third_party_src/third_party/var/butil/guid_posix.cc
    third_party_src/third_party/var/butil/hash.cc
    third_party_src/third_party/var/butil/lazy_instance.cc
    third_party_src/third_party/var/butil/location.cc
    third_party_src/third_party/var/butil/memory/aligned_memory.cc
    third_party_src/third_party/var/butil/memory/ref_counted.cc
    third_party_src/third_party/var/butil/memory/ref_counted_memory.cc
    third_party_src/third_party/var/butil/memory/singleton.cc
    third_party_src/third_party/var/butil/memory/weak_ptr.cc
    third_party_src/third_party/var/butil/posix/file_descriptor_shuffle.cc
    third_party_src/third_party/var/butil/posix/global_descriptors.cc
    third_party_src/third_party/var/butil/process_util.cc
    third_party_src/third_party/var/butil/rand_util.cc
    third_party_src/third_party/var/butil/rand_util_posix.cc
    third_party_src/third_party/var/butil/fast_rand.cpp
    third_party_src/third_party/var/butil/safe_strerror_posix.cc
    third_party_src/third_party/var/butil/sha1_portable.cc
    third_party_src/third_party/var/butil/strings/latin1_string_conversions.cc
    third_party_src/third_party/var/butil/strings/nullable_string16.cc
    third_party_src/third_party/var/butil/strings/safe_sprintf.cc
    third_party_src/third_party/var/butil/strings/string16.cc
    third_party_src/third_party/var/butil/strings/string_number_conversions.cc
    third_party_src/third_party/var/butil/strings/string_split.cc
    third_party_src/third_party/var/butil/strings/string_piece.cc
    third_party_src/third_party/var/butil/strings/string_util.cc
    third_party_src/third_party/var/butil/strings/string_util_constants.cc
    third_party_src/third_party/var/butil/strings/stringprintf.cc
    third_party_src/third_party/var/butil/strings/utf_offset_string_conversions.cc
    third_party_src/third_party/var/butil/strings/utf_string_conversion_utils.cc
    third_party_src/third_party/var/butil/strings/utf_string_conversions.cc
    third_party_src/third_party/var/butil/synchronization/cancellation_flag.cc
    third_party_src/third_party/var/butil/synchronization/condition_variable_posix.cc
    third_party_src/third_party/var/butil/synchronization/waitable_event_posix.cc
    third_party_src/third_party/var/butil/threading/non_thread_safe_impl.cc
    third_party_src/third_party/var/butil/threading/platform_thread_posix.cc
    third_party_src/third_party/var/butil/threading/simple_thread.cc
    third_party_src/third_party/var/butil/threading/thread_checker_impl.cc
    third_party_src/third_party/var/butil/threading/thread_collision_warner.cc
    third_party_src/third_party/var/butil/threading/thread_id_name_manager.cc
    third_party_src/third_party/var/butil/threading/thread_local_posix.cc
    third_party_src/third_party/var/butil/threading/thread_local_storage.cc
    third_party_src/third_party/var/butil/threading/thread_local_storage_posix.cc
    third_party_src/third_party/var/butil/threading/thread_restrictions.cc
    third_party_src/third_party/var/butil/threading/watchdog.cc
    third_party_src/third_party/var/butil/time/clock.cc
    third_party_src/third_party/var/butil/time/default_clock.cc
    third_party_src/third_party/var/butil/time/default_tick_clock.cc
    third_party_src/third_party/var/butil/time/tick_clock.cc
    third_party_src/third_party/var/butil/time/time.cc
    third_party_src/third_party/var/butil/time/time_posix.cc
    third_party_src/third_party/var/butil/version.cc
    third_party_src/third_party/var/butil/logging.cc
    third_party_src/third_party/var/butil/class_name.cpp
    third_party_src/third_party/var/butil/errno.cpp
    third_party_src/third_party/var/butil/find_cstr.cpp
    third_party_src/third_party/var/butil/status.cpp
    third_party_src/third_party/var/butil/string_printf.cpp
    third_party_src/third_party/var/butil/thread_local.cpp
    third_party_src/third_party/var/butil/thread_key.cpp
    third_party_src/third_party/var/butil/unix_socket.cpp
    third_party_src/third_party/var/butil/endpoint.cpp
    third_party_src/third_party/var/butil/fd_utility.cpp
    third_party_src/third_party/var/butil/files/temp_file.cpp
    third_party_src/third_party/var/butil/files/file_watcher.cpp
    third_party_src/third_party/var/butil/time.cpp
    third_party_src/third_party/var/butil/zero_copy_stream_as_streambuf.cpp
    third_party_src/third_party/var/butil/crc32c.cc
    third_party_src/third_party/var/butil/containers/case_ignored_flat_map.cpp
    third_party_src/third_party/var/butil/iobuf.cpp
    third_party_src/third_party/var/butil/iobuf_profiler.cpp
    third_party_src/third_party/var/butil/binary_printer.cpp
    third_party_src/third_party/var/butil/recordio.cc
    third_party_src/third_party/var/butil/popen.cpp
    third_party_src/third_party/var/butil/file_util_linux.cc
    third_party_src/third_party/var/butil/threading/platform_thread_linux.cc
    third_party_src/third_party/var/butil/strings/sys_string_conversions_posix.cc
)

I haven't installed google-perftools yet, so I ignored the sub-directory mainboard and tools.

1734352696_grim

By the way, eProsima namespace and eProsima_wrap is tricky too, I work-around a bit by rewriting some source codes in Cyber to make it compiled.

@HanyuWu , That's a good idea. I'm not sure about the version of bvar used in Apollo.

@hearto1314
Copy link
Contributor

Hi @minhanghuang ,we recommend using Ubuntu 22.04 in host mode,and you can use docker container mode on ubuntu 20.04, please use aem start without -b host hava a try.
https://apollo.baidu.com/community/Apollo-Homepage-Document?doc=BYFxAcGcC4HpYIbgPYBtXIHQCMEEsATAV0wGNkBbWA5UyRFdZWVBEAU0hFgoIH0adPgCY%2BADwCiAVnEBBCeIAcATnETFcgMxKZkgGxKAwkoDsa3YoAi45WdGTd8paskaxs7WMW6JBr8a8zByVrMVtMUApUIA

@hearto1314 Thank you very much! This is a great solution. However, I hope to use Cyber standalone on different versions of Ubuntu

the bvar package is stored in apollo apt repo, build from https://github.com/apache/brpc/blob/master/docs/en/bvar.md , it seems that the package is missing in apollo focal(ubuntu 20.04) amd64 repo, we are mainly testing on ubuntu 22.04 recently, so we recommend using Ubuntu 22.04 in host mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants