From michael at planed.es Wed Apr 10 16:05:33 2024 From: michael at planed.es (Michael Martin Moro) Date: Wed, 10 Apr 2024 18:05:33 +0200 Subject: [build2] Build2 does not build on Ubuntu 24.04 Message-ID: <9a4ad6e2-f5b7-4eb0-bb96-9400904ef925@planed.es> 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: From ryan at helloryan.se Wed Apr 10 16:56:13 2024 From: ryan at helloryan.se (Ryan Edin) Date: Wed, 10 Apr 2024 18:56:13 +0200 Subject: [build2] Build2 does not build on Ubuntu 24.04 In-Reply-To: <9a4ad6e2-f5b7-4eb0-bb96-9400904ef925@planed.es> References: <9a4ad6e2-f5b7-4eb0-bb96-9400904ef925@planed.es> Message-ID: 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: From boris at codesynthesis.com Wed Apr 10 17:15:16 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed, 10 Apr 2024 19:15:16 +0200 Subject: [build2] Build2 does not build on Ubuntu 24.04 In-Reply-To: <9a4ad6e2-f5b7-4eb0-bb96-9400904ef925@planed.es> References: <9a4ad6e2-f5b7-4eb0-bb96-9400904ef925@planed.es> Message-ID: Michael Martin Moro via users writes: > /tmp/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:29:1:error: > static declaration of 'strlcpy' follows non-static declaration Yes, this is a know issue that has been fixed for the next release (which is hopefully not too far away): https://github.com/build2/build2/issues/324 As Ryan suggested, the recommended workaround in the meantime is to use the staged version of the toolchain: https://build2.org/community.xhtml#stage