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

Workflow Build Docker image failed #106

Open
tatry opened this issue Sep 12, 2023 · 0 comments
Open

Workflow Build Docker image failed #106

tatry opened this issue Sep 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@tatry
Copy link
Collaborator

tatry commented Sep 12, 2023

Workflow fails with error related to building p4c compiler, e.g.:

#15 27.13 In file included from /tmp/p4c/lib/error_message.h:22,
#15 27.13                  from /tmp/p4c/lib/error_helper.h:29,
#15 27.13                  from /tmp/p4c/lib/error_reporter.h:21,
#15 27.13                  from /tmp/p4c/lib/compile_context.h:24,
#15 27.13                  from /tmp/p4c/lib/compile_context.cpp:17,
#15 27.13                  from /tmp/p4c/build/lib/unified_libp4ctoolkit_srcs_1.cpp:4:
#15 27.13 /tmp/p4c/lib/source_file.h:27:10: fatal error: gtest/gtest_prod.h: No such file or directory
#15 27.13    27 | #include "gtest/gtest_prod.h"
#15 27.13       |          ^~~~~~~~~~~~~~~~~~~~
#15 27.13 compilation terminated.
#15 27.13 make[2]: *** [lib/CMakeFiles/p4ctoolkit.dir/build.make:63: lib/CMakeFiles/p4ctoolkit.dir/unified_libp4ctoolkit_srcs_1.cpp.o] Error 1
#15 27.13 make[1]: *** [CMakeFiles/Makefile2:860: lib/CMakeFiles/p4ctoolkit.dir/all] Error 2
#15 27.13 make: *** [Makefile:163: all] Error 2
#15 ERROR: process "/bin/sh -c chmod u+x /nikss/scripts/docker-build.sh && /nikss/scripts/docker-build.sh" did not complete successfully: exit code: 2
------
 > [builder 6/6] RUN chmod u+x /nikss/scripts/docker-build.sh && /nikss/scripts/docker-build.sh:
27.13                  from /tmp/p4c/lib/compile_context.h:24,
27.13                  from /tmp/p4c/lib/compile_context.cpp:17,
27.13                  from /tmp/p4c/build/lib/unified_libp4ctoolkit_srcs_1.cpp:4:
27.13 /tmp/p4c/lib/source_file.h:27:10: fatal error: gtest/gtest_prod.h: No such file or directory
27.13    27 | #include "gtest/gtest_prod.h"
27.13       |          ^~~~~~~~~~~~~~~~~~~~
27.13 compilation terminated.
27.13 make[2]: *** [lib/CMakeFiles/p4ctoolkit.dir/build.make:63: lib/CMakeFiles/p4ctoolkit.dir/unified_libp4ctoolkit_srcs_1.cpp.o] Error 1
27.13 make[1]: *** [CMakeFiles/Makefile2:860: lib/CMakeFiles/p4ctoolkit.dir/all] Error 2
27.13 make: *** [Makefile:163: all] Error 2
------
Dockerfile:14
--------------------
  12 |     COPY . /nikss
  13 |     WORKDIR /nikss
  14 | >>> RUN chmod u+x /nikss/scripts/docker-build.sh && /nikss/scripts/docker-build.sh
  15 |     
  16 |     FROM ubuntu:20.04 as runtime
--------------------
ERROR: failed to solve: process "/bin/sh -c chmod u+x /nikss/scripts/docker-build.sh && /nikss/scripts/docker-build.sh" did not complete successfully: exit code: 2
Error: Process completed with exit code 1.

The error indicates that the problem is related with latest changes in build process of p4c - they removed git submodules and fetch its content via cmake. In other words in build script

git clone --recursive https://github.com/p4lang/p4c.git /tmp/p4c
cd /tmp/p4c
git checkout "$1"
if [ -e build ]; then /bin/rm -rf build; fi
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_EBPF=ON -DENABLE_UBPF=OFF -DENABLE_DPDK=OFF \
must be a command to download submodules after checkout, because they are no longer downloaded during git clone.

@tatry tatry added the bug Something isn't working label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant