dotnet / dotnet-buildtools-prereqs-docker

Used to maintain the Docker images hosted at the mcr.microsoft.com/dotnet-buildtools/prereqs image repository
MIT License
53 stars 98 forks source link

Building rootfs fails for ubuntu-22.04-cross-riscv64 #1088

Closed sbomer closed 2 weeks ago

sbomer commented 2 weeks ago

This is failing consistently with:

 > [builder 3/3] RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 sid --skipunmount:
13.14 I: Retrieving usrmerge 39
13.14 I: Validating usrmerge 39
13.16 I: Retrieving util-linux 2.40.1-8.1
13.17 I: Validating util-linux 2.40.1-8.1
13.19 I: Retrieving zlib1g 1:1.3.dfsg+really1.3.1-1
13.21 I: Validating zlib1g 1:1.3.dfsg+really1.3.1-1
13.22 I: Chosen extractor for .deb packages: dpkg-deb
13.25 I: Extracting apt...
13.34 I: Extracting base-files...
13.35 E: Tried to extract package, but file already exists. Exit...

Not sure when it started failing, but it happens for example in https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/1087 and https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/1083.

@am11, any idea what might be causing this?

am11 commented 2 weeks ago

debootstrap version is old.

I have tested 2 and 3 and it works. The best would be 1 (with clang 18 if possible). 3 is the fastest, stop-gap solution.

sbomer commented 2 weeks ago

Thanks! I think it's worth trying out solution 1. I'm happy to do so, unless you were planning to.

am11 commented 2 weeks ago

For solution 1, we can start by adding sources.list.noble at https://github.com/dotnet/arcade/tree/main/eng/common/cross/riscv64, followed by the work in this repo. If you are already on it, I can give moral support and help testing. 😄

sbomer commented 2 weeks ago

Unfortunately I think debootstrap (at least the version in Azure Linux 3.0) doesn't support noble yet:

#9 [builder 3/3] RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 noble --skipunmount
#9 0.258 E: No such script: /usr/share/debootstrap/scripts/noble
#9 ERROR: process "/bin/sh -c /scripts/eng/common/cross/build-rootfs.sh riscv64 noble --skipunmount" did not complete successfully: exit code: 1

For solution 2, I assume you meant Ubuntu 24.04 right?

am11 commented 2 weeks ago

Solution 1 can use solution 3 git clone --depth 1 https://git.launchpad.net/ubuntu/+source/debootstrap /debootstrap etc. until debootstrap is update in Azure Linux packages?

richlander commented 2 weeks ago

I am having a related problem in #1096, blocking progress on that PR.

I see this.

#5 [builder 1/3] FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-crossdeps-local
#5 CACHED

#6 [builder 3/3] RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 sid --skipunmount
#6 0.249 running debootstrap --variant=minbase --keyring /usr/share/keyrings/debian-archive-keyring.gpg --include=debian-archive-keyring --force-check-gpg --arch riscv64 sid /crossrootfs/riscv64 http://ports.ubuntu.com/
#6 0.304 I: Retrieving InRelease 
#6 0.679 I: Retrieving Release 
#6 1.052 E: Failed getting release file http://ports.ubuntu.com/dists/sid/Release
#6 ERROR: executor failed running [/bin/sh -c /scripts/eng/common/cross/build-rootfs.sh riscv64 sid --skipunmount]: exit code: 1
------

It is indeed true that http://ports.ubuntu.com/dists/sid/Release 404s. Lots of other releases are at the parent directory: http://ports.ubuntu.com/dists/.

Why do we use sid? Why note use the matching distro version?

am11 commented 2 weeks ago

We use sid because risc-v is a new emerging architecture. Now that Ubuntu noble is released in April with first class risc-v support, we should switch to noble instead. Replace sid with noble. @sbomer was going to move it to Azure Linux at the same time.