sergiusens / snapcraft-preload

Use smart preloading in your snaps to avoid hard coded parts that would fail security.
12 stars 20 forks source link

scary compile failures when built after some other random C things #38

Open anonymouse64 opened 5 years ago

anonymouse64 commented 5 years ago

For example, take this snapcraft.yaml (slightly modified from what's in this repo):

name: snapcraft-preload
type: app
base: core18
version: "0.1"
summary: Preloader utility for snaps
description: |
  Tired of dealing with hardcoded paths and code just being antiquated? This is the part for you.
  While still in experimental stages it is useful already. All you need to do is add this part
  to your snapcraft project and prepend `command` entries in `apps` with `snapcraft-preload`.

grade: devel
confinement: devmode

parts:
  snapcraft-preload:
    after: [kong]
    source: .
    plugin: cmake
    build-packages:
      - on amd64:
          - gcc-multilib
          - g++-multilib
    stage-packages:
      - lib32stdc++6
  # We keep the 'preload' part to be backward compatible
  preload:
    plugin: nil
    override-build: |
      mkdir -p $SNAPCRAFT_PART_INSTALL/bin
      ln -sv snapcraft-preload $SNAPCRAFT_PART_INSTALL/bin/preload
    after: [snapcraft-preload]
  openresty-kong-patches:
    plugin: dump
    source: https://github.com/Kong/openresty-patches.git
    source-depth: 1
    organize:
      patches: openresty-kong-patches
    stage: [openresty-kong-patches]
    prime: [-*]

  kong:
    source: https://github.com/kong/kong.git
    plugin: nil
    source-tag: 1.0.3
    source-depth: 1
    build-packages:
      - unzip
      - libssl1.0-dev
      - libpcre3-dev
      - libyaml-dev
      - luarocks
      - lua5.1
      - build-essential
      - autoconf
    stage-packages:
      - perl
      - luarocks
      - lua5.1
      - libyaml-dev
    override-build: |
      # first copy the default config file provided and install it into $SNAPCRAFT_PART_INSTALL
      # it will be generated/configured during the install hook
      mkdir -p $SNAPCRAFT_PART_INSTALL/config/security-api-gateway
      cp kong.conf.default $SNAPCRAFT_PART_INSTALL/config/security-api-gateway/kong.conf

      # handle the location of openssl + libcrypto by architecture
      # cause luarocks is silly and hardcodes /usr/lib/x86_64-linux-gnu as the lib search path
      case "$(dpkg --print-architecture)" in
        amd64)
          # x64 is the only arch that luarocks can properly find libs for :-/
          luarocks make --tree=$SNAPCRAFT_PART_INSTALL
          ;;
        arm64)
          luarocks make --tree=$SNAPCRAFT_PART_INSTALL \
            CRYPTO_LIBDIR=/usr/lib/aarch64-linux-gnu \
            CRYPTO_INCDIR=/usr/include \
            OPENSSL_LIBDIR=/usr/lib/aarch64-linux-gnu \
            OPENSSL_INCDIR=/usr/include
          ;;
        armhf)
          luarocks make --tree=$SNAPCRAFT_PART_INSTALL \
            CRYPTO_LIBDIR=/usr/lib/arm-linux-gnueabihf \
            CRYPTO_INCDIR=/usr/include \
            OPENSSL_LIBDIR=/usr/lib/arm-linux-gnueabihf \
            OPENSSL_INCDIR=/usr/include
          ;;
        i386)
          luarocks make --tree=$SNAPCRAFT_PART_INSTALL \
            CRYPTO_LIBDIR=/usr/lib/i386-linux-gnu \
            CRYPTO_INCDIR=/usr/include \
            OPENSSL_LIBDIR=/usr/lib/i386-linux-gnu \
            OPENSSL_INCDIR=/usr/include
          ;;
        *)
          echo "Unsupported arch $(dpkg --print-architecture)"
          exit 1
          ;;
      esac

      mkdir -p $SNAPCRAFT_PART_INSTALL/bin
      cp bin/kong $SNAPCRAFT_PART_INSTALL/bin/kong
      # make all the things inside the cmd directory executable because they for some reason aren't executable by default...
      cd $SNAPCRAFT_PART_INSTALL/share/lua/5.1/kong/cmd
      for cmd in $(ls *.lua); do
        chmod +x $cmd
      done

      # TODO: the json2lua script references $SNAPCRAFT_PART_INSTALL in some
      # paths it tries to load things from, probably worth fixing that to use
      # $SNAP, etc. but currently json2lua seems unused so not changing it now

