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

experimental_allow_proto3_optional was not set #160

Open
zixijian opened this issue Oct 4, 2024 · 4 comments
Open

experimental_allow_proto3_optional was not set #160

zixijian opened this issue Oct 4, 2024 · 4 comments
Labels
external Issue caused by other project or program

Comments

@zixijian
Copy link

zixijian commented Oct 4, 2024

I build it on my Android phone chroot container

my env:
ubuntu-22.04-arm64
gcc 12.3 g++ 12.3
protoc 3.12.4

libfmt must compile alone,otherwise could not find std.h.
https://github.com/fmtlib/fmt

apt-get install -yq \
cmake git golang libbrotli-dev \
libgtest-dev liblz4-dev libpcre2-dev libprotobuf-dev libunwind-dev \
libzstd-dev pkg-config protobuf-compiler ninja-build xz-utils \
libusb-1.0-0-dev libbsd-dev 

make -j8 -lbsd

Then i got an error:

[ 93%] Running cpp protocol buffer compiler on adb/proto/app_processes.proto
app_processes.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set. 
make[2]: *** [vendor/CMakeFiles/libadb.dir/build.make:75: vendor/app_processes.pb.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:327: vendor/CMakeFiles/libadb.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
@zixijian
Copy link
Author

zixijian commented Oct 4, 2024

After a separate upgrade protobuf
https://github.com/protocolbuffers/protobuf
error: ‘libusb_ssplus_usb_device_capability_descriptor’ has not been declared

-- Found fmt: /usr/local/lib/cmake/fmt (version 11.0.2)                                          CMake Warning at /usr/local/lib/cmake/protobuf/protobuf-config.cmake:9 (find_package):             
Found package configuration file:                                                                                                                                                                   /usr/local/lib/cmake/absl/abslConfig.cmake                                                                                                                                                      but it set absl_FOUND to FALSE so package "absl" is considered to be NOT  FOUND.  
Reason given by package:                                                                                                                                                                  
The following imported targets are referenced, but are missing:    protobuf::gmock                                                                                                                                                                                 
Call Stack (most recent call first):                                                               vendor/CMakeLists.txt:102 (find_package)                                                                                                                                                                                                                                                         
CMake Warning at /usr/share/cmake-3.22/Modules/FindProtobuf.cmake:524 (message):                   
Protobuf compiler version 30.0 doesn't match library version 5.30.0                            
Call Stack (most recent call first):                                                               
vendor/CMakeLists.txt:103 (find_package)                                                                                                                                                                                                                                                         
-- Configuring done                                                                              
-- Generating done                                                                               
-- Build files have been written to: /root/android-tools/build

[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/tcp.cpp.o                
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/udp.cpp.o                
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/vendor_boot_img_utils.cpp.o                                                                                               
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/util.cpp.o               
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/usb_linux.cpp.o          /root/android-tools/vendor/core/fastboot/usb_linux.cpp: In function ‘std::unique_ptr<usb_handle> find_usb_device(const char*, ifc_match_func)’:                                                   /root/android-tools/vendor/core/fastboot/usb_linux.cpp:371:45: warning: ignoring attributes on template argument ‘int (*)(DIR*)’ [-Wignored-attributes]                                             371 |     std::unique_ptr<DIR, decltype(&closedir)> busdir(opendir(base), closedir);                 |                                             ^                                            
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/fs.cpp.o                 a
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/filesystem.cpp.o        
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/fastboot_driver.cpp.o    
[ 93%] Building CXX object vendor/CMakeFiles/fastboot.dir/core/fastboot/fastboot.cpp.o           
[ 93%] Linking CXX executable fastboot                                                           
[ 93%] Built target fastboot                                                                     Consolidate compiler generated dependencies of target libadb_crypto_defaults                     
[ 93%] Built target libadb_crypto_defaults                                                       Consolidate compiler generated dependencies of target libadb                                     
[ 93%] Building CXX object vendor/CMakeFiles/libadb.dir/adb/client/usb_libusb.cpp.o              /root/android-tools/vendor/adb/client/usb_libusb.cpp:543:46: error: ‘libusb_ssplus_usb_device_capability_descriptor’ has not been declared                                                          543 |     static uint64_t ExtractMaxSuperSpeedPlus(libusb_ssplus_usb_device_capability_descriptor* cap) {                                                                                             |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                               /root/android-tools/vendor/adb/client/usb_libusb.cpp: In static member function ‘static uint64_t LibusbConnection::ToConnectionSpeed(int)’:                                                       /root/android-tools/vendor/adb/client/usb_libusb.cpp:510:18: error: ‘LIBUSB_SPEED_SUPER_PLUS_X2’ was not declared in this scope; did you mean ‘LIBUSB_SPEED_SUPER_PLUS’?                            510 |             case LIBUSB_SPEED_SUPER_PLUS_X2:                                                   |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                    |                  LIBUSB_SPEED_SUPER_PLUS                                                 /root/android-tools/vendor/adb/client/usb_libusb.cpp: In static member function ‘static uint64_t LibusbConnection::ExtractMaxSuperSpeedPlus(int*)’:                                               /root/android-tools/vendor/adb/client/usb_libusb.cpp:548:38: error: request for member ‘numSublinkSpeedAttributes’ in ‘* cap’, which is of non-class type ‘int’                                     548 |         for (uint8_t i = 0; i < cap->numSublinkSpeedAttributes; i++) {                         |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~                           /root/android-tools/vendor/adb/client/usb_libusb.cpp:549:13: error: ‘libusb_ssplus_sublink_attribute’ was not declared in this scope                                                                549 |             libusb_ssplus_sublink_attribute* attr = &cap->sublinkSpeedAttributes[i];           |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                              /root/android-tools/vendor/adb/client/usb_libusb.cpp:549:46: error: ‘attr’ was not declared in this scope                                                                                           549 |             libusb_ssplus_sublink_attribute* attr = &cap->sublinkSpeedAttributes[i];           |                                              ^~~~                                        /root/android-tools/vendor/adb/client/usb_libusb.cpp:549:59: error: request for member ‘sublinkSpeedAttributes’ in ‘* cap’, which is of non-class type ‘int’                                        549 |             libusb_ssplus_sublink_attribute* attr = &cap->sublinkSpeedAttributes[i];           |                                                           ^~~~~~~~~~~~~~~~~~~~~~         /root/android-tools/vendor/adb/client/usb_libusb.cpp: In member function ‘void LibusbConnection::RetrieveSpeeds()’:                                                                               /root/android-tools/vendor/adb/client/usb_libusb.cpp:577:22: error: ‘LIBUSB_BT_SUPERSPEED_PLUS_CAPABILITY’ was not declared in this scope; did you mean ‘LIBUSB_BT_SS_USB_DEVICE_CAPABILITY’?       577 |                 case LIBUSB_BT_SUPERSPEED_PLUS_CAPABILITY: {                                   |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      |                      LIBUSB_BT_SS_USB_DEVICE_CAPABILITY                                  /root/android-tools/vendor/adb/client/usb_libusb.cpp:578:21: error: ‘libusb_ssplus_usb_device_capability_descriptor’ was not declared in this scope; did you mean ‘libusb_ss_usb_device_capability_descriptor’?                                                                                      578 |                     libusb_ssplus_usb_device_capability_descriptor* cap = nullptr;             |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                             |                     libusb_ss_usb_device_capability_descriptor                           /root/android-tools/vendor/adb/client/usb_libusb.cpp:578:69: error: ‘cap’ was not declared in this scope                                                                                            
  578 |                     libusb_ssplus_usb_device_capability_descriptor* cap = nullptr;             |                                                                     ^~~                  /root/android-tools/vendor/adb/client/usb_libusb.cpp:579:26: error: ‘libusb_get_ssplus_usb_device_capability_descriptor’ was not declared in this scope; did you mean ‘libusb_get_ss_usb_device_capability_descriptor’?                                                                              579 |                     if (!libusb_get_ssplus_usb_device_capability_descriptor(                   |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    |                          libusb_get_ss_usb_device_capability_descriptor                  /root/android-tools/vendor/adb/client/usb_libusb.cpp:582:25: error: ‘libusb_free_ssplus_usb_device_capability_descriptor’ was not declared in this scope; did you mean ‘libusb_free_ss_usb_device_capability_descriptor’?                                                                            582 |                         libusb_free_ssplus_usb_device_capability_descriptor(cap);              |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    |                         libusb_free_ss_usb_device_capability_descriptor                  
make[2]: *** [vendor/CMakeFiles/libadb.dir/build.make:312: vendor/CMakeFiles/libadb.dir/adb/client/usb_libusb.cpp.o] Error 1                                                                      
make[1]: *** [CMakeFiles/Makefile2:328: vendor/CMakeFiles/libadb.dir/all] Error 2                
make: *** [Makefile:156: all] Error 2

Should I compile every package or upgrade ubuntu to 24.04?

It is recommended to publish common precompiled packages for arm64 or amd64 using github action.

@anatol
Copy link
Collaborator

anatol commented Oct 4, 2024

try compilation flag -D ANDROID_TOOLS_USE_BUNDLED_LIBUSB

@zixijian
Copy link
Author

zixijian commented Oct 5, 2024

@anatol Thanks a lot.
I finally switched the tag 34.0.5 through.
What should i do,if I dont want to compile adb and fastboot?

@Biswa96
Copy link
Collaborator

Biswa96 commented Oct 5, 2024

Try with Ubuntu 24.04. I had similar issue with older Ubuntu version, see 7cb4b93 commit.

@Biswa96 Biswa96 added the external Issue caused by other project or program label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issue caused by other project or program
Projects
None yet
Development

No branches or pull requests

3 participants