[build2] Build2 does not build on Ubuntu 24.04

Michael Martin Moro michael at planed.es
Wed Apr 10 16:05:33 UTC 2024


Greetings !

I have a Dockerfile that I use to build projects with build2. Up until 
recently, I've been using ubuntu:22.04 with this Dockerfile. Today, I 
tried to update to 24.04.

The good thing is that the setup is very easy to reproduce. Here's the 
Dockerfile, up until the point of failure:

    FROMubuntu:22.04

    WORKDIR/tmp
    ENVLD_LIBRARY_PATH /usr/local/lib
    ENVDEBIAN_FRONTEND "noninteractive"
    ENVTZ "Europe/London"

    RUNapt-get -y--allow-unauthenticatedupdate &&\
        apt-get -y--allow-unauthenticatedupgrade &&\
        apt-get -yinstall curl \
      cmake \
      pkg-config \
      build-essential \
      libbz2-dev \
      libssl-dev \
      git

    COPYbuild-build2.sh build-build2.sh
    RUN bash build-build2.sh

And here's the build-build2.sh script:

    #!/bin/sh -ex

    exportBUILD2_VERSION="0.16.0"
    exportBUILD2_FINGERPRINT="70:64:FE:E4:E0:F3:60:F1:B4:51:E1:FA:12:5C:E0:B3:DB:DF:96:33:39:B9:2E:E5:C2:68:63:4C:A6:47:39:43"

    curl
    -sSfOhttps://download.build2.org/$BUILD2_VERSION/build2-install-$BUILD2_VERSION.sh

    chmod+xbuild2-install-$BUILD2_VERSION.sh
    sh build2-install-$BUILD2_VERSION.sh --yes--trust"$BUILD2_FINGERPRINT"

Using these 2 files as they are, you should be able to build a 
functional ubuntu 22.04 with build2 installed.

However, changing the first line of the Dockerfile to `FROM 
ubuntu:24.04` will cause the build2 install script to fail with the 
following errors:

    /tmp/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:29:1:error:
    static declaration of 'strlcpy' follows non-static declaration
       29 | strlcpy(char* dst, const char* src, size_t siz)
          | ^~~~~~~
    In file included from
    /tmp/build2-toolchain-0.16.0/libpkg-config/libpkg-config/stdinc.h:35,
                     from
    /tmp/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:17:
    /usr/include/string.h:506:15:note: previous declaration of 'strlcpy'
    with type 'size_t(char * restrict,  const char * restrict,  size_t)'
    {aka 'long unsigned int(char * restrict,  const char * restrict,
      long unsigned int)'}
      506 | extern size_t strlcpy(char *__restrict __dest,
          | ^~~~~~~
    /tmp/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:67:1:error:
    static declaration of 'strlcat' follows non-static declaration
       67 | strlcat(char* dst, const char* src, size_t siz)
          | ^~~~~~~
    /usr/include/string.h:512:15:note: previous declaration of 'strlcat'
    with type 'size_t(char * restrict,  const char * restrict,  size_t)'
    {aka 'long unsigned int(char * restrict,  const char * restrict,
      long unsigned int)'}
      512 | extern size_t strlcat(char *__restrict __dest,
          | ^~~~~~~

I have no clear idea what's going on. Ubuntu 24.04 ships g++13, which I 
have already used countless times on Fedora to build build2 using the 
same script.

I'm guessing HAVE_STRLCPY and HAVE_STRLCAT should've been defined, and 
weren't. Seems like the documentation for libbuild2-autoconf may contain 
the relevant information to fix the issue... I might look into it again 
at a later time, but for now I'm hoping this message will be helpful !

Bye !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20240410/6f0007b2/attachment.html>


More information about the users mailing list