> I was going to remain silent, but since there's now multiple people saying
> this sounds good -- I think this sounds horrible. :)
> To wit, it seems too complex and too much setup/overhead. I'll try and
> look closer at this soon to see if I can feed back our local changes that
> seem to be working.

It is not that bad in my opinion [1] :
 1) add support for multiarch (must be done once after reboot)
~# docker run --rm --privileged multiarch/qemu-user-static --reset --persistent 
yes --credential yes
 2) create your chroot (must be done once - I am sharing my homedir with my 
chroot and same UID/GID)
~# docker run --name aarch64_u1804 --privileged --net host -v $HOME:$HOME -v 
/dev:/dev -v/lib/modules:/lib/modules/host:ro -td arm64v8/ubuntu:18.04 /bin/bash
~# docker container exec aarch64_u1804 sh -c "apt -qy update && apt 
dist-upgrade -qy && apt install -qy vim sudo make git && groupadd -g $(id -rg) 
$USER && useradd -u $(id -ru) -g $(id -rg) -M -d $HOME -s /bin/bash $USER && 
echo '$USER ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && echo aarch64_u1804 > 
/etc/debian_chroot"
 3) compile vpp (I already checked out VPP in $HOME/src/vpp but you can 
checkout it there too if you prefer)
~# docker container exec aarch64_u1804 su "$USER" -l -c "UNATTENTED=y make -C 
src/vpp install-dep install-ext-deps pkg-deb"
[...]
dpkg-deb: building package 'libvppinfra-dev' in 
'../libvppinfra-dev_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp-dbg' in 
'../vpp-dbg_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'libvppinfra' in 
'../libvppinfra_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp-api-python' in 
'../vpp-api-python_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp' in '../vpp_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp-plugin-dpdk' in 
'../vpp-plugin-dpdk_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'python3-vpp-api' in 
'../python3-vpp-api_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp-dev' in 
'../vpp-dev_20.01-rc0~538-gbb41ee925_arm64.deb'.
dpkg-deb: building package 'vpp-plugin-core' in 
'../vpp-plugin-core_20.01-rc0~538-gbb41ee925_arm64.deb'.
make[2]: Leaving directory 
'/home/bganne/src/vpp/build-root/build-vpp-native/vpp'
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../vpp_20.01-rc0~538-gbb41ee925_arm64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source --after-build vpp
dpkg-buildpackage: info: binary-only upload (no source included)
make[1]: Leaving directory '/home/bganne/src/vpp/build-root'
make: Leaving directory '/home/bganne/src/vpp'

Enjoy :)

ben

[1] https://github.com/multiarch/qemu-user-static/blob/master/README.md

