Closed amartinz closed 1 month ago
Having the same problem trying to crossbuild lomiri-system-settings
from amd64
to arm64
on my Void Linux host: https://termbin.com/zm8f
@amartinz What was/is your host OS where you saw this? I doubt that matters but @gber wasn't able to reproduce the issue
I am using Fedora Rawhide (branched f37).
Can any of you please provide some additional information:
crossbuilder --arch=arm64 shell
and post the output of head -10000 /etc/apt/sources.list /etc/apt/sources.list.d/*.list
I can ideed build both repowerd as well as lomiri-system-settings (with https://gitlab.com/ubports/development/core/lomiri-system-settings/-/merge_requests/346 applied) just fine on Ubuntu 22.04 by running the crossbuilder@9f452fe using crossbuilder --lxd-image=ubuntu:20.04 --architecture=arm64 build
.
@gber
Can any of you please provide some additional information:
* What revision of crossbuilder are you using?
https://github.com/JamiKettunen/crossbuilder/tree/void-linux @ 06470ec
* What OS are you running?
* @JamiKettunen Do you use a wrapper around crossbuilder? Please provide the contents, particularly the cli options used.
No wrapper, storage setup without ZFS.
* Please enter the container via `crossbuilder --arch=arm64 shell` and post the output of `head -10000 /etc/apt/sources.list /etc/apt/sources.list.d/*.list`
That gave
Error: unknown option: --arch
, butcrossbuilder --architecture=arm64 shell
worked: https://termbin.com/kt3z
OK, now the problem is clear, from your /etc/apt/sources.list
:
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu focal main restricted
…
Note the comment on top, the file is create by cloud-init which is why it's missing [arch=amd64]
, now the question is if you're using a different container than me. Either it is overwritten by cloud-init
or crossbuilder thinks you're running a sdk image and doesn't execute nonsdk_container_setup
which fixes up /etc/apt/sources.list
.
According to the logs you're using ubuntu:20.04
image what's the remote of that, i.e. lxc remote ls
?
According to the logs you're using
ubuntu:20.04
image what's the remote of that, i.e.lxc remote ls
?
https://cloud-images.ubuntu.com/releases
, relevant script for focal here: https://github.com/ubports/crossbuilder/blob/9f452fe/crossbuilder#L1158-L1166
$ lxc remote ls
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| NAME | URL | PROTOCOL | AUTH TYPE | PUBLIC | STATIC | GLOBAL |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| images | https://images.linuxcontainers.org | simplestreams | none | YES | NO | NO |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| local (current) | unix:// | lxd | file access | NO | YES | NO |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| ubports-sdk | https://sdk-images.ubports.com | simplestreams | none | YES | NO | NO |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| ubuntu | https://cloud-images.ubuntu.com/releases | simplestreams | none | YES | YES | NO |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
| ubuntu-daily | https://cloud-images.ubuntu.com/daily | simplestreams | none | YES | YES | NO |
+-----------------+------------------------------------------+---------------+-------------+--------+--------+--------+
According to the logs you're using
ubuntu:20.04
image what's the remote of that, i.e.lxc remote ls
?
https://cloud-images.ubuntu.com/releases
, relevant script for focal here: https://github.com/ubports/crossbuilder/blob/9f452fe/crossbuilder#L1158-L1166
Yep, but the name is configurable hence my question. But as I see you're using the default
| ubuntu | https://cloud-images.ubuntu.com/releases | simplestreams | none | YES | YES | NO |
so something else (configuration?) must explain why cloud-init overwrites the /etc/apt/sources.list
prepared by crossbuilder.
so something else (configuration?) must explain why cloud-init overwrites the
/etc/apt/sources.list
prepared by crossbuilder.
@gber exec_container_root apt update
(in create_container()
) runs the cloud-init
stuff overwriting the changes made earlier, so it looks like nonsdk_container_setup()
call needs to be moved after that.
@gber exec_container_root apt update (in create_container()) runs the cloud-init stuff overwriting the changes made earlier, so it looks like nonsdk_container_setup() call needs to be moved after that.
cloud-init runs on boot when the container is first started, apt update
then only downloads the packaging metadata from the configured repositories, it needs to be run after nonsdk_container_setup()
because of the changes made there.
To me it rather looks like nonsdk_container_setup()
itself or the sed commands changing sources.list
are not being run, can you check with set -x
what's going on there?
@amartinz What was the fix? I can test this soon again but I don't believe this got fixed?
It didn't,
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages 404 Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.38 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
crossbuilder 59592bd8f980cad81703d464426a51d959138541 os Artix with OpenRC, fixed cgroups for running systemd in lxc no wrapper
head -10000 /etc/apt/sources.list /etc/apt/sources.list.d/*.list
The code here is responsible for setting up sources.list
for crossbuilding.
My feeling is that HOST_ARCH
is wrong?
Hmm, gcc -print-multiarch
returns nothing, but
$ gcc -dumpmachine | sed 's/^\([^-]\+\)-\([^-]\+\)-\([^-]\+\)-\([^-]\+\)$/\1-\3-\4/'
x86_64-linux-gnu
so that looks fine since it would be mapped to amd64
. I'll try to debug later, for some reason I thought all of that happens in the image, not in crossbuilder.
I can confirm this still seems to be a problem:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.82 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
Running this script in the container seems to mitigate this problem:
#!/bin/bash
sed -i 's/deb http/deb [arch=amd64\,i386] http/g' /etc/apt/sources.list
sed -e 's/amd64\,i386/arm64/g' -e 's/archive\.ubuntu/ports\.ubuntu/g' -e 's/security\.ubuntu/ports\.ubuntu/g' -e 's/\.com\/ubuntu/\.com\/ubuntu-ports/g' /etc/apt/sources.list | tee /etc/apt/sources.list.d/arm64.list
Could you please test if #78 fixes the issue?
Could you please test if #78 fixes the issue?
Still seems to be broken even with that PR for me; will look into it as well at some point, but I have some other projects as well
I have tried to build
repowerd
andlomiri-system-settings
using crossbuilder. However it fails everytime when fetching dependencies:My current workaround is to manually enter the created lxc container and edit
/etc/apt/sources.list
, replacing all instances ofdeb
withdeb [arch=amd64,i386]
.