-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
setup: fixes ubuntu 22.04 & 24.04 #23745
Open
mrpollo
wants to merge
4
commits into
main
Choose a base branch
from
pr/23707
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+91
−28
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d42eafe
setup: Ubuntu setup Python >= 3.11 installation workaround
TannerGilbert 0f78696
ci: test supported ubuntu versions
mrpollo e6731d2
setup: install zeromq on ubuntu 24.04 targets
mrpollo 250a2bf
setup: install libunwind on Ubuntu 22.04 targets
mrpollo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# NOTE: this workflow is now running on Dronecode / PX4 AWS account. | ||
# - If you want to keep the tests running in GitHub Actions you need to uncomment the "runs-on: ubuntu-latest" lines | ||
# and comment the "runs-on: [runs-on,runner=..." lines. | ||
# - If you would like to duplicate this setup try setting up "RunsOn" on your own AWS account try https://runs-on.com | ||
|
||
name: Setup Tools Test (Ubuntu) | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'stable' | ||
- 'beta' | ||
- 'release/*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
ubuntu-run: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [22, 24] | ||
# runs-on: ubuntu-latest | ||
runs-on: [runs-on,runner=8cpu-linux-x64,"image=ubuntu${{ matrix.version }}-full-x64","run-id=${{ github.run_id }}"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# - name: ownership workaround | ||
# run: git config --system --add safe.directory '*' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
./Tools/setup/ubuntu.sh | ||
|
||
- name: Make Default Build | ||
run: | | ||
make px4_sitl_default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
set -e | ||
|
||
## Bash script to setup PX4 development environment on Ubuntu LTS (22.04, 20.04, 18.04). | ||
## Bash script to setup PX4 development environment on Ubuntu LTS (24.04, 22.04, 20.04, 18.04). | ||
## Can also be used in docker. | ||
## | ||
## Installs: | ||
|
@@ -49,28 +49,17 @@ if [[ ! -f "${DIR}/${REQUIREMENTS_FILE}" ]]; then | |
return 1 | ||
fi | ||
|
||
|
||
# check ubuntu version | ||
# otherwise warn and point to docker? | ||
UBUNTU_RELEASE="`lsb_release -rs`" | ||
|
||
if [[ "${UBUNTU_RELEASE}" == "14.04" ]]; then | ||
echo "Ubuntu 14.04 is no longer supported" | ||
exit 1 | ||
elif [[ "${UBUNTU_RELEASE}" == "16.04" ]]; then | ||
echo "Ubuntu 16.04 is no longer supported" | ||
UBUNTU_RELEASE="$(lsb_release -rs)" | ||
SUPPORTED_UBUNTU_VERSIONS=("18.04" "20.04" "22.04" "24.04") | ||
if [[ ! " ${SUPPORTED_UBUNTU_VERSIONS[*]} " =~ ${UBUNTU_RELEASE} ]]; then | ||
echo "Unsupported Ubuntu version: ${UBUNTU_RELEASE}" | ||
exit 1 | ||
elif [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then | ||
echo "Ubuntu 18.04" | ||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then | ||
echo "Ubuntu 20.04" | ||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then | ||
echo "Ubuntu 22.04" | ||
elif [[ "${UBUNTU_RELEASE}" == "21.3" ]]; then | ||
echo "Linux Mint 21.3" | ||
else | ||
echo "Ubuntu ${UBUNTU_RELEASE}" | ||
fi | ||
|
||
|
||
echo | ||
echo "Installing PX4 general dependencies" | ||
|
||
|
@@ -105,12 +94,17 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i | |
# Python3 dependencies | ||
echo | ||
echo "Installing PX4 Python3 dependencies" | ||
if [ -n "$VIRTUAL_ENV" ]; then | ||
# virtual environments don't allow --user option | ||
python -m pip install -r ${DIR}/requirements.txt | ||
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}') | ||
REQUIRED_VERSION="3.11" | ||
if [[ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" == "$REQUIRED_VERSION" ]]; then | ||
python3 -m pip install --break-system-packages -r ${DIR}/requirements.txt | ||
else | ||
# older versions of Ubuntu require --user option | ||
python3 -m pip install --user -r ${DIR}/requirements.txt | ||
if [ -n "$VIRTUAL_ENV" ]; then | ||
# virtual environments don't allow --user option | ||
python -m pip install -r ${DIR}/requirements.txt | ||
else | ||
python3 -m pip install --user -r ${DIR}/requirements.txt | ||
fi | ||
fi | ||
|
||
# NuttX toolchain (arm-none-eabi-gcc) | ||
|
@@ -137,9 +131,6 @@ if [[ $INSTALL_NUTTX == "true" ]]; then | |
libisl-dev \ | ||
libmpc-dev \ | ||
libmpfr-dev \ | ||
libncurses5 \ | ||
libncurses5-dev \ | ||
libncursesw5-dev \ | ||
libtool \ | ||
pkg-config \ | ||
screen \ | ||
|
@@ -153,7 +144,36 @@ if [[ $INSTALL_NUTTX == "true" ]]; then | |
kconfig-frontends \ | ||
; | ||
fi | ||
|
||
if [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \ | ||
libunwind-dev \ | ||
; | ||
fi | ||
if [[ "${UBUNTU_RELEASE}" == "24.04" ]]; then | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \ | ||
kconfig-frontends \ | ||
libncurses6 \ | ||
libncurses-dev \ | ||
libncursesw6 \ | ||
libzmq3-dev \ | ||
libunwind-dev \ | ||
; | ||
|
||
# Ubuntu 24.04 requires ZeroMQ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for what? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea. I couldn't trace it either. Maybe dependency inception? if you have a few minutes it would be ideal to check |
||
git clone https://github.com/zeromq/cppzmq.git | ||
cd cppzmq | ||
mkdir build | ||
cd build | ||
cmake .. | ||
sudo make install | ||
cd ../.. | ||
else | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \ | ||
libncurses5 \ | ||
libncurses5-dev \ | ||
libncursesw5-dev \ | ||
; | ||
fi | ||
|
||
if [ -n "$USER" ]; then | ||
# add user to dialout group (serial port access) | ||
|
@@ -209,6 +229,8 @@ if [[ $INSTALL_SIM == "true" ]]; then | |
java_version=11 | ||
elif [[ "${UBUNTU_RELEASE}" == "21.3" ]]; then | ||
java_version=11 | ||
elif [[ "${UBUNTU_RELEASE}" == "24.04" ]]; then | ||
java_version=11 | ||
else | ||
java_version=14 | ||
fi | ||
|
@@ -224,7 +246,7 @@ if [[ $INSTALL_SIM == "true" ]]; then | |
sudo update-alternatives --set java $(update-alternatives --list java | grep "java-$java_version") | ||
|
||
# Gazebo / Gazebo classic installation | ||
if [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then | ||
if [[ "${UBUNTU_RELEASE}" == "22.04" || "${UBUNTU_RELEASE}" == "24.04" ]]; then | ||
echo "Gazebo (Harmonic) will be installed" | ||
echo "Earlier versions will be removed" | ||
# Add Gazebo binary repository | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following step seems to fix the the failing builds.
Installing
libunwind-dev
seems to be required for both Ubuntu 22.04 and Ubuntu 24.04 but thezmq
andcppzmq
install seems to me to be only needed for Ubuntu 24.04. Unfortunately I didn't find out where ZMQ is actually used as I didn't find it directly in the PX4 code and I'm therefore unsure whether it makes sense to also include the ZMQ install in theubuntu.sh
script of if it's better to add it to the pipeline and then for example add an additional note in the documentation.Successful pipeline run: https://github.com/TannerGilbert/PX4-Autopilot/actions/runs/11123812177/job/30908037123
Regardless I hope this is useful in some way.
Best regards,
Gilbert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @TannerGilbert. I also couldn't track down where we use ZeroMQ; perhaps @dagar can help here.
Either way, instead of fixing it for CI, I added the dependencies to the Ubuntu.sh install script since our users will be running into these problems when they upgrade to 22.04 and 24.04