Skip to content

Conversation

@danielocfb
Copy link
Collaborator

The crate does not generate a C header but Rust bindings, but wording and error messages talk about the former, which can cause confusion. Fix the wording.

The crate does not generate a C header but Rust bindings, but wording
and error messages talk about the former, which can cause confusion. Fix
the wording.

Signed-off-by: Daniel Müller <[email protected]>
@danielocfb
Copy link
Collaborator Author

Seems as if Ubuntu broke the riscv job.

@polarathene
Copy link
Contributor

Seems as if Ubuntu broke the riscv job.

It works fine on a standard Ubuntu container with equivalent commands run:

docker run --rm -it ubuntu:22.04
dpkg --add-architecture riscv64

export release=$(. /etc/os-release && echo "$UBUNTU_CODENAME")
sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
printf 'deb [arch=riscv64] http://ports.ubuntu.com/ %s main restricted\n' "${release}" "${release}-updates" "${release}-security" >> /etc/apt/sources.list

apt-get -qq update && apt-get install -y build-essential autopoint gettext libelf-dev:riscv64 zlib1g-dev:riscv64

The CI output shows that it's using different repo mirrors for packages tied to Azure/Microsoft?

Notably they seem to have a MS specific mirror logged with both amd64 + arm64 archs logged as supported? Perhaps that's a change that's messing with the resolver, which seems to happen for repo URIs that aren't constrained as intended? 🤔

Get:21 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [226 kB]
Get:22 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [19.8 kB]
Get:23 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [66.2 kB]

I did try with the GH runner sources modification to use mirrors, but it seems to install the packages fine too:

$ touch /etc/apt/apt-mirrors.txt
$ printf "http://azure.archive.ubuntu.com/ubuntu/\tpriority:1\n" | tee -a /etc/apt/apt-mirrors.txt
$ printf "https://archive.ubuntu.com/ubuntu/\tpriority:2\n" | tee -a /etc/apt/apt-mirrors.txt
$ printf "https://security.ubuntu.com/ubuntu/\tpriority:3\n" | tee -a /etc/apt/apt-mirrors.txt
$ sed -i 's|http://archive\.ubuntu\.com/ubuntu/|mirror+file:/etc/apt/apt-mirrors.txt|' /etc/apt/sources.list

$ cat /etc/apt/apt-mirrors.txt
http://azure.archive.ubuntu.com/ubuntu/ priority:1
https://archive.ubuntu.com/ubuntu/      priority:2
https://security.ubuntu.com/ubuntu/     priority:3

$ cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy main restricted
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy-updates main restricted
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy universe
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy universe
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy-updates universe
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy multiverse
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy multiverse
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy-updates multiverse
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb [arch=amd64] mirror+file:/etc/apt/apt-mirrors.txt jammy-backports main restricted universe multiverse
# deb-src mirror+file:/etc/apt/apt-mirrors.txt jammy-backports main restricted universe multiverse

deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse
deb [arch=riscv64] http://ports.ubuntu.com/ jammy main restricted
deb [arch=riscv64] http://ports.ubuntu.com/ jammy-updates main restricted
deb [arch=riscv64] http://ports.ubuntu.com/ jammy-security main restricted

So unclear where the issue is on the runner instance (I haven't tried running the equivalent).


FWIW, maybe consider upgrading to Ubuntu 24.04? Instead of the /etc/apt/sources.list updates, you'd cover both foreign archs (arm64 + riscv64) by appending to /etc/apt/sources.list.d/ubuntu.sources:

Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: arm64 riscv64

This also requires an Architectures: amd64 constraint on the existing entries to avoid resolver errors for the other foreign archs added via dpkg, so the file will look like:

# Default arch support: (amd64 + i386)
# https://www.archive.ubuntu.com/ubuntu/dists/noble/main/
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: amd64

## Ubuntu security updates. Aside from URIs and Suites,
## this should mirror your choices in the previous section.
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: amd64

# Additional arch support: (arm64 + armhf + ppc64el + riscv64 + s390x)
# https://ports.ubuntu.com/ubuntu-ports/dists/noble/main/
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-backports noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: arm64 riscv64

So I assume the runner config differs from the above. Might be nicer to inspect via the Ubuntu 24.04 runner which uses the newer sources config approach (old one is deprecated/discouraged).

@danielocfb
Copy link
Collaborator Author

They screw up regularly and break various things packaging. It's a lost cause. But fixed now...

@danielocfb danielocfb merged commit d23b714 into libbpf:master Jul 1, 2025
16 of 22 checks passed
@danielocfb danielocfb deleted the topic/rust-bindings branch July 1, 2025 14:48
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