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

ci: add test for Ubuntu 22.04 #23869

Merged
merged 1 commit into from
Nov 13, 2024
Merged

ci: add test for Ubuntu 22.04 #23869

merged 1 commit into from
Nov 13, 2024

Conversation

mrpollo
Copy link
Contributor

@mrpollo mrpollo commented Oct 30, 2024

Tests the setup script for ubuntu under Ubuntu 22.04 by running a few checks defined in make quick_checks

  • missing and updated dependencies
  • fixes python support
  • updates simulation dependencies
  • removes jmavsim deps
  • installs gazebo harmonic by default
  • setup: install zeromq for ubuntu 24.04
  • cleans up ubuntu script

@MaEtUgR MaEtUgR mentioned this pull request Oct 30, 2024
6 tasks
@mrpollo
Copy link
Contributor Author

mrpollo commented Oct 30, 2024

Funny how both are failing.

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-sync-q-a-oct-30-2024/42184/1

@TannerGilbert
Copy link

Funny how both are failing.

Ubuntu 22.04 installation should be fixable using sudo apt-get install -y libunwind-dev similar to #23745 (comment).

@mrpollo mrpollo force-pushed the mrpollo/ci_ubuntu branch 2 times, most recently from ed52ef7 to 4aa2893 Compare November 7, 2024 19:34
@mrpollo mrpollo changed the title ci: test ubuntu22 and ubuntu24 in ci ci: add test for Ubuntu 22.04 Nov 7, 2024
@hamishwillee
Copy link
Contributor

@mrpollo When this goes in, please direct ping me via email or IM. Since the ubuntu.sh script no longer supporting the older ubuntu versions we need some significant doc updates - for example, older versions should point to the old scripts, but they might point to the main branch versions. For the current version I also need to make it clear this won't work on older Ubuntu and you need to retest.

Maybe you also need marketing around this - it is a pain for developers to be restricted to a particular ubuntu build. Unless they work on windows of course and can use WSL2.

@dagar dagar force-pushed the mrpollo/ci_ubuntu branch 2 times, most recently from 8a1aff7 to 5512233 Compare November 13, 2024 02:45
* missing and updated dependencies
* setup: install zeromq for ubuntu 24.04
* cleans up ubuntu script
@dagar dagar force-pushed the mrpollo/ci_ubuntu branch from 5512233 to 3c67b01 Compare November 13, 2024 02:53
@dagar
Copy link
Member

dagar commented Nov 13, 2024

As a start let's first keep this super simple to get it going in CI and then iterate. I've stripped it down to Ubuntu 22.04 in CI, installing the arm-none-eabi toolchain from packages (instead of custom /opt). Once that's building cleanly I'll merge and we can then do the rest incrementally.

@dagar dagar marked this pull request as ready for review November 13, 2024 03:02
@dagar
Copy link
Member

dagar commented Nov 13, 2024

MVP is good to go.

image

@dagar dagar merged commit 1e23f25 into main Nov 13, 2024
53 of 54 checks passed
@dagar dagar deleted the mrpollo/ci_ubuntu branch November 13, 2024 03:09
@dagar
Copy link
Member

dagar commented Nov 13, 2024

Next steps

  • get this going for 24.04
  • cleanup simulation
  • use to build primary px4-dev image

Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on 22.04 and it works even with the packaged ARM GCC. What did we change. I'm almost certain I tested exactly these packages when 22.04 was still new and it failed just like on 20.04. Anyways nice, thank you for the cleanup.

@@ -408,8 +408,14 @@ include(px4_add_gtest)
if(BUILD_TESTING)
include(gtest)

set(TESTFILTERARG "")
Copy link
Member

@MaEtUgR MaEtUgR Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrpollo May I ask why this was changed? I breaks the unit test filter because it ignores the argument and just always leaves it empty. Can we revert that part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason something within gtest/ctest was failing when running make tests. The failure was something like "Unknown -R argument."

What we did here is to avoid calling the test without -R when there's no argument to filter through.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean but this change just breaks the filter. Now when working on any branch from latest main I have to wait for all the tests for every single development iteration 👀 Should I open a pr to revert?

Copy link
Member

@MaEtUgR MaEtUgR Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I found the problem: #23978 😅

@mrpollo
Copy link
Contributor Author

mrpollo commented Nov 13, 2024

I tested on 22.04 and it works even with the packaged ARM GCC. What did we change. I'm almost certain I tested exactly these packages when 22.04 was still new and it failed just like on 20.04. Anyways nice, thank you for the cleanup.

There was a missing dependency that made it work, we were running into a linker issue, but @dagar fixed this by finding the missing dependencies

@PetervdPerk-NXP
Copy link
Member

@dagar @mrpollo

Uhm this changes the default from GCC 9.3.1 to OS installed version, thus Ubuntu 20.04 and Ubuntu 22.04 will use different compilers. Also there were some compiler bugs with the new GCC versions did those got fixed already?

@mrpollo
Copy link
Contributor Author

mrpollo commented Nov 13, 2024

@PetervdPerk-NXP Going forward, we will only support the last two LTS; this means Ubuntu 22.04 and Ubuntu 24.04 are our only supported versions of Ubuntu now. That said, I would be curious to test adding Ubuntu 18.04 to our CI to see how it deals with the changes.

Regarding the version bump on GCC, we were able to fix the linker issues by installing a few missing dependencies. This PR adds a CI test so we can tell when it breaks.

In #23937 I'm also adding support for Ubuntu 24.04, and moving the CI workflow to containers.

@PetervdPerk-NXP
Copy link
Member

PetervdPerk-NXP commented Nov 13, 2024

@mrpollo Well I've got targets now that don't seem to build with GCC 13.2.
Overall I understand we're upgrading the Ubuntu version, but nevertheless the compiler should be decoupled from that.
I.e. first we upgrade the compiler to version XX.XX and then we test that on multiple operating systems / distro's i.e. Ubuntu, Arch Linux, macOS etc.

EDIT it seems the #23937 containers still has GCC 9.3.1 installed but the ubuntu.sh doesn't install GCC 9.3.1.
Thus CI uses GCC 9.3.1 whereas a clean Ubuntu 24.04 install uses GCC 13.2

px4_fmu_v4 doesn't build with GCC 13.2

/home/peter/src/PX4-Autopilot/platforms/common/spi.cpp: In function 'int px4_find_spi_bus(uint32_t)':
/home/peter/src/PX4-Autopilot/platforms/common/spi.cpp:90:59: error: the address of 'px4_spi_buses' will never be NULL [-Werror=address]
   90 |         for (int i = 0; ((px4_spi_bus_t *) px4_spi_buses) != nullptr && i < SPI_BUS_MAX_BUS_ITEMS; ++i) {
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[536/1335] Building CXX object platforms/common/uORB/CMakeFiles/uORB.dir/uORB.cpp.obj
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_fmu-v4] Error 1
peter@SMW015329:~/src/PX4-Autopilot$

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 19, 2024

px4_fmu_v4 doesn't build with GCC 13.2

Little did I know my fix would not hold for GCC 13 👀 adb22f1

@MaEtUgR
Copy link
Member

MaEtUgR commented Nov 20, 2024

px4_fmu_v4 doesn't build with GCC 13.2

#23994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants