Skip to content

Conversation

@theihor
Copy link
Contributor

@theihor theihor commented Oct 17, 2025

GCC 15 is not available in Ubuntu 24.04 repositories, which is the distro used by both github and self-hosted BPF CI runners.

To enable GCC 15 installation, make setup-build-env scripts set up Ubuntu 25.10 (questing) repositories and then install the packages.

Also update cross-compilation setup with a apt config restrictions instead of manipulating the source lists.

@eddyz87
Copy link
Contributor

eddyz87 commented Oct 17, 2025

GCC 15 is not available in Ubuntu 24.04 repositories, which is the distro used by both github and self-hosted BPF CI runners.

To enable GCC 15 installation, make setup-build-env scripts set up Ubuntu 25.10 (questing) repositories and then install the packages.

whoa... that's a risky move, let me google a bit.

@eddyz87
Copy link
Contributor

eddyz87 commented Oct 17, 2025

Will the following PPA work?
https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa

It is official from Ubuntu itself, has gcc-15 package, claims to:

This PPA currently publishes packages for Plucky, Jammy, Focal, Bionic, Xenial, Wily, Vivid, Utopic, Trusty, Saucy, Raring, Quantal, Precise, Natty, Maverick, and Lucid.

@theihor
Copy link
Contributor Author

theihor commented Oct 17, 2025

Will the following PPA work? https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa

It is official from Ubuntu itself, has gcc-15 package, claims to:

This PPA currently publishes packages for Plucky, Jammy, Focal, Bionic, Xenial, Wily, Vivid, Utopic, Trusty, Saucy, Raring, Quantal, Precise, Natty, Maverick, and Lucid.

This was one of the things I tried. Unfortunately, it doesn't work.

Try this:

$ podman run --rm -it ubuntu:noble /bin/bash
$ apt update && apt install -y sudo software-properties-common
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
$ sudo apt-get update -y
$ sudo apt-get install gcc-15
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gcc-15

To enable GCC 15 installation, make setup-build-env scripts set up Ubuntu 25.10 (questing) repositories and then install the packages.

whoa... that's a risky move, let me google a bit.

I understand the concern, but in the context of bpf/libbpf CI, I don't think it's more risky than what we had so far.

If the setup-build-env is successful, the system is in a state when we are able to run kernel/selftests builds or test runs. After the ci job is done, we don't care if system dependencies are broken (which I don't think is likely btw), because we are not going to install anything else.

Sure, changes in upstream ubuntu packages may break this setup, but that has always been the case, and we already had issues when ubuntu archives were down, or with cross-compilation toolchain due to dependencies on cross-arch libs.

A viable alternative is to build gcc from source, but that's a bit more work to set up (build takes time, so the artifacts need to be cached similar to gcc-bpf). The apt repo hack appears to be working, and is easy to implement, so I want to try it first.

@eddyz87
Copy link
Contributor

eddyz87 commented Oct 17, 2025

Will the following PPA work? https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa
It is official from Ubuntu itself, has gcc-15 package, claims to:

This PPA currently publishes packages for Plucky, Jammy, Focal, Bionic, Xenial, Wily, Vivid, Utopic, Trusty, Saucy, Raring, Quantal, Precise, Natty, Maverick, and Lucid.

This was one of the things I tried. Unfortunately, it doesn't work.

Try this:

$ podman run --rm -it ubuntu:noble /bin/bash
$ apt update && apt install -y sudo software-properties-common
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
$ sudo apt-get update -y
$ sudo apt-get install gcc-15
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gcc-15

Wellp, that's unfortunate.

To enable GCC 15 installation, make setup-build-env scripts set up Ubuntu 25.10 (questing) repositories and then install the packages.

whoa... that's a risky move, let me google a bit.

I understand the concern, but in the context of bpf/libbpf CI, I don't think it's more risky than what we had so far.

If the setup-build-env is successful, the system is in a state when we are able to run kernel/selftests builds or test runs.

There is no guarantee for that, really. Dependencies of some binaries or libraries can be broken. I don't think ubuntu is tested in this half-dist-upgraded configuration.

After the ci job is done, we don't care if system dependencies are broken (which I don't think is likely btw), because we are not going to install anything else.

Sure, changes in upstream ubuntu packages may break this setup, but that has always been the case, and we already had issues when ubuntu archives were down, or with cross-compilation toolchain due to dependencies on cross-arch libs.

A viable alternative is to build gcc from source, but that's a bit more work to set up (build takes time, so the artifacts need to be cached similar to gcc-bpf). The apt repo hack appears to be working, and is easy to implement, so I want to try it first.

I see, 🤞 .

@theihor
Copy link
Contributor Author

theihor commented Oct 17, 2025

Will the following PPA work? https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa

This was one of the things I tried. Unfortunately, it doesn't work.

Wellp, that's unfortunate.

@eddyz87 looks like gcc-15 in this ppa is not available on ubuntu 24 (but why???)
Screenshot From 2025-10-17 14-49-13

@theihor theihor force-pushed the gcc-15 branch 3 times, most recently from 2feee79 to 45e313e Compare October 20, 2025 19:10
GCC 15 is not available in Ubuntu 24.04 repositories, which is the
distro used by both github and self-hosted BPF CI runners.

To enable GCC 15 installation, make setup-build-env scripts set up
Ubuntu 25.04 (plucky) repositories and then install the packages.

Update cross-compilation setup with a apt config restrictions instead
of manipulating the source lists.

Refactor the action.yml into a single action.sh script for simpler
local testing.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
@theihor
Copy link
Contributor Author

theihor commented Oct 20, 2025

To sum up:

  • If GCC >= 15, we add Ubuntu 25.04 (plucky) apt repositories and install packages from there
  • Ubuntu 25.10 (questing) doesn't work for us yet, because llvm haven't published builds for it

This approach seems to be working fine:

We can remove this hack when one of the following happens:

If the hack doesn't bite me for at least a month, I'll call it a win.

@theihor theihor merged commit 8b51dbe into main Oct 20, 2025
19 checks passed
theihor added a commit to kernel-patches/vmtest that referenced this pull request Oct 20, 2025
theihor added a commit to kernel-patches/vmtest that referenced this pull request Oct 20, 2025
See: libbpf/ci#199

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
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.

3 participants