some of the other parts about building kong aren't important, but basically during the build of kong, a lot of random C/C++ dependencies are compiled, and the inclusion of those libraries into $SNAPCRAFT_STAGE (and/or something else) results in snapcraft adding include paths to the compile options for snapcraft-preload and it fails in a very ugly way like this:

``` Building snapcraft-preload cmake /root/parts/snapcraft-preload/src -DCMAKE_INSTALL_PREFIX= -- The C compiler identification is GNU 7.4.0 -- The CXX compiler identification is GNU 7.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /root/parts/snapcraft-preload/build cmake --build . -- -j2 Scanning dependencies of target snapcraft-preload32 Scanning dependencies of target snapcraft-preload [ 25%] Building CXX object CMakeFiles/snapcraft-preload32.dir/preload.cpp.o [ 50%] Building CXX object CMakeFiles/snapcraft-preload.dir/preload.cpp.o /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int unlink(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:402:19: error: declaration of ‘int unlink(const char*)’ has a different exception specifier REDIRECT_1_1(int, unlink) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:402:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, unlink) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:828:12: note: from previous declaration ‘int unlink(const char*) throw ()’ extern int unlink (const char *__name) __THROW __nonnull ((1)); ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int unlinkat(int, const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:403:22: error: declaration of ‘int unlinkat(int, const char*, int)’ has a different exception specifier REDIRECT_2_3_AT(int, unlinkat, int, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:403:1: note: in expansion of macro ‘REDIRECT_2_3_AT’ REDIRECT_2_3_AT(int, unlinkat, int, int) ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:832:12: note: from previous declaration ‘int unlinkat(int, const char*, int) throw ()’ extern int unlinkat (int __fd, const char *__name, int __flag) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int access(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:404:19: error: declaration of ‘int access(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, access, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:404:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, access, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:290:12: note: from previous declaration ‘int access(const char*, int) throw ()’ extern int access (const char *__name, int __type) __THROW __nonnull ((1)); ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int eaccess(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:405:19: error: declaration of ‘int eaccess(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, eaccess, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:405:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, eaccess, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:299:12: note: from previous declaration ‘int eaccess(const char*, int) throw ()’ extern int eaccess (const char *__name, int __type) ^~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int euidaccess(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:406:19: error: declaration of ‘int euidaccess(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, euidaccess, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:406:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, euidaccess, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:295:12: note: from previous declaration ‘int euidaccess(const char*, int) throw ()’ extern int euidaccess (const char *__name, int __type) ^~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int faccessat(int, const char*, int, int)’: /root/parts/snapcraft-preload/src/preload.cpp:407:22: error: declaration of ‘int faccessat(int, const char*, int, int)’ has a different exception specifier REDIRECT_2_4_AT(int, faccessat, int, int, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:407:1: note: in expansion of macro ‘REDIRECT_2_4_AT’ REDIRECT_2_4_AT(int, faccessat, int, int, int) ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:307:12: note: from previous declaration ‘int faccessat(int, const char*, int, int) throw ()’ extern int faccessat (int __fd, const char *__file, int __type, int __flag) ^~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int truncate(const char*, off_t)’: /root/parts/snapcraft-preload/src/preload.cpp:414:19: error: declaration of ‘int truncate(const char*, off_t)’ has a different exception specifier REDIRECT_1_2(int, truncate, off_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:414:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, truncate, off_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:994:12: note: from previous declaration ‘int truncate(const char*, __off_t) throw ()’ extern int truncate (const char *__file, __off_t __length) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statfs(const char*, statfs*)’: /root/parts/snapcraft-preload/src/preload.cpp:423:19: error: declaration of ‘int statfs(const char*, statfs*)’ has a different exception specifier REDIRECT_1_2(int, statfs, struct statfs *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:423:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statfs, struct statfs *) ^~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int unlink(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:402:19: error: declaration of ‘int unlink(const char*)’ has a different exception specifier REDIRECT_1_1(int, unlink) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:402:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, unlink) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:828:12: note: from previous declaration ‘int unlink(const char*) throw ()’ extern int unlink (const char *__name) __THROW __nonnull ((1)); ^~~~~~ In file included from /root/stage/usr/include/x86_64-linux-gnu/sys/vfs.h:4:0, from /root/parts/snapcraft-preload/src/preload.cpp:40: /root/stage/usr/include/x86_64-linux-gnu/sys/statfs.h:31:12: note: from previous declaration ‘int statfs(const char*, statfs*) throw ()’ extern int statfs (const char *__file, struct statfs *__buf) ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int unlinkat(int, const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:403:22: error: declaration of ‘int unlinkat(int, const char*, int)’ has a different exception specifier REDIRECT_2_3_AT(int, unlinkat, int, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:403:1: note: in expansion of macro ‘REDIRECT_2_3_AT’ REDIRECT_2_3_AT(int, unlinkat, int, int) ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:832:12: note: from previous declaration ‘int unlinkat(int, const char*, int) throw ()’ extern int unlinkat (int __fd, const char *__name, int __flag) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int access(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:404:19: error: declaration of ‘int access(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, access, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:404:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, access, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:290:12: note: from previous declaration ‘int access(const char*, int) throw ()’ extern int access (const char *__name, int __type) __THROW __nonnull ((1)); ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int eaccess(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:405:19: error: declaration of ‘int eaccess(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, eaccess, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:405:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, eaccess, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:299:12: note: from previous declaration ‘int eaccess(const char*, int) throw ()’ extern int eaccess (const char *__name, int __type) ^~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statfs64(const char*, statfs64*)’: /root/parts/snapcraft-preload/src/preload.cpp:424:19: error: declaration of ‘int statfs64(const char*, statfs64*)’ has a different exception specifier REDIRECT_1_2(int, statfs64, struct statfs64 *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:424:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statfs64, struct statfs64 *) ^~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int euidaccess(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:406:19: error: declaration of ‘int euidaccess(const char*, int)’ has a different exception specifier REDIRECT_1_2(int, euidaccess, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:406:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, euidaccess, int) ^~~~~~~~~~~~ In file included from /root/stage/usr/include/x86_64-linux-gnu/sys/vfs.h:4:0, from /root/parts/snapcraft-preload/src/preload.cpp:40: /root/stage/usr/include/x86_64-linux-gnu/sys/statfs.h:43:12: note: from previous declaration ‘int statfs64(const char*, statfs64*) throw ()’ extern int statfs64 (const char *__file, struct statfs64 *__buf) ^~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:295:12: note: from previous declaration ‘int euidaccess(const char*, int) throw ()’ extern int euidaccess (const char *__name, int __type) ^~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int faccessat(int, const char*, int, int)’: /root/parts/snapcraft-preload/src/preload.cpp:407:22: error: declaration of ‘int faccessat(int, const char*, int, int)’ has a different exception specifier REDIRECT_2_4_AT(int, faccessat, int, int, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:407:1: note: in expansion of macro ‘REDIRECT_2_4_AT’ REDIRECT_2_4_AT(int, faccessat, int, int, int) ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:307:12: note: from previous declaration ‘int faccessat(int, const char*, int, int) throw ()’ extern int faccessat (int __fd, const char *__file, int __type, int __flag) ^~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statvfs(const char*, statvfs*)’: /root/parts/snapcraft-preload/src/preload.cpp:425:19: error: declaration of ‘int statvfs(const char*, statvfs*)’ has a different exception specifier REDIRECT_1_2(int, statvfs, struct statvfs *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:425:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statvfs, struct statvfs *) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:38:0: /root/stage/usr/include/x86_64-linux-gnu/sys/statvfs.h:51:12: note: from previous declaration ‘int statvfs(const char*, statvfs*) throw ()’ extern int statvfs (const char *__restrict __file, ^~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statvfs64(const char*, statvfs64*)’: /root/parts/snapcraft-preload/src/preload.cpp:426:19: error: declaration of ‘int statvfs64(const char*, statvfs64*)’ has a different exception specifier REDIRECT_1_2(int, statvfs64, struct statvfs64 *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:426:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statvfs64, struct statvfs64 *) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:38:0: /root/stage/usr/include/x86_64-linux-gnu/sys/statvfs.h:65:12: note: from previous declaration ‘int statvfs64(const char*, statvfs64*) throw ()’ extern int statvfs64 (const char *__restrict __file, ^~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘long int pathconf(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:427:20: error: declaration of ‘long int pathconf(const char*, int)’ has a different exception specifier REDIRECT_1_2(long, pathconf, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:427:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(long, pathconf, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:615:17: note: from previous declaration ‘long int pathconf(const char*, int) throw ()’ extern long int pathconf (const char *__path, int __name) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int truncate(const char*, off_t)’: /root/parts/snapcraft-preload/src/preload.cpp:414:19: error: declaration of ‘int truncate(const char*, off_t)’ has a different exception specifier REDIRECT_1_2(int, truncate, off_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:414:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, truncate, off_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:994:12: note: from previous declaration ‘int truncate(const char*, __off_t) throw ()’ extern int truncate (const char *__file, __off_t __length) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int rmdir(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:431:19: error: declaration of ‘int rmdir(const char*)’ has a different exception specifier REDIRECT_1_1(int, rmdir) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:431:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, rmdir) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:837:12: note: from previous declaration ‘int rmdir(const char*) throw ()’ extern int rmdir (const char *__path) __THROW __nonnull ((1)); ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int chown(const char*, uid_t, gid_t)’: /root/parts/snapcraft-preload/src/preload.cpp:432:19: error: declaration of ‘int chown(const char*, uid_t, gid_t)’ has a different exception specifier REDIRECT_1_3(int, chown, uid_t, gid_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:432:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(int, chown, uid_t, gid_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:476:12: note: from previous declaration ‘int chown(const char*, __uid_t, __gid_t) throw ()’ extern int chown (const char *__file, __uid_t __owner, __gid_t __group) ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int lchown(const char*, uid_t, gid_t)’: /root/parts/snapcraft-preload/src/preload.cpp:433:19: error: declaration of ‘int lchown(const char*, uid_t, gid_t)’ has a different exception specifier REDIRECT_1_3(int, lchown, uid_t, gid_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:433:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(int, lchown, uid_t, gid_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:486:12: note: from previous declaration ‘int lchown(const char*, __uid_t, __gid_t) throw ()’ extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int chdir(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:436:19: error: declaration of ‘int chdir(const char*)’ has a different exception specifier REDIRECT_1_1(int, chdir) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:436:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, chdir) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:500:12: note: from previous declaration ‘int chdir(const char*) throw ()’ extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur; ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘ssize_t readlink(const char*, char*, size_t)’: /root/parts/snapcraft-preload/src/preload.cpp:437:23: error: declaration of ‘ssize_t readlink(const char*, char*, size_t)’ has a different exception specifier REDIRECT_1_3(ssize_t, readlink, char *, size_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:437:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(ssize_t, readlink, char *, size_t) ^~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statfs(const char*, statfs*)’: /root/parts/snapcraft-preload/src/preload.cpp:423:19: error: declaration of ‘int statfs(const char*, statfs*)’ has a different exception specifier REDIRECT_1_2(int, statfs, struct statfs *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:423:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statfs, struct statfs *) ^~~~~~~~~~~~ In file included from /root/stage/usr/include/x86_64-linux-gnu/sys/vfs.h:4:0, from /root/parts/snapcraft-preload/src/preload.cpp:40: /root/stage/usr/include/x86_64-linux-gnu/sys/statfs.h:31:12: note: from previous declaration ‘int statfs(const char*, statfs*) throw ()’ extern int statfs (const char *__file, struct statfs *__buf) ^~~~~~ In file included from /root/stage/usr/include/features.h:424:0, from /root/stage/usr/include/dirent.h:25, from /root/parts/snapcraft-preload/src/preload.cpp:24: /root/stage/usr/include/x86_64-linux-gnu/bits/unistd.h:139:8: note: from previous declaration ‘ssize_t readlink(const char*, char*, size_t) throw ()’ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, ^ /root/stage/usr/include/x86_64-linux-gnu/sys/cdefs.h:63:35: note: in definition of macro ‘__NTH’ # define __NTH(fct) __LEAF_ATTR fct throw () ^~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statfs64(const char*, statfs64*)’: /root/parts/snapcraft-preload/src/preload.cpp:424:19: error: declaration of ‘int statfs64(const char*, statfs64*)’ has a different exception specifier REDIRECT_1_2(int, statfs64, struct statfs64 *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:424:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statfs64, struct statfs64 *) ^~~~~~~~~~~~ In file included from /root/stage/usr/include/x86_64-linux-gnu/sys/vfs.h:4:0, from /root/parts/snapcraft-preload/src/preload.cpp:40: /root/stage/usr/include/x86_64-linux-gnu/sys/statfs.h:43:12: note: from previous declaration ‘int statfs64(const char*, statfs64*) throw ()’ extern int statfs64 (const char *__file, struct statfs64 *__buf) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statvfs(const char*, statvfs*)’: /root/parts/snapcraft-preload/src/preload.cpp:425:19: error: declaration of ‘int statvfs(const char*, statvfs*)’ has a different exception specifier REDIRECT_1_2(int, statvfs, struct statvfs *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:425:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statvfs, struct statvfs *) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:38:0: /root/stage/usr/include/x86_64-linux-gnu/sys/statvfs.h:51:12: note: from previous declaration ‘int statvfs(const char*, statvfs*) throw ()’ extern int statvfs (const char *__restrict __file, ^~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int link(const char*, const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:439:22: error: declaration of ‘int link(const char*, const char*)’ has a different exception specifier REDIRECT_TARGET(int, link) ^ /root/parts/snapcraft-preload/src/preload.cpp:391:5: note: in definition of macro ‘REDIRECT_TARGET’ RET NAME (const char *path, const char *target) { return redirect_target(path, target); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int statvfs64(const char*, statvfs64*)’: /root/parts/snapcraft-preload/src/preload.cpp:426:19: error: declaration of ‘int statvfs64(const char*, statvfs64*)’ has a different exception specifier REDIRECT_1_2(int, statvfs64, struct statvfs64 *) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:426:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(int, statvfs64, struct statvfs64 *) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:38:0: /root/stage/usr/include/x86_64-linux-gnu/sys/statvfs.h:65:12: note: from previous declaration ‘int statvfs64(const char*, statvfs64*) throw ()’ extern int statvfs64 (const char *__restrict __file, ^~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:792:12: note: from previous declaration ‘int link(const char*, const char*) throw ()’ extern int link (const char *__from, const char *__to) ^~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘long int pathconf(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:427:20: error: declaration of ‘long int pathconf(const char*, int)’ has a different exception specifier REDIRECT_1_2(long, pathconf, int) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:427:1: note: in expansion of macro ‘REDIRECT_1_2’ REDIRECT_1_2(long, pathconf, int) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:615:17: note: from previous declaration ‘long int pathconf(const char*, int) throw ()’ extern long int pathconf (const char *__path, int __name) ^~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int rmdir(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:431:19: error: declaration of ‘int rmdir(const char*)’ has a different exception specifier REDIRECT_1_1(int, rmdir) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:431:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, rmdir) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:837:12: note: from previous declaration ‘int rmdir(const char*) throw ()’ extern int rmdir (const char *__path) __THROW __nonnull ((1)); ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int chown(const char*, uid_t, gid_t)’: /root/parts/snapcraft-preload/src/preload.cpp:432:19: error: declaration of ‘int chown(const char*, uid_t, gid_t)’ has a different exception specifier REDIRECT_1_3(int, chown, uid_t, gid_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:432:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(int, chown, uid_t, gid_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:476:12: note: from previous declaration ‘int chown(const char*, __uid_t, __gid_t) throw ()’ extern int chown (const char *__file, __uid_t __owner, __gid_t __group) ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int lchown(const char*, uid_t, gid_t)’: /root/parts/snapcraft-preload/src/preload.cpp:433:19: error: declaration of ‘int lchown(const char*, uid_t, gid_t)’ has a different exception specifier REDIRECT_1_3(int, lchown, uid_t, gid_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:433:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(int, lchown, uid_t, gid_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:486:12: note: from previous declaration ‘int lchown(const char*, __uid_t, __gid_t) throw ()’ extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int chdir(const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:436:19: error: declaration of ‘int chdir(const char*)’ has a different exception specifier REDIRECT_1_1(int, chdir) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:436:1: note: in expansion of macro ‘REDIRECT_1_1’ REDIRECT_1_1(int, chdir) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:500:12: note: from previous declaration ‘int chdir(const char*) throw ()’ extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur; ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘ssize_t readlink(const char*, char*, size_t)’: /root/parts/snapcraft-preload/src/preload.cpp:437:23: error: declaration of ‘ssize_t readlink(const char*, char*, size_t)’ has a different exception specifier REDIRECT_1_3(ssize_t, readlink, char *, size_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:437:1: note: in expansion of macro ‘REDIRECT_1_3’ REDIRECT_1_3(ssize_t, readlink, char *, size_t) ^~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int inotify_add_watch(int, const char*, uint32_t)’: /root/parts/snapcraft-preload/src/preload.cpp:445:19: error: declaration of ‘int inotify_add_watch(int, const char*, uint32_t)’ has a different exception specifier REDIRECT_2_3(int, inotify_add_watch, int, uint32_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:445:1: note: in expansion of macro ‘REDIRECT_2_3’ REDIRECT_2_3(int, inotify_add_watch, int, uint32_t) ^~~~~~~~~~~~ In file included from /root/stage/usr/include/features.h:424:0, from /root/stage/usr/include/dirent.h:25, from /root/parts/snapcraft-preload/src/preload.cpp:24: /root/stage/usr/include/x86_64-linux-gnu/bits/unistd.h:139:8: note: from previous declaration ‘ssize_t readlink(const char*, char*, size_t) throw ()’ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, ^ /root/stage/usr/include/x86_64-linux-gnu/sys/cdefs.h:63:35: note: in definition of macro ‘__NTH’ # define __NTH(fct) __LEAF_ATTR fct throw () ^~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:35:0: /root/stage/usr/include/x86_64-linux-gnu/sys/inotify.h:91:12: note: from previous declaration ‘int inotify_add_watch(int, const char*, uint32_t) throw ()’ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask) ^~~~~~~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int link(const char*, const char*)’: /root/parts/snapcraft-preload/src/preload.cpp:439:22: error: declaration of ‘int link(const char*, const char*)’ has a different exception specifier REDIRECT_TARGET(int, link) ^ /root/parts/snapcraft-preload/src/preload.cpp:391:5: note: in definition of macro ‘REDIRECT_TARGET’ RET NAME (const char *path, const char *target) { return redirect_target(path, target); } ^~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:792:12: note: from previous declaration ‘int link(const char*, const char*) throw ()’ extern int link (const char *__from, const char *__to) ^~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘void* dlopen(const char*, int)’: /root/parts/snapcraft-preload/src/preload.cpp:453:25: error: declaration of ‘void* dlopen(const char*, int)’ has a different exception specifier REDIRECT_1_2_AT(void *, dlopen, int); ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:453:1: note: in expansion of macro ‘REDIRECT_1_2_AT’ REDIRECT_1_2_AT(void *, dlopen, int); ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:25:0: /root/stage/usr/include/dlfcn.h:56:14: note: from previous declaration ‘void* dlopen(const char*, int) throw ()’ extern void *dlopen (const char *__file, int __mode) __THROWNL; ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int inotify_add_watch(int, const char*, uint32_t)’: /root/parts/snapcraft-preload/src/preload.cpp:445:19: error: declaration of ‘int inotify_add_watch(int, const char*, uint32_t)’ has a different exception specifier REDIRECT_2_3(int, inotify_add_watch, int, uint32_t) ^ /root/parts/snapcraft-preload/src/preload.cpp:350:5: note: in definition of macro ‘REDIRECT_2’ RET NAME (T1 a1, const char *path SIG) { return redirect_n(a1, path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:445:1: note: in expansion of macro ‘REDIRECT_2_3’ REDIRECT_2_3(int, inotify_add_watch, int, uint32_t) ^~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:35:0: /root/stage/usr/include/x86_64-linux-gnu/sys/inotify.h:91:12: note: from previous declaration ‘int inotify_add_watch(int, const char*, uint32_t) throw ()’ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask) ^~~~~~~~~~~~~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int bind(int, const sockaddr*, socklen_t)’: /root/parts/snapcraft-preload/src/preload.cpp:487:1: error: declaration of ‘int bind(int, const sockaddr*, socklen_t)’ has a different exception specifier bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen) ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:453:25: error: declaration of ‘void* dlopen(const char*, int)’ has a different exception specifier REDIRECT_1_2_AT(void *, dlopen, int); ^ /root/parts/snapcraft-preload/src/preload.cpp:346:5: note: in definition of macro ‘REDIRECT_1’ RET NAME (const char *path SIG) { return redirect_n(path ARGS); } ^~~~ /root/parts/snapcraft-preload/src/preload.cpp:453:1: note: in expansion of macro ‘REDIRECT_1_2_AT’ REDIRECT_1_2_AT(void *, dlopen, int); ^~~~~~~~~~~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:25:0: /root/stage/usr/include/dlfcn.h:56:14: note: from previous declaration ‘void* dlopen(const char*, int) throw ()’ extern void *dlopen (const char *__file, int __mode) __THROWNL; ^~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:37:0: /root/stage/usr/include/x86_64-linux-gnu/sys/socket.h:112:12: note: from previous declaration ‘int bind(int, const sockaddr*, socklen_t) throw ()’ extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) ^~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int bind(int, const sockaddr*, socklen_t)’: /root/parts/snapcraft-preload/src/preload.cpp:487:1: error: declaration of ‘int bind(int, const sockaddr*, socklen_t)’ has a different exception specifier bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen) ^~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:37:0: /root/stage/usr/include/x86_64-linux-gnu/sys/socket.h:112:12: note: from previous declaration ‘int bind(int, const sockaddr*, socklen_t) throw ()’ extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) ^~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int execv(const char*, char* const*)’: /root/parts/snapcraft-preload/src/preload.cpp:636:1: error: declaration of ‘int execv(const char*, char* const*)’ has a different exception specifier execv (const char *path, char *const argv[]) ^~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:566:12: note: from previous declaration ‘int execv(const char*, char* const*) throw ()’ extern int execv (const char *__path, char *const __argv[]) ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int execve(const char*, char* const*, char* const*)’: /root/parts/snapcraft-preload/src/preload.cpp:642:1: error: declaration of ‘int execve(const char*, char* const*, char* const*)’ has a different exception specifier execve (const char *path, char *const argv[], char *const envp[]) ^~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:554:12: note: from previous declaration ‘int execve(const char*, char* const*, char* const*) throw ()’ extern int execve (const char *__path, char *const __argv[], ^~~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int execv(const char*, char* const*)’: /root/parts/snapcraft-preload/src/preload.cpp:636:1: error: declaration of ‘int execv(const char*, char* const*)’ has a different exception specifier execv (const char *path, char *const argv[]) ^~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:566:12: note: from previous declaration ‘int execv(const char*, char* const*) throw ()’ extern int execv (const char *__path, char *const __argv[]) ^~~~~ /root/parts/snapcraft-preload/src/preload.cpp: In function ‘int execve(const char*, char* const*, char* const*)’: /root/parts/snapcraft-preload/src/preload.cpp:642:1: error: declaration of ‘int execve(const char*, char* const*, char* const*)’ has a different exception specifier execve (const char *path, char *const argv[], char *const envp[]) ^~~~~~ In file included from /root/parts/snapcraft-preload/src/preload.cpp:42:0: /root/stage/usr/include/unistd.h:554:12: note: from previous declaration ‘int execve(const char*, char* const*, char* const*) throw ()’ extern int execve (const char *__path, char *const __argv[], ^~~~~~ CMakeFiles/snapcraft-preload32.dir/build.make:62: recipe for target 'CMakeFiles/snapcraft-preload32.dir/preload.cpp.o' failed make[2]: *** [CMakeFiles/snapcraft-preload32.dir/preload.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/snapcraft-preload32.dir/all' failed make[1]: *** [CMakeFiles/snapcraft-preload32.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... CMakeFiles/snapcraft-preload.dir/build.make:62: recipe for target 'CMakeFiles/snapcraft-preload.dir/preload.cpp.o' failed make[2]: *** [CMakeFiles/snapcraft-preload.dir/preload.cpp.o] Error 1 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/snapcraft-preload.dir/all' failed make[1]: *** [CMakeFiles/snapcraft-preload.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2 Failed to run 'cmake --build . -- -j2' for 'snapcraft-preload': Exited with code 2. Verify that the part is using the correct parameters and try again. Run the same command again with --debug to shell into the environment if you wish to introspect this failure. ```

The solution I found was just to ensure that snapcraft-preload is always built before all the other C/C++ parts with after but I spent quite a while trying to understand why this failed, so it would be great if:

sergiusens commented 5 years ago

Do you understand why this fails though?

anonymouse64 commented 5 years ago

@sergiusens I believe it fails because somewhere in the stage directory of the kong part are include files which somehow conflict with the declarations of snapcraft-preload. I don't know which specific include files are the source of the errors.