gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
62 stars 50 forks source link

ninja: bad $-escape (literal $ must be written as $$) #88

Closed jtojnar closed 4 years ago

jtojnar commented 4 years ago

I cannot build with make because of #52 so I was building 0.13.70 with -GNinja. Unfortunately this no longer works on 0.13.71:

cmake flags: -GNinja -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/doc/ -DCMAKE_INSTALL_INFODIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/include -DCMAKE_INSTALL_SBINDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71
-- The C compiler identification is GNU 9.3.0
-- Check for working C compiler: /nix/store/x9vxn05bn19wn2mzn6d4h56glbd02pyr-gcc-wrapper-9.3.0/bin/gcc
-- Check for working C compiler: /nix/store/x9vxn05bn19wn2mzn6d4h56glbd02pyr-gcc-wrapper-9.3.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found UnixCommands: /nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash
-- Looking for include file byteswap.h
-- Looking for include file byteswap.h - found
-- Looking for include file direct.h
-- Looking for include file direct.h - not found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file fnmatch.h
-- Looking for include file fnmatch.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file io.h
-- Looking for include file io.h - not found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file ndir.h
-- Looking for include file ndir.h - not found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for include file sys/dir.h
-- Looking for include file sys/dir.h - found
-- Looking for include file sys/int_types.h
-- Looking for include file sys/int_types.h - not found
-- Looking for include file sys/mman.h
-- Looking for include file sys/mman.h - found
-- Looking for include file sys/ndir.h
-- Looking for include file sys/ndir.h - not found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file winbase.h
-- Looking for include file winbase.h - not found
-- Looking for include file windows.h
-- Looking for include file windows.h - not found
-- Looking for include file winnt.h
-- Looking for include file winnt.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of short
-- Check size of short - done
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Check size of off_t_32
-- Check size of off_t_32 - done
-- Check size of off_t_64
-- Check size of off_t_64 - done
-- Check size of off64_t
-- Check size of off64_t - done
-- found sizeof(off_t/32)=8 and sizeof(off_t/64)=8
-- Found ZLIB: /nix/store/zsr1dksfh97yvb49k3rni00q5lppd9pd-zlib-1.2.11/lib/libz.so (found version "1.2.11")
-- Found PkgConfig: /nix/store/77q4agjl45624815r5w1f4lbb9hm31b0-pkg-config-0.29.2/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'zzip'
-- Checking for one of the modules 'sdl2'
-- Found PythonInterp: /nix/store/vs4vj1yzqj1bkcqkf3b6sxm6jfy1gb4j-python3-3.7.7/bin/python3 (found suitable version "3.7.7", minimum required is "3.5")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING
    CMAKE_CXX_COMPILER
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_POLICY_DEFAULT_CMP0025

-- Build files have been written to: /build/source/build
cmake: enabled parallel building
building
build flags: -j4 -l4
ninja: error: build.ninja:1725: bad $-escape (literal $ must be written as $$)

Relevant lines from build.ninja:

# Custom command for docs/CMakeFiles/install-htmpages

build docs/CMakeFiles/install-htmpages: CUSTOM_COMMAND docs/htmpages.tar || zzip/libzzip-0.so zzip/libzzipfseeko-0.so zzip/libzzipmmapped-0.so
  COMMAND = cd /build/source/build/docs && /nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash -c "ls -l /build/source/build/docs/*pages.tar" && /nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash -c "mkdir -vp $(DESTDIR)/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/doc  >&2 || ls -ld $(DESTDIR)/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/doc >&2" && /nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash -c "cd $(DESTDIR)/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/doc && tar x -f /build/source/build/docs/htmpages.tar" && /nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash -c "cd $(DESTDIR)/nix/store/f5xxg7i925bny4gds3608s1f95qwxwh8-zziplib-0.13.71/share/doc && mv html man"
gdraheim commented 4 years ago

The "$(DESTDIR)" should be a make variable, and so it would collapse to nothing if not defined. Why does it still exist? Would it help to replace it with "${DESTDIR}" that could be expanded in another context as well?

gdraheim commented 4 years ago

Never mind, I have create a check with testbuilds/opensuse15-ninja-sdl2.dockerfile to see what the ninja build looks like. I have changed the $DESTDIR variables and it seems the destdir builds did work.

This should fix your problem.

jtojnar commented 4 years ago

Can confirm this fixes the build and all files seem to be installed.