intel / tdx-tools

Cloud Stack and Solutions for Intel TDX (Trust Domain Extension)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Failure for intel-mvp-tdx-qemu-kvm

kkbodke opened this issue · comments

tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/packages/init.c
In function ‘ppc64_patch_handlers’,
inlined from ‘cpu_970_init’ at /home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/arch/ppc/qemu/init.c:433:5:
/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/arch/ppc/qemu/init.c:400:10: error: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=array-bounds]
400 | *dsi = 0x48002002;
| ~~~~~^~~~~~~~~~~~
/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/arch/ppc/qemu/init.c:403:10: error: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Werror=array-bounds]
403 | *isi = 0x48002202;

cc1: all warnings being treated as errors
make[1]: *** [rules.mak:323: target/arch/ppc/qemu/init.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/b/openbios/obj-ppc'
make: *** [debian/rules:466: b/openbios/obj-ppc/.built] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed

commented

Do you try to use "./pkg-builder build-repo.sh"? It means run build-repo.sh within docker provided by pkg-builder.
I think this will help to avoid build failure caused by environment or gcc version.

We don't use pkg-builder. We are trying to build all the components natively on ubuntu machine.

Seem to be throwing build errors at different places for every build triggered.
And all the errors are from powerpc builds.

Suggestion:

Can we improve this by just focusing on the x86 builds?
This will help improve the time it takes to build all the packages.

Why do we care building non-x86 targets?

powerpc64-linux-gnu-gcc $EXTRACFLAGS -m32 -mcpu=604 -msoft-float -fno-builtin-bcopy -fno-builtin-log2 -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -Wall -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs -Werror -MMD -MP -MT target/drivers/usb.o -MF 'target/drivers/usb.d' -I/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/include -I/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/kernel/include -I./target/include -c -o target/drivers/usb.o /home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/drivers/usb.c
make[1]: *** [rules.mak:323: target/arch/ppc/qemu/init.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/drivers/usb.c: In function ‘get_descriptor’:
/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/drivers/usb.c:202:23: warning: array subscript ‘device_descriptor_t[0]’ is partly outside array bounds of ‘u8[8]’ {aka ‘unsigned char[8]’} [-Warray-bounds]
202 | if (dd->bMaxPacketSize0 != 0)
| ^~
/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/roms/openbios/drivers/usb.c:183:12: note: object ‘buf’ of size 8
183 | u8 buf[8];
| ^~~
make[1]: Leaving directory '/home/kkbodke/tdx-tools/build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/mvp-tdx-qemu-v7.2.0/b/openbios/obj-ppc'
make: *** [debian/rules:466: b/openbios/obj-ppc/.built] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed

commented

We don't use pkg-builder. We are trying to build all the components natively on ubuntu machine.

We are suggesting use pkg-builder in docker, it will avoid tons of potential issues.... it is very hard to debug build issue on different Ubuntu envrionment.

In our github action, each modification will trigger package build to make sure no regression on package build, please see latest build results for qemu-kvm at https://github.com/intel/tdx-tools/actions/runs/5367978897/jobs/9738533726

./pkg-builder build-repo.sh
Build container image...
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM ubuntu:22.04
Get "https://registry-1.docker.io/v2/": dial tcp 44.205.64.79:443: i/o timeout
Unable to find image 'pkg-builder-ubuntu-22.04:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

commented

There are two types proxy need be configured for docker:

  1. proxy used for build docker container
    Please refer https://stackoverflow.com/questions/58841014/set-proxy-on-docker
  2. proxy used for run docker container
  3. https://docs.docker.com/network/proxy/#configure-the-docker-client
commented

@kkbodke if no more build failure, I will close this issue, OK?