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

Docker build not working (missing things + compiler errors)? #553

Open
meowjesty opened this issue Dec 28, 2023 · 0 comments
Open

Docker build not working (missing things + compiler errors)? #553

meowjesty opened this issue Dec 28, 2023 · 0 comments

Comments

@meowjesty
Copy link

I'm having some issues building this project with docker.

After cloning it with git clone --recurse-submodules https://github.com/vbpf/ebpf-verifier.git, when I run docker build -t verifier . it outputs the following:

docker build -t verifier .
[+] Building 2.4s (13/15)                                                                                                                                                                                       docker:default
 => [internal] load .dockerignore                                                                                                                                                                                         0.1s
 => => transferring context: 58B                                                                                                                                                                                          0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                      0.1s
 => => transferring dockerfile: 462B                                                                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                           0.7s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                                                             0.0s
 => [ 1/10] FROM docker.io/library/ubuntu:20.04@sha256:f2034e7195f61334e6caff6ecf2e965f92d11e888309065da85ff50c617732b8                                                                                                   0.0s
 => [internal] load build context                                                                                                                                                                                         0.3s
 => => transferring context: 77.95MB                                                                                                                                                                                      0.2s
 => CACHED [ 2/10] RUN apt update                                                                                                                                                                                         0.0s
 => CACHED [ 3/10] RUN apt -yq --no-install-suggests --no-install-recommends install build-essential cmake     libboost-dev libboost-filesystem-dev libboost-program-options-dev libyaml-cpp-dev                          0.0s
 => CACHED [ 4/10] WORKDIR /verifier                                                                                                                                                                                      0.0s
 => [ 5/10] COPY . /verifier/                                                                                                                                                                                             0.3s
 => [ 6/10] RUN mkdir build                                                                                                                                                                                               0.3s
 => [ 7/10] WORKDIR /verifier/build                                                                                                                                                                                       0.1s
 => ERROR [ 8/10] RUN cmake .. -DCMAKE_BUILD_TYPE=Release                                                                                                                                                                 0.6s
------                                                                                                                                                                                                                         
 > [ 8/10] RUN cmake .. -DCMAKE_BUILD_TYPE=Release:                                                                                                                                                                            
0.313 -- The C compiler identification is GNU 9.4.0                                                                                                                                                                            
0.344 -- The CXX compiler identification is GNU 9.4.0                                                                                                                                                                          
0.347 -- Check for working C compiler: /usr/bin/cc                                                                                                                                                                             
0.388 -- Check for working C compiler: /usr/bin/cc -- works                                                                                                                                                                    
0.388 -- Detecting C compiler ABI info
0.432 -- Detecting C compiler ABI info - done
0.438 -- Detecting C compile features
0.438 -- Detecting C compile features - done
0.440 -- Check for working CXX compiler: /usr/bin/c++
0.486 -- Check for working CXX compiler: /usr/bin/c++ -- works
0.486 -- Detecting CXX compiler ABI info
0.536 -- Detecting CXX compiler ABI info - done
0.542 -- Detecting CXX compile features
0.542 -- Detecting CXX compile features - done
0.561 CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2421 (message):
0.561   error: could not find git for clone of catch2-populate
0.561 Call Stack (most recent call first):
0.561   /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command)
0.561   CMakeLists.txt:13 (ExternalProject_Add)
0.561 
0.561 
0.561 -- Configuring incomplete, errors occurred!
0.561 See also "/verifier/build/_deps/catch2-subbuild/CMakeFiles/CMakeOutput.log".
0.561 
0.561 CMake Error at /usr/share/cmake-3.16/Modules/FetchContent.cmake:903 (message):
0.561   CMake step for catch2 failed: 1
0.561 Call Stack (most recent call first):
0.561   /usr/share/cmake-3.16/Modules/FetchContent.cmake:1006 (__FetchContent_directPopulate)
0.561   /usr/share/cmake-3.16/Modules/FetchContent.cmake:1047 (FetchContent_Populate)
0.561   CMakeLists.txt:12 (FetchContent_MakeAvailable)
0.561 
0.561 
0.561 -- Configuring incomplete, errors occurred!
0.561 See also "/verifier/build/CMakeFiles/CMakeOutput.log".
------
Dockerfile:11
--------------------
   9 |     RUN mkdir build
  10 |     WORKDIR /verifier/build
  11 | >>> RUN cmake .. -DCMAKE_BUILD_TYPE=Release
  12 |     RUN make -j $(nproc)
  13 |     WORKDIR /verifier
--------------------
ERROR: failed to solve: process "/bin/sh -c cmake .. -DCMAKE_BUILD_TYPE=Release" did not complete successfully: exit code: 1

Which is fixable by adding git and ca-certificates to Dockerfile, like so:

