SITL build fails on alpine

Hi i’m trying to build SITL using Copter 4.5 and for some reason the compilation fails with this error:

../../libraries/AP_GPS/AP_GPS_SITL.cpp:37:27: error: aggregate 'timeval first_tv' has incomplete type and cannot be defined
    37 |     static struct timeval first_tv;
       |                           ^~~~~~~~
 compilation terminated due to -Wfatal-errors.

 Waf: Leaving directory `/ardupilot/src/build/sitl'
 Build failed
  -> task in 'objs/AP_GPS' failed (exit status 1): 
  {task 135805090486368: cxx AP_GPS_SITL.cpp -> AP_GPS_SITL.cpp.0.o}
: 

I am using alpine 3.19 with a configuration that used to work with SITL from Copter 4.4.3 (altho with alpine 3.16 but the error is the same in both versions)
Any idea what might cause the build to fail like this?

Have you run the environment installation script and done a “waf clean”?

I will try to replicate and solve this later this week. Thanks for bring this up.

@kd0aij we don’t have installation script for alpine, main issue on this distribution is that it don’t rely on glib but musl lib, so there are some compilation differences and sometime issues like this.

oops, sorry. I ignored the fact this was not Ubuntu…

@khancyr thank you very much :slight_smile: if there’s anything i can do to help let me know

@khancyr should i open an issue so this won’t be forgotten or is this thread enough?