Discussion:
sbuild wiki page - cross compiling section query
(too old to reply)
Phil Wyett
2025-01-20 16:40:01 UTC
Permalink
Hi all,

https://wiki.debian.org/sbuild

https://wiki.debian.org/sbuild#Cross-compiling_packages


On the sbuild wiki page in the cross compiling section should we be advising
users that they need to create a chroot for the {ARCH} they wish to cross build
for and also have the relevant crossbuild-essential-{ARCH} package installed?

Regards

Phil
--
Donations...

Buy Me A Coffee: https://buymeacoffee.com/kathenasorg

--

"I play the game for the game’s own sake"

Arthur Conan Doyle - The Adventure of the Bruce-Partington Plans

--

Internet Relay Chat (IRC): kathenas

Website: https://kathenas.org

Instagram: https://instagram.com/kathenasorg

Threads: https://www.threads.net/@kathenasorg

--
Jochen Sprickerhof
2025-01-20 17:00:02 UTC
Permalink
Hi Phil,
Post by Phil Wyett
https://wiki.debian.org/sbuild
https://wiki.debian.org/sbuild#Cross-compiling_packages
On the sbuild wiki page in the cross compiling section should we be advising
users that they need to create a chroot for the {ARCH} they wish to cross build
for and also have the relevant crossbuild-essential-{ARCH} package installed?
No, why?

Cross compiling means that you need that normal build arch chroot as
initial set up. An other thing is using sbuild --arch=, that uses qemu
most of the time, where you need the arch chroot.

Cheers Jochen
Phil Wyett
2025-01-20 17:20:01 UTC
Permalink
Post by Jochen Sprickerhof
Hi Phil,
Post by Phil Wyett
https://wiki.debian.org/sbuild
https://wiki.debian.org/sbuild#Cross-compiling_packages
On the sbuild wiki page in the cross compiling section should we be advising
users that they need to create a chroot for the {ARCH} they wish to cross build
for and also have the relevant crossbuild-essential-{ARCH} package installed?
No, why?
Cross compiling means that you need that normal build arch chroot as
initial set up. An other thing is using sbuild --arch=, that uses qemu
most of the time, where you need the arch chroot.
Cheers Jochen
Hi,

Ah... Let me describe my setup.

* A VM with Debian trixie install - standard utilities plus ssh server.
* sbuild, pbuilder, piuparts and reprotest etc. installed.
* qemu is not the install.

For --host=arm64 I have to generate an arm64 chroot and install crossbuild-
essential-arm64 for crossbuilds to work.

Regards

Phil
--
Donations...

Buy Me A Coffee: https://buymeacoffee.com/kathenasorg

--

"I play the game for the game’s own sake"

Arthur Conan Doyle - The Adventure of the Bruce-Partington Plans

--

Internet Relay Chat (IRC): kathenas

Website: https://kathenas.org

Instagram: https://instagram.com/kathenasorg

Threads: https://www.threads.net/@kathenasorg

--
Phil Wyett
2025-01-20 17:20:02 UTC
Permalink
Post by Phil Wyett
Post by Jochen Sprickerhof
Hi Phil,
Post by Phil Wyett
https://wiki.debian.org/sbuild
https://wiki.debian.org/sbuild#Cross-compiling_packages
On the sbuild wiki page in the cross compiling section should we be advising
users that they need to create a chroot for the {ARCH} they wish to cross build
for and also have the relevant crossbuild-essential-{ARCH} package installed?
No, why?
Cross compiling means that you need that normal build arch chroot as
initial set up. An other thing is using sbuild --arch=, that uses qemu
most of the time, where you need the arch chroot.
Cheers Jochen
Hi,
Ah... Let me describe my setup.
* A VM with Debian trixie install - standard utilities plus ssh server.
* sbuild, pbuilder, piuparts and reprotest etc. installed.
* qemu is not the install.
For --host=arm64 I have to generate an arm64 chroot and install crossbuild-
essential-arm64 for crossbuilds to work.
Regards
Phil
Hi,

I mainly ran into issue with autopkgtest which looked for --arch (unshare
default config) and failed unless I generated the arm64 chroot.

Regards

Phil
--
Donations...

Buy Me A Coffee: https://buymeacoffee.com/kathenasorg

--

"I play the game for the game’s own sake"

Arthur Conan Doyle - The Adventure of the Bruce-Partington Plans

--

Internet Relay Chat (IRC): kathenas

Website: https://kathenas.org

Instagram: https://instagram.com/kathenasorg

Threads: https://www.threads.net/@kathenasorg

