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

Feature/alpine: fix compiliation and add test #27818

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/test_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
./waf rover

- name: test build Chibios ${{matrix.os}}.${{matrix.name}}
if: matrix.os != 'alpine'
env:
DISABLE_MAVNATIVE: True
DEBIAN_FRONTEND: noninteractive
Expand All @@ -141,3 +142,38 @@ jobs:
git config --global --add safe.directory /__w/ardupilot/ardupilot
./waf configure --board CubeOrange
./waf plane

build-alpine: # special case for alpine as it doesn't have bash by default
runs-on: ubuntu-22.04
container:
image: alpine:latest
options: --privileged
steps:
- name: Install Git
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive
TZ: Europe/Paris
run: |
apk update && apk add --no-cache git
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: test install environment alpine
timeout-minutes: 60
env:
DISABLE_MAVNATIVE: True
TZ: Europe/Paris
SKIP_AP_GIT_CHECK: 1
run: |
PATH="/github/home/.local/bin:$PATH"
Tools/environment_install/install-prereqs-alpine.sh
- name: test build STIL alpine
env:
DISABLE_MAVNATIVE: True
TZ: Europe/Paris
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git config --global --add safe.directory /__w/ardupilot/ardupilot
./waf configure
./waf rover
23 changes: 23 additions & 0 deletions Tools/environment_install/install-prereqs-alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh
echo "---------- $0 start ----------"
set -e
set -x

echo "==================================================================="
echo "Warning: This script is not fully tested. Please report any issues."
echo "==================================================================="


apk update && apk add --no-cache \
linux-headers \
g++ \
python3 \
py-future \
py-pip \
libxml2-dev \
libxslt-dev \
git \
&& ln -sf python3 /usr/bin/python \
&& rm -rf /var/cache/apk/*

python3 -m pip install --user --no-deps --no-cache-dir empy==3.3.4 pexpect ptyprocess --break-system-packages
1 change: 1 addition & 0 deletions libraries/AP_HAL/utility/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/select.h>
#include <sys/time.h>
#endif

#include <errno.h>
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_HAL_Linux/CANSocketIface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <net/if.h>
#include <linux/can/raw.h>
#include <cstring>
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_HAL_Linux/VideoIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include "AP_HAL_Linux.h"
#include <sys/time.h>
#include <linux/videodev2.h>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#if HAL_SIM_GPS_ENABLED

#include <time.h>
#include <sys/time.h>

#include <AP_BoardConfig/AP_BoardConfig.h>
#include <AP_HAL/AP_HAL.h>
Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ param set SERIAL5_PROTOCOL 5

#if HAL_SIM_GPS_ENABLED

#include <sys/time.h>
#include "SIM_SerialDevice.h"

namespace SITL {
Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_GPS_MSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <SITL/SITL.h>

#include <time.h>
#include <sys/time.h>

using namespace SITL;

Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_GPS_NMEA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <AP_HAL/AP_HAL.h>

#include <time.h>
#include <sys/time.h>

extern const AP_HAL::HAL& hal;

Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_MicroStrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
#include "SIM_MicroStrain.h"
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <AP_HAL/utility/sparse-endian.h>
Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_MicroStrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <SITL/SITL.h>
#include "SIM_SerialDevice.h"
#include <sys/time.h>

namespace SITL
{
Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SIM_VectorNav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "SIM_VectorNav.h"
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <AP_Common/NMEA.h>
Expand Down
Loading