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

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

Closed
sbomer opened this issue Jun 11, 2024 · 7 comments · Fixed by #1098
Closed

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

sbomer opened this issue Jun 11, 2024 · 7 comments · Fixed by #1098
Assignees

Comments

@sbomer
Copy link
Member

sbomer commented Jun 11, 2024

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 #1087 and #1083.

@am11, any idea what might be causing this?

@am11
Copy link
Member

am11 commented Jun 11, 2024

debootstrap version is old.

  • Solution 1: switch host layer to CBL-Mariner/AzL and use 24.04 rootfs for riscv64 (now that it's a stable arch since 24.04; no longer an experimental arch)
  • Solution 2: switch host layer to Ubuntu 22.04 and keep using Debian sid
  • Solution 3: add the following three lines in crossdeps layer:
     git clone --depth 1 https://git.launchpad.net/ubuntu/+source/debootstrap /debootstrap
     chmod a+x /debootstrap/debootstrap
     ln -s /debootstrap/debootstrap -t /usr/local/bin

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
Copy link
Member Author

sbomer commented Jun 11, 2024

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

@sbomer sbomer self-assigned this Jun 11, 2024
@am11
Copy link
Member

am11 commented Jun 11, 2024

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
Copy link
Member Author

sbomer commented Jun 11, 2024

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
Copy link
Member

am11 commented Jun 11, 2024

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
Copy link
Member

richlander commented Jun 16, 2024

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
Copy link
Member

am11 commented Jun 16, 2024

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.

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

Successfully merging a pull request may close this issue.

4 participants