Tools: use venv on Archlinux to fix install

This commit is contained in:
Pierre Kancir 2023-08-07 11:33:05 +02:00 committed by Peter Barker
parent be74f7b480
commit 2b8a605fd2
2 changed files with 22 additions and 5 deletions

View File

@ -115,6 +115,7 @@ jobs:
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
source ~/.bashrc
source $HOME/venv-ardupilot/bin/activate || true
git config --global --add safe.directory /__w/ardupilot/ardupilot
./waf configure
./waf rover
@ -128,6 +129,7 @@ jobs:
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
source ~/.bashrc
source $HOME/venv-ardupilot/bin/activate || true
case ${{matrix.os}} in
*"archlinux"*)
export PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH

View File

@ -50,10 +50,25 @@ function maybe_prompt_user() {
fi
}
sudo usermod -a -G uucp $USER
sudo usermod -a -G uucp "$USER"
sudo pacman -Sy --noconfirm --needed $BASE_PKGS $SITL_PKGS $PX4_PKGS
pip3 -q install --user -U $PYTHON_PKGS
python3 -m venv "$HOME"/venv-ardupilot
# activate it:
SOURCE_LINE="source $HOME/venv-ardupilot/bin/activate"
$SOURCE_LINE
if [[ -z "${DO_PYTHON_VENV_ENV}" ]] && maybe_prompt_user "Make ArduPilot venv default for python [N/y]?" ; then
DO_PYTHON_VENV_ENV=1
fi
if [[ $DO_PYTHON_VENV_ENV -eq 1 ]]; then
echo "$SOURCE_LINE" >> ~/.bashrc
fi
pip3 -q install -U $PYTHON_PKGS
(
cd /usr/lib/ccache
@ -78,7 +93,7 @@ exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
if ! grep -Fxq "$exportline" ~/.bashrc ; then
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
echo "$exportline" >> ~/.bashrc
. ~/.bashrc
. "$HOME/.bashrc"
else
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
fi
@ -88,7 +103,7 @@ exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH";
if ! grep -Fxq "$exportline2" ~/.bashrc ; then
if maybe_prompt_user "Add $CWD/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then
echo "$exportline2" >> ~/.bashrc
. ~/.bashrc
. "$HOME/.bashrc"
else
echo "Skipping adding $CWD/$ARDUPILOT_TOOLS to PATH."
fi
@ -96,7 +111,7 @@ fi
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
(
cd $SCRIPT_DIR
cd "$SCRIPT_DIR"
git submodule update --init --recursive
)