[build2] Build2 does not build on Ubuntu 24.04

Ryan Edin ryan at helloryan.se
Wed Apr 10 16:56:13 UTC 2024


Hi!

Have you tried the script from https://stage.build2.org/0/0.17.0-a.0/?

// Ryan


On Wed, Apr 10, 2024 at 6:45 PM Michael Martin Moro via users <
users at build2.org> wrote:

> 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:
>
> FROM ubuntu:22.04
>
> WORKDIR /tmp
> ENV LD_LIBRARY_PATH /usr/local/lib
> ENV DEBIAN_FRONTEND "noninteractive"
> ENV TZ "Europe/London"
>
> RUN apt-get -y --allow-unauthenticated update && \
>    apt-get -y --allow-unauthenticated upgrade && \
>    apt-get -y install curl \
>  cmake \
>  pkg-config \
>  build-essential \
>  libbz2-dev \
>  libssl-dev \
>  git
>
> COPY build-build2.sh build-build2.sh
> RUN bash build-build2.sh
>
> And here's the build-build2.sh script:
>
> #!/bin/sh -ex
>
> export BUILD2_VERSION="0.16.0"
> export BUILD2_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 -sSfO https://download.build2.org/$BUILD2_VERSION/build2-install-
> $BUILD2_VERSION.sh
> chmod +x build2-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/c3dba0fd/attachment-0001.html>


More information about the users mailing list