GMLC-TDC / netif

Header-only C++14 library for getting addresses associated with network interfaces without name lookups on Windows, macOS, Linux, and FreeBSD
BSD 3-Clause "New" or "Revised" License
14 stars 1 forks source link

arm64 CI build failure #22

Closed nightlark closed 6 months ago

nightlark commented 2 years ago

While the status from the CI service is that the build passed, it is actually failing due to an error when running the build, as can be seen in the latest build: https://cloud.drone.io/GMLC-TDC/netif/91/1/3

After a bit of digging, I think the solution for now is to pin the image used for the build step to alpine:3.13 (preferred if it works) or if that fails alpine:3.12.

The way to get it working with newer versions of alpine again likely involves the CI provider updating the version of Docker they are running (this problem affects other users as well: https://discourse.drone.io/t/cloud-alpine-3-14-does-not-work/9992).

+ cmake -DENABLE_NETIF_TESTS=ON ..
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /drone/src/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make -f Makefile cmTC_409bd/fast && /usr/bin/make  -f CMakeFiles/cmTC_409bd.dir/build.make CMakeFiles/cmTC_409bd.dir/build
    make: /usr/bin/make: Operation not permitted
    make: *** [Makefile:127: cmTC_409bd/fast] Error 127

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:11 (project)

-- Configuring incomplete, errors occurred!
20RitikSingh commented 2 years ago

I want to work on this.

nightlark commented 2 years ago

Alright, let me know if you need any additional info.

20RitikSingh commented 2 years ago

sir this is a new domain for me can you provide with some resources to begin with?

nightlark commented 2 years ago

The workflow file that controls Drone CI builds (run on every commit/PR) is https://github.com/GMLC-TDC/netif/blob/main/.drone.yml

Drone uses Docker containers to run the build, and the image setting determines what Docker container to use -- a Docker container is basically a self-contained version of an operating system with various programs already installed, so the environment used to build will be the same every time. https://docs.drone.io/pipeline/docker/syntax/images/ has info on the Drone CI system syntax for specifying a docker image.

Generally docker images are listed in the form <docker image name>:<tag>; in our workflow file we just list alpine for the build step, which defaults to using the latest tag, so behind the scenes the docker image used is getting expanded to the name alpine:latest. That could get pinned to a specific alpine linux docker image by setting it to something such as alpine:3.13 to force it to use the 3.13 version of the Alpine docker image.

This unfortunately is causing issues because after around alpine:3.13 some new features started to get used, which require the CI build servers to be running a newer version of docker with support for some new security related features (from the linked post(s) above with other people using Drone CI that have the same error). We don't have control of the Docker version running on the CI servers, only the docker image that is used, so the fix for now is to specify exactly which version of the Alpine docker image to use for the build step.

nightlark commented 2 years ago

@20RitikSingh just wanted to check how things are going -- is there anything in particular you're stuck on?

nightlark commented 6 months ago

Drone Cloud became unreliable for ARM64 builds. Those have now been moved to Cirrus CI.