bugManeage - Bugs: bug #67001, pkg-config build fails if...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #67001: pkg-config build fails if second-maneage-lzip is already built

Submitter:  Boud Roukema <boud>
Submitted:  Tue 08 Apr 2025 09:03:52 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Crash Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Tue 08 Apr 2025 09:03:52 PM UTC, original submission:  

BUG:

The current Maneage build system typically builds two versions of 'lzip': a first version in 'pre-make-build.sh'; and a second version after 'gcc' has been built (if 'gcc' is not built, then presumably the second version of 'lzip' will not be built). The 'basic.mk' rules for building 'pkg-config' have a line that removes the 'libiconv' library from within maneage if it has already been built. If the second version of 'lzip' has already been built (replacing the first version), then it depends on the maneage-built 'libiconv' as a shared library. If 'libiconv' is removed, and the maneage 'lzip' is the second version, then running 'lzip' fails because of the missing library. Thus, if the second-maneage-lzip is already built, rebuilding 'pkg-config' fails.


REPRODUCE:

In a full (successful) build of maneage commit cb93628, do:


rm .local/version-info/proglib/pkg-config-0.29.2
./project configure --existing-conf


RESULT:

Building necessary software (if necessary)...
tarball=pkg-config-0.29.2.tar.lz
final=/BUILD/software/tarballs/$tarball; url=; exp_checksum="c37ab9336ac15a73bf5a23101f3fd8a04810f39b0679634e420e5d7bbd60a80cfc919122694cf83965beb071d2780681efc8d954ce99d77eb235a4dc7497e250"; if [ -f $final ]; then echo "/BUILD/software/tarballs/$tarball: already present in project."; else unchecked="$final.unchecked"; rm -f "$unchecked"; if [ -f /optional/path/$tarball ]; then if type realpath > /dev/null 2> /dev/null; then ln -sf "$(realpath /optional/path/$tarball)" "$unchecked"; else cp /optional/path/$tarball "$unchecked"; fi; else if [ x"$url" = x ]; then bservers="http://gitlab.cefca.es/maneage/tarballs-software/-/raw/master/ http://gitlab.com/maneage/tarballs-software/-/raw/master http://git.maneage.org/tarballs-software.git/plain"; tarballurl=https://zenodo.org/records/6989624/files/$tarball; else bservers="https://zenodo.org/records/6989624/files http://gitlab.cefca.es/maneage/tarballs-software/-/raw/master/ http://gitlab.com/maneage/tarballs-software/-/raw/master http://git.maneage.org/tarballs-software.git/plain "; if [ "x" = "x" ]; then tarballurl=$url/$tarball; else tarballurl=$url/; fi; fi; if [ x"" != x ]; then bservers=" $bservers"; fi; if [ -f /BUILD/software/installed/bin/wget ]; then downloader="wget --no-use-server-timestamps -O"; else downloader="/usr/bin/wget --no-use-server-timestamps -O"; fi; touch /BUILD/software/locks/download; ./reproduce/analysis/bash/download-multi-try.sh "$downloader" /BUILD/software/locks/download $tarballurl "$unchecked" "$bservers"; fi; if [ x"$exp_checksum" = x"NO-CHECK-SUM" ]; then mv "$unchecked" "$final"; else if type sha512sum > /dev/null 2>/dev/null; then checksum=$(sha512sum "$unchecked" | awk '{print $1}'); if [ x"$checksum" = x"$exp_checksum" ]; then mv "$unchecked" "$final"; else echo "ERROR: Non-matching checksum: $tarball"; echo "Checksum should be: $exp_checksum"; echo "Checksum is:        $checksum"; exit 1; fi; else mv "$unchecked" "$final"; fi; fi; fi
rm -f /BUILD/software/installed/lib/libiconv* /BUILD/software/installed/include/iconv.h
if [ xno = xyes ]; then export compiler="CC=clang"
else                              export compiler=""
fi
if [ xno = xyes ] && [ "x static" = xstatic ]; then export LDFLAGS="$LDFLAGS -static"; fi; check=""; if [ x"$check" = x ]; then check="echo Skipping-check"; fi; cd /BUILD/software/build-tmp; rm -rf  pkg-config-0.29.2; if [ x"$gbuild_tar" = x ]; then utarball=/BUILD/software/tarballs/$tarball; else                             utarball=$gbuild_tar; fi; csuffix=$(echo $utarball | sed -e's/\./ /g' | awk '{print $NF}'); if [ x$csuffix = xlz ]; then intarrm=1; intar=$(echo $utarball | sed -e's/.lz//'); lzip -c -d $utarball > $intar; else intarrm=0; intar=$utarball; fi; if tar -xf $intar; then if [ x$intarrm = x1 ]; then rm $intar; fi; else echo; echo "Tar error"; exit 1; fi; cd  pkg-config-0.29.2; if   [ x"" = x ]; then confscript=./configure; else confscript=""; fi; "/SRC"/reproduce/software/shell/prep-source.sh /BUILD/software/installed/bin; if [ -f /BUILD/software/installed/bin/bash ]; then shellop="SHELL=/BUILD/software/installed/bin/bash"; else shellop="SHELL=/BUILD/software/installed/bin/dash"; fi; if [ x$gbuild_prefix = x ]; then prefixdir="/BUILD/software/installed"; else prefixdir="$gbuild_prefix"; fi; if [ -f "$confscript" ]; then if [ x"pkg-config-0.29.2" = x"zlib-1.3.1" ]; then configop="--prefix=$prefixdir"; else configop="$shellop --prefix=$prefixdir"; fi; fi; echo; echo "Using '$confscript' to configure:"; echo; echo "$confscript  $compiler --with-internal-glib --with-pc-path=/BUILD/software/installed/lib/pkgconfig $configop"; echo; if [ x$configure_in_different_directory = x1 ]; then mkdir build; cd build; ../$confscript  $compiler --with-internal-glib --with-pc-path=/BUILD/software/installed/lib/pkgconfig $configop; make "$shellop"  V=1; $check; make "$shellop" install ; cd ../..; else $confscript  $compiler --with-internal-glib --with-pc-path=/BUILD/software/installed/lib/pkgconfig $configop; make "$shellop"  V=1; $check; make "$shellop" install ; cd ..; fi; rm -rf  pkg-config-0.29.2;
echo "pkg-config 0.29.2" > /BUILD/software/installed/version-info/proglib/pkg-config-0.29.2
/BUILD/software/tarballs/pkg-config-0.29.2.tar.lz: already present in project.
sh: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
make: *** [reproduce/software/make/basic.mk:1085: /BUILD/software/installed/version-info/proglib/pkg-config-0.29.2] Error 127
make: Target 'all' not remade because of errors.



COMMENT:

The removal of 'libiconv' shared libraries is likely to sabotage many other binaries. In the fully built maneage commit cb93628, among binaries in '/BUILD/.build/software/installed/bin/*' I count 44 files linked to '/BUILD/software/installed/lib/libiconv.so' and 163 linked to 'libiconv.so.2'.

This bug is in the general class of early build dependency bugs: https://savannah.nongnu.org/bugs/?61337


SUGGESTION:

My guess is that the solution would have to be:

  • If pkg-config is built and the 'lzip' version in maneage depends on 'libiconv', then all packages should be rebuilt starting from the first-version-of-lzip-without-libiconv.


It's not clear how to do this given the current relation between 'configure.sh', 'pre-make-build.sh' and 'basic.mk', since 'pre-make-build.sh' is not a makefile. A test for this would probably have to be placed in 'configure.sh' itself.

An alternative solution could be to build 'pkg-config' without libiconv, which I guess would require hacking 'pkg-config-0.29.2/glib/configure' to have '--with-libiconv=no'. This could possibly be a problem for packages with non-unicode encodings, e.g. in documentation; or maybe seen as a feature to make it harder to sneak binary exploits via non-unicode encodings.

Boud Roukema <boud>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by boud (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code