vbpf / ebpf-verifier

eBPF verifier based on abstract interpretation
MIT License
389 stars 43 forks source link

Update docker base image #649

Closed viniciusd closed 4 months ago

viniciusd commented 4 months ago

The current base image, Ubuntu 20.04, comes with gcc 9, which can't compile the code base.

Upgrading it to Ubuntu 22.04 provides us with gcc 11, which handles the more modern features used in the project

Building the current image with docker build -t verifier . gets:

19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:246:11: error: 'has_type' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   246 |           if constexpr (btf_kind_traits<decltype(kind)>::has_type) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:247:35: error: 'const struct libbtf::btf_kind_enum64' has no member named 'type'
19.58   247 |             root_types.erase(kind.type);
19.58       |                              ~~~~~^~~~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:249:11: error: 'has_element_type' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   249 |           if constexpr (btf_kind_traits<decltype(kind)>::has_element_type) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:250:35: error: 'const struct libbtf::btf_kind_enum64' has no member named 'element_type'
19.58   250 |             root_types.erase(kind.element_type);
19.58       |                              ~~~~~^~~~~~~~~~~~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:252:11: error: 'has_index_type' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   252 |           if constexpr (btf_kind_traits<decltype(kind)>::has_index_type) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:253:35: error: 'const struct libbtf::btf_kind_enum64' has no member named 'index_type'
19.58   253 |             root_types.erase(kind.index_type);
19.58       |                              ~~~~~^~~~~~~~~~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:255:11: error: 'has_members' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   255 |           if constexpr (btf_kind_traits<decltype(kind)>::has_members) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:257:15: error: 'has_type' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64_member&>'
19.58   257 |               if constexpr (btf_kind_traits<decltype(member)>::has_type) {
19.58       |               ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:258:41: error: 'const struct libbtf::btf_kind_enum64_member' has no member named 'type'
19.58   258 |                 root_types.erase(member.type);
19.58       |                                  ~~~~~~~^~~~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:262:11: error: 'has_parameters' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   262 |           if constexpr (btf_kind_traits<decltype(kind)>::has_parameters) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:263:41: error: 'const struct libbtf::btf_kind_enum64' has no member named 'parameters'
19.58   263 |             for (auto &parameter : kind.parameters) {
19.58       |                                    ~~~~~^~~~~~~~~~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:267:11: error: 'has_return_type' is not a member of 'libbtf::btf_kind_traits<const libbtf::btf_kind_enum64&>'
19.58   267 |           if constexpr (btf_kind_traits<decltype(kind)>::has_return_type) {
19.58       |           ^~
19.58 /verifier/external/libbtf/libbtf/btf_json.cpp:268:35: error: 'const struct libbtf::btf_kind_enum64' has no member named 'return_type'
19.58   268 |             root_types.erase(kind.return_type);
19.58       |                              ~~~~~^~~~~~~~~~~
19.58 make[2]: *** [external/libbtf/libbtf/CMakeFiles/libbtf.dir/build.make:63: external/libbtf/libbtf/CMakeFiles/libbtf.dir/btf_json.cpp.o] Error 1
19.58 make[2]: *** Waiting for unfinished jobs....
19.58 make[2]: *** [external/libbtf/libbtf/CMakeFiles/libbtf.dir/build.make:76: external/libbtf/libbtf/CMakeFiles/libbtf.dir/btf_map.cpp.o] Error 1
19.58 make[1]: *** [CMakeFiles/Makefile2:458: external/libbtf/libbtf/CMakeFiles/libbtf.dir/all] Error 2
19.58 make[1]: *** Waiting for unfinished jobs.

Upgrading the base image and, consequently, GCC, makes it possible to build the image successfully.

This is a follow-up work on #605 to get the docker image functional

coveralls commented 4 months ago

Coverage Status

coverage: 90.431%. remained the same when pulling 838c8367630baa41b12dc4ac02853388dab6c420 on viniciusd:update-docker-base-image into 6721feca77f3898e0725fb0c6c5e7062101dfeff on vbpf:main.

coveralls commented 4 months ago

Coverage Status

coverage: 90.431%. remained the same when pulling 838c8367630baa41b12dc4ac02853388dab6c420 on viniciusd:update-docker-base-image into 6721feca77f3898e0725fb0c6c5e7062101dfeff on vbpf:main.

coveralls commented 4 months ago

Coverage Status

coverage: 90.431%. remained the same when pulling 838c8367630baa41b12dc4ac02853388dab6c420 on viniciusd:update-docker-base-image into 6721feca77f3898e0725fb0c6c5e7062101dfeff on vbpf:main.

coveralls commented 4 months ago

Coverage Status

coverage: 90.431%. remained the same when pulling 838c8367630baa41b12dc4ac02853388dab6c420 on viniciusd:update-docker-base-image into 6721feca77f3898e0725fb0c6c5e7062101dfeff on vbpf:main.

coveralls commented 4 months ago

Coverage Status

coverage: 90.431%. remained the same when pulling 838c8367630baa41b12dc4ac02853388dab6c420 on viniciusd:update-docker-base-image into 6721feca77f3898e0725fb0c6c5e7062101dfeff on vbpf:main.