--
Andrey Rakhmatullin
2025-01-20 17:30:01 UTC
Permalink
Post by Phil Wyett
I mainly ran into issue with autopkgtest
Good.
autopkgtest and package building are separate unrelated activities.
--
WBR, wRAR
Jochen Sprickerhof
2025-01-20 18:00:01 UTC
Permalink
Post by Phil Wyett
I mainly ran into issue with autopkgtest which looked for --arch (unshare
default config) and failed unless I generated the arm64 chroot.
sbuild passes --arch to autopkgtest as you can't run tests in a cross
compile setup. autopkgtest then uses qemu to run them. This works in
principal but is really slow so I recommend to run autopkgtest on a
native system and not via sbuild when cross compiling. Also note that
autopkgtest-virt-unshare, like sbuild, can create chroots automatically
in trixie and I would prefer to drop the chroot creation parts from the
wiki page instead at some point.

Cheers Jochen
Jochen Sprickerhof
2025-01-20 17:30:01 UTC
Permalink
Post by Phil Wyett
* A VM with Debian trixie install - standard utilities plus ssh server.
Which arch has the VM?
Post by Phil Wyett
For --host=arm64 I have to generate an arm64 chroot and install crossbuild-
essential-arm64 for crossbuilds to work.
If you want to cross build a package, i.e. your system is not arm64 and
you want to compile a package that is arm64 you need a chroot from host
system arch and sbuild will take care of the rest, no need to manually
install crossbuild-essential-arm64 or anything. Did you try that?

Cheers Jochen
Phil Wyett
2025-01-20 17:40:01 UTC
Permalink
Post by Jochen Sprickerhof
Post by Phil Wyett
* A VM with Debian trixie install - standard utilities plus ssh server.
Which arch has the VM?
Post by Phil Wyett
For --host=arm64 I have to generate an arm64 chroot and install crossbuild-
essential-arm64 for crossbuilds to work.
If you want to cross build a package, i.e. your system is not arm64 and
you want to compile a package that is arm64 you need a chroot from host
system arch and sbuild will take care of the rest, no need to manually
install crossbuild-essential-arm64 or anything. Did you try that?
Cheers Jochen
Hi,

The VM arch is amd64.

I have a build running at the moment. When it completes (probably the early
hours of tomorrow), I will clone it and perform tests to see what is and is not
required.

Regards

Phil
--
Donations...

Buy Me A Coffee: https://buymeacoffee.com/kathenasorg

--

"I play the game for the game’s own sake"

Arthur Conan Doyle - The Adventure of the Bruce-Partington Plans

--

Internet Relay Chat (IRC): kathenas

Website: https://kathenas.org

Instagram: https://instagram.com/kathenasorg

Threads: https://www.threads.net/@kathenasorg

--
Phil Wyett
2025-01-21 09:50:01 UTC
Permalink
Post by Jochen Sprickerhof
Post by Phil Wyett
* A VM with Debian trixie install - standard utilities plus ssh server.
Which arch has the VM?
Post by Phil Wyett
For --host=arm64 I have to generate an arm64 chroot and install crossbuild-
essential-arm64 for crossbuilds to work.
If you want to cross build a package, i.e. your system is not arm64 and
you want to compile a package that is arm64 you need a chroot from host
system arch and sbuild will take care of the rest, no need to manually
install crossbuild-essential-arm64 or anything. Did you try that?
Cheers Jochen
Hi Jochen and all,

Indeed, the crossbuild-essential-* were not necessary and have now been
removed.

I will be keeping the arm64 riscv64 chroots to enable autopkgtest to run
successfully with sbuild and I find the tests run extremely quickly.

Running native methods mentioned I will test on another laptop I shall make
full Debian testing. These things are not possible on my daily driver that due
to circumstance it runs Red Hat Enterprise Linux 9.x.

Regards

Phil
--
Donations...

Buy Me A Coffee: https://buymeacoffee.com/kathenasorg

--

"I play the game for the game’s own sake"

Arthur Conan Doyle - The Adventure of the Bruce-Partington Plans

--

Internet Relay Chat (IRC): kathenas

Website: https://kathenas.org

Instagram: https://instagram.com/kathenasorg

Threads: https://www.threads.net/@kathenasorg

--
Andrey Rakhmatullin
2025-01-20 17:30:01 UTC
Permalink
Post by Phil Wyett
* A VM with Debian trixie install - standard utilities plus ssh server.
* sbuild, pbuilder, piuparts and reprotest etc. installed.
* qemu is not the install.
For --host=arm64 I have to generate an arm64 chroot
No.
Post by Phil Wyett
and install crossbuild-essential-arm64 for crossbuilds to work.
Building arm64 in an arm64 chroot is not even a cross-build, you wouldn't
need crossbuild-*.
--
WBR, wRAR
Andrey Rakhmatullin
2025-01-20 17:00:02 UTC
Permalink
Post by Phil Wyett
https://wiki.debian.org/sbuild
https://wiki.debian.org/sbuild#Cross-compiling_packages
On the sbuild wiki page in the cross compiling section should we be advising
users that they need to create a chroot for the {ARCH} they wish to cross build
for and also have the relevant crossbuild-essential-{ARCH} package installed?
Are you confusing cross-building with building in foreign chroots? The
section you linked says "To build a package for arm64 in an amd64 chroot
(as created above)".
--
WBR, wRAR
Loading...