> > On Oct 30, 2019, at 1:38 PM, Benoit Ganne (bganne) <bga...@cisco.com>
> wrote:
> >
> > Yeah I agree it is probably the best way to x-compile. x-compilation
> toolchain is a pain to use with a pile of corner-cases. Using qemu
> emulation, it just becomes native compilation again...
> >
> > ben
> >
> >> -----Original Message-----
> >> From: Damjan Marion <dmar...@me.com>
> >> Sent: mercredi 30 octobre 2019 18:16
> >> To: Benoit Ganne (bganne) <bga...@cisco.com>
> >> Cc: Christian Hopps <cho...@chopps.org>; Stanislav Chlebec
> >> <stanislav.chle...@pantheon.tech>; vpp-dev@lists.fd.io
> >> Subject: Re: [vpp-dev] Change in vpp[master]: ebuild: Cross compilation
> >> aarch64 Ubuntu support
> >>
> >>
> >>    On 30 Oct 2019, at 16:56, Benoit Ganne (bganne) <bga...@cisco.com
> >> <mailto:bga...@cisco.com> > wrote:
> >>
> >>    I used qemu + chroot + Linux binfmt support with great success for
> >> x-compilation, such as described here:
> >> https://wiki.ubuntu.com/UbuntuDevelopment/Ports
> >>
> >>    The basic steps are:
> >>    - prepare a chroot mirroring your target (eg. using debootstrap)
> >>    - setup Linux binfmt to call qemu-arm-static for ARM binaries and
> >> copy qemu-arm-static into the chroot
> >>    - chroot
> >>    - compile as usual
> >>
> >>    The magic is the kernel will automatically call qemu-arm-static each
> >> time you try to run an ARM binary, so you transparently execute ARM
> >> binaries on your x86 host. That will probably not work to run a full-
> >> fledge VPP but it usually works great for compilation.
> >>
> >>    I guess that's what Damjan refers to?
> >>
> >>
> >>
> >> exactly :)
> >>
> >>
> >>
> >>
> >>    ben
> >>
> >>
> >>
> >>            -----Original Message-----
> >>            From: vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>  <vpp-
> >> d...@lists.fd.io <mailto:vpp-dev@lists.fd.io> > On Behalf Of Christian
> >>            Hopps
> >>            Sent: mercredi 30 octobre 2019 16:48
> >>            To: Damjan Marion <dmar...@me.com <mailto:dmar...@me.com> >
> >>            Cc: Christian Hopps <cho...@chopps.org
> >> <mailto:cho...@chopps.org> >; Stanislav Chlebec
> >>            <stanislav.chle...@pantheon.tech
> >> <mailto:stanislav.chle...@pantheon.tech> >; vpp-dev@lists.fd.io
> >> <mailto:vpp-dev@lists.fd.io>
> >>            Subject: Re: [vpp-dev] Change in vpp[master]: ebuild: Cross
> >> compilation
> >>            aarch64 Ubuntu support
> >>
> >>
> >>
> >>
> >>
> >>                    On Oct 30, 2019, at 11:13 AM, Damjan Marion via
> >> Lists.Fd.Io
> >>
> >>
> >>            <dmarion=me....@lists.fd.io
> >> <mailto:dmarion=me....@lists.fd.io> > wrote:
> >>
> >>
> >>
> >>                    On other side it is quite easy to run docker or lxc in
> >> cross-arch mode
> >>
> >>
> >>            those days and basically
> >>
> >>
> >>                    have chosen distro inside the container which will
> >> produce proper
> >>
> >>
> >>            artifacts with close to zero modifications of the build
> >> system.
> >>
> >>
> >>
> >>                    So i’m wondering if we can go into that direction….
> >>
> >>
> >>
> >>            We use docker to build our software, but then we are just
> >> using docker
> >>            running on x86 using the standard x-compile tools (either dpkg
> >> --add-arch
> >>            under ubuntu or openwrt/buildroot build from source) that I
> >> mentioned in a
> >>            previous mail. This is just a way for us to have a standard
> >> build
> >>            environment in place. We aren't doing some sort of simulation
> >> of the
> >>            foreign architecture.
> >>
> >>            Using docker has some drawbacks.. It runs as root (thus the
> >> files created
> >>            are owned by root), unless you run it as a user. If you run it
> >> as a user
> >>            you end up needing to create a build container that has that
> >> user in it
> >>            with the correct id (number) that matches the users id on the
> >> host system.
> >>            Fetching things from the network using ssh (git clone) can get
> >> ugly (it's
> >>            doable, and we do it, but...)
> >>
> >>            I don't think what we're doing would help much with a project
> >> trying to
> >>            enable x-compiling, but what we're doing may not be what your
> >> referring to
> >>            as cross-arch mode.
> >>
> >>            Thanks,
> >>            Chris.
> >>
> >>
> >>            -=-=-=-=-=-=-=-=-=-=-=-
> >>            Links: You receive all messages sent to this group.
> >>
> >>            View/Reply Online (#14393): https://lists.fd.io/g/vpp-
> >> dev/message/14393
> >>            Mute This Topic: https://lists.fd.io/mt/39781289/1633896
> >>            Group Owner: vpp-dev+ow...@lists.fd.io
> >>            Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub
> >> [bga...@cisco.com <mailto:bga...@cisco.com> ]
> >>            -=-=-=-=-=-=-=-=-=-=-=-
> >>
> >

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14410): https://lists.fd.io/g/vpp-dev/message/14410
Mute This Topic: https://lists.fd.io/mt/39781289/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to