libcamera upstream builds broken?

Naushir Patuck naush at raspberrypi.com
Wed Feb 14 16:32:39 CET 2024


On Wed, 14 Feb 2024 at 15:17, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
>
> On Wed, Feb 14, 2024 at 12:07:43PM +0000, Naushir Patuck wrote:
> > On Wed, 14 Feb 2024 at 11:57, Kieran Bingham wrote:
> > > Quoting Naushir Patuck (2024-02-14 11:53:57)
> > > > On Wed, 14 Feb 2024 at 10:39, Milan Zamazal wrote:
> > > > > Kieran Bingham writes:
> > > > > > Quoting Naushir Patuck (2024-02-14 09:48:05)
> > > > > >> Hi,
> > > > > >>
> > > > > >> I've just attempted to do a fresh build off the upstream libcamera
> > > > > >> tree (master branch) and seem to be getting some compilation errors in
> > > > > >> some of the mojom auto-generated files.  Here's the build environment:
> > > > > >
> > > > > > Can you check that you have a fully clean build environment? (Blow away
> > > > > > any existing builddir)
> > > > > >
> > > > > > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1094916
> > > > > > shows the most recent build (commit 38d28cc5) on our CI as all green at
> > > > > > least...
> > > > > >
> > > > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/54600354#L166
> > > > > > shows that this was with
> > > > > >
> > > > > > C compiler for the host machine: gcc-12 (gcc 12.2.0 "gcc-12 (Debian 12.2.0-14) 12.2.0")
> > > > > > C linker for the host machine: gcc-12 ld.bfd 2.40
> > > > > > C++ compiler for the host machine: g++-12 (gcc 12.2.0 "g++-12 (Debian 12.2.0-14) 12.2.0")
> > > > > > C++ linker for the host machine: g++-12 ld.bfd 2.40
> > > > > >
> > > > > > Double checking a clean builddir is the first step. I think we likely
> > > > > > introduced some issue where the dependencies weren't matched on the
> > > > > > mojom files, so the mojom doesn't rebuild if you cross between a 0.1
> > > > > > build and a 0.2 build ;-(
> > > >
> > > > This was from a completely new directory that was freshly setup, so no
> > > > old build artifacts to contend with.
> > > >
> > > > It's really strange, we have exactly the same gcc version there and it
> > > > works for the CI image.  I wonder if it's related to an external tool
> > > > used by the code auto-generation mechanism?
> > > >
> > > > > I can reproduce the error with Naushir's meson options and g++ 12.3.0.  It
> > > > > compiles fine without `-Dbuildtype=release' -- can it be the reason why it
> > > > > passes on the CI?
> > > >
> > > > Ah, good catch, with `-Dbuildtype=debug' it does build for me!
> > >
> > > YIKES. :-(
> > >
> > > That isn't great! And that really shouldn't cause this.
> > > And it means we need to make sure we have a debug+release build
> > > configured in the CI - though if this really is compiler specific I
> > > don't think we should build debug+release for every compiler version :(
> >
> > Yup, I've seen this discrepancy before between debug/release builds.
> > In our CI pipelines we do use a matrix of compiles and debug/release
> > builds for this reason.
> >
> > I guess the more urgent question is how to fix the breakage?  Is it an
> > option to revert the mojom update that *might* have caused the
> > breakage?
>
> How about fixing the issue instead ? :-)
>
> I gave this a quick try with gcc 12.3.1. After working around an
> unrelated build issue (due to a bug in the combination of gcc and the
> libstdc++ shipped with that version of the compiler, as far as I can
> see), libcamera build fine. I'll test with gcc 12.2.0 in a Debian
> container when I get a chance, please feel free to beat me to it.

The diff of commit d17de86904f0 (confirmed this causes the break) is
quite substantial:
64 files changed, 3828 insertions(+), 1414 deletions(-)

Any hints as to what files in the mojom tool I want to be looking at?

>
> > > > > >> ---
> > > > > >> $ g++ --version
> > > > > >> g++ (Debian 12.2.0-14) 12.2.0
> > > > > >> Copyright (C) 2022 Free Software Foundation, Inc.
> > > > > >> This is free software; see the source for copying conditions.  There is NO
> > > > > >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > > > > >>
> > > > > >> $ meson setup build -Dbuildtype=release -Dpipelines=rpi/vc4 -Dipas=rpi/vc4
> > > > > >> $ meson compile -C build
> > > > > >> INFO: autodetecting backend as ninja
> > > > > >> INFO: calculating backend command to run: /usr/local/bin/ninja -C
> > > > > >> /home/pi/libcamera1/libcamera/build
> > > > > >> ninja: Entering directory `/home/pi/libcamera1/libcamera/build'
> > > > > >> [15/65] Compiling C++ object
> > > > > >> src/libcamera/proxy/worker/raspberrypi_ipa_proxy.p/meson-generated_.._raspberrypi_ipa_proxy_worker.cpp.o
> > > > > >> FAILED: src/libcamera/proxy/worker/raspberrypi_ipa_proxy.p/meson-generated_.._raspberrypi_ipa_proxy_worker.cpp.o
> > > > > >> ccache c++ -Isrc/libcamera/proxy/worker/raspberrypi_ipa_proxy.p
> > > > > >> -Isrc/libcamera/proxy/worker -I../src/libcamera/proxy/worker -Iinclude
> > > > > >> -I../include -Iinclude/libcamera/ipa -Iinclude/libcamera
> > > > > >> -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
> > > > > >> -Wextra -Werror -std=c++17 -O3 -Wshadow -include
> > > > > >> /home/pi/libcamera1/libcamera/build/config.h -DLIBCAMERA_BASE_PRIVATE
> > > > > >> -MD -MQ src/libcamera/proxy/worker/raspberrypi_ipa_proxy.p/meson-generated_.._raspberrypi_ipa_proxy_worker.cpp.o
> > > > > >> -MF src/libcamera/proxy/worker/raspberrypi_ipa_proxy.p/meson-generated_.._raspberrypi_ipa_proxy_worker.cpp.o.d
> > > > > >> -o src/libcamera/proxy/worker/raspberrypi_ipa_proxy.p/meson-generated_.._raspberrypi_ipa_proxy_worker.cpp.o
> > > > > >> -c src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp
> > > > > >> In file included from
> > > > > >> src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:18:
> > > > > >> In static member function ‘static libcamera::ipa::RPi::ProcessParams
> > > > > >> libcamera::IPADataSerializer<libcamera::ipa::RPi::ProcessParams>::deserialize(std::vector<unsigned
> > > > > >> char>::const_iterator, std::vector<unsigned char>::const_iterator,
> > > > > >> libcamera::ControlSerializer*)’,
> > > > > >>     inlined from ‘void IPAProxyRPiWorker::readyRead()’ at
> > > > > >> src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:302:70:
> > > > > >> include/libcamera/ipa/raspberrypi_ipa_serializer.h:1172:32: error:
> > > > > >> ‘*(uint32_t*)((char*)&ret +
> > > > > >> offsetof(libcamera::ipa::RPi::ProcessParams,
> > > > > >> libcamera::ipa::RPi::ProcessParams::buffers.libcamera::ipa::RPi::BufferIds::bayer))’
> > > > > >> may be used uninitialized [-Werror=maybe-uninitialized]
> > > > > >>  1172 |                         return ret;
> > > > > >>
> > > > > >> <Many similar errors snipped>
> > > > > >> ---
> > > > > >>
> > > > > >> This builds fine on gcc version 11.4.0, but does break with v12.2.0.
> > > > > >
> > > > > > Oh that's curious.
> > > > > >
> > > > > > GCC 12 was built here:
> > > > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/54600354
> > > > > >
> > > > > >> I *think* it might be related to the recent mjom changes that removed
> > > > > >> the default constructors from the auto-generated classes.  We briefly
> > > > > >> discussed this on the mailing list [1].
> > > > > >>
> > > > > >> Anybody else able to reproduce this?
> > > > > >>
> > > > > >> Regards,
> > > > > >> Naush
> > > > > >>
> > > > > >> [1] https://lists.libcamera.org/pipermail/libcamera-devel/2024-January/040367.html
>
> --
> Regards,
>
> Laurent Pinchart


More information about the libcamera-devel mailing list