RUN apt -yq --no-install-suggests --no-install-recommends install git ca-certificates build-essential cmake \
    libboost-dev libboost-filesystem-dev libboost-program-options-dev libyaml-cpp-dev

But this wasn't enough to get it to build. Now I'm facing a mountain of logs that end like this:

Details
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6088:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
7.444  6088 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6088:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::optional<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6094:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
7.444  6094 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6094:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::optional<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6100:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
7.444  6100 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6100:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::optional<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6112:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
7.444  6112 |     operator+(const _CharT* __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6112:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   mismatched types 'const _CharT*' and 'std::optional<std::__cxx11::basic_string<char> >'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6118:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
7.444  6118 |     operator+(_CharT __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6118:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   deduced conflicting types for parameter '_CharT' ('std::optional<std::__cxx11::basic_string<char> >' and 'char')
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6124:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
7.444  6124 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6124:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::optional<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/string:55,
7.444                  from /usr/include/c++/9/stdexcept:39,
7.444                  from /usr/include/c++/9/optional:38,
7.444                  from /usr/include/c++/9/bits/node_handle.h:39,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:72,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/basic_string.h:6130:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
7.444  6130 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/basic_string.h:6130:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::optional<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 In file included from /usr/include/c++/9/vector:68,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:11,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/stl_bvector.h:303:3: note: candidate: 'std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)'
7.444   303 |   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
7.444       |   ^~~~~~~~
7.444 /usr/include/c++/9/bits/stl_bvector.h:303:23: note:   no known conversion for argument 1 from 'std::optional<std::__cxx11::basic_string<char> >' to 'std::ptrdiff_t' {aka 'long int'}
7.444   303 |   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
7.444       |             ~~~~~~~~~~^~~
7.444 /usr/include/c++/9/bits/stl_bvector.h:393:3: note: candidate: 'std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)'
7.444   393 |   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
7.444       |   ^~~~~~~~
7.444 /usr/include/c++/9/bits/stl_bvector.h:393:23: note:   no known conversion for argument 1 from 'std::optional<std::__cxx11::basic_string<char> >' to 'std::ptrdiff_t' {aka 'long int'}
7.444   393 |   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
7.444       |             ~~~~~~~~~~^~~
7.444 In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
7.444                  from /usr/include/c++/9/bits/stl_tree.h:63,
7.444                  from /usr/include/c++/9/map:60,
7.444                  from /verifier/external/libbtf/libbtf/btf.h:7,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.h:5,
7.444                  from /verifier/external/libbtf/libbtf/btf_type_data.cpp:4:
7.444 /usr/include/c++/9/bits/stl_iterator.h:993:5: note: candidate: 'template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)'
7.444   993 |     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
7.444       |     ^~~~~~~~
7.444 /usr/include/c++/9/bits/stl_iterator.h:993:5: note:   template argument deduction/substitution failed:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:329:28: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>'
7.444   329 |           return kind.name + suffix;
7.444       |                  ~~~~~~~~~~^~~~~~~~
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:330:16: error: 'has_type' is not a member of 'libbtf::btf_kind_traits<libbtf::btf_kind_enum64>'
7.444   330 |         } else if constexpr (btf_kind_traits<decltype(kind)>::has_type) {
7.444       |                ^~
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:331:65: error: 'struct libbtf::btf_kind_enum64' has no member named 'type'
7.444   331 |           return qualifier + this->get_qualified_type_name(kind.type) + suffix;
7.444       |                                                            ~~~~~^~~~
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444   351 |       },
7.444       |       ^
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp: In lambda function:
7.444 /verifier/external/libbtf/libbtf/btf_type_data.cpp:351:7: warning: control reaches end of non-void function [-Wreturn-type]
7.444 make[2]: *** [external/libbtf/libbtf/CMakeFiles/libbtf.dir/build.make:102: external/libbtf/libbtf/CMakeFiles/libbtf.dir/btf_type_data.cpp.o] Error 1
7.444 make[1]: *** [CMakeFiles/Makefile2:458: external/libbtf/libbtf/CMakeFiles/libbtf.dir/all] Error 2
7.444 make[1]: *** Waiting for unfinished jobs....
7.444 make: *** [Makefile:84: all] Error 2
------
Dockerfile:12
--------------------
  10 |     WORKDIR /verifier/build
  11 |     RUN cmake .. -DCMAKE_BUILD_TYPE=Release
  12 | >>> RUN make -j $(nproc)
  13 |     WORKDIR /verifier
  14 |     ENTRYPOINT ["./check"]
--------------------
ERROR: failed to solve: process "/bin/sh -c make -j $(nproc)" did not complete successfully: exit code: 2

Am I missing something, or is the docker build broken?

Alan-Jowett pushed a commit to Alan-Jowett/ebpf-verifier that referenced this issue Oct 15, 2024
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

1 participant