gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.93k stars 283 forks source link

Build warnings “fatal: not a git repository” with branch 1.1 #420

Open heitbaum opened 1 year ago

heitbaum commented 1 year ago

Testing done with - https://github.com/gsliepen/tinc/tree/4c6a9a9611442f958c3049a566ac4369653978e9

building tinc 4c6a9a9611442f958c3049a566ac4369653978e9 within a git repo —> errors. The directory /var/media/DATA/home-rudi/LibreELEC.tv is the git repo.

[71/94] Generating src/include/version_git.h with a custom command
fatal: not a git repository: '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git'
Traceback (most recent call last):
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/version.py", line 22, in <module>
    result = subp.run(cmd, stdout=subp.PIPE, encoding="utf-8", check=True)
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir', '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git', 'describe', '--always', '--tags', '--match=release-*']' returned non-zero exit status 128.

Similar issue recently with rsync.

docker@8c5d656d5f75:/var/media/DATA/home-rudi/LibreELEC.tv$ s/build tinc
UNPACK      tinc
BUILD      tinc (target)
    TOOLCHAIN      meson (auto-detect)
Executing (target): meson --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --buildtype=plain -Dstrip=true --cross-file=/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/meson.conf -Dminiupnpc=enabled -Ddocs=disabled -Dtests=disabled -Drunstatedir=/run /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9
The Meson build system
Version: 0.63.3
Source dir: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9
Build dir: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu
Build type: cross build
Project name: tinc
Project version: 1.1pre18
C compiler for the host machine: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc (gcc 12.2.0 "x86_64-libreelec-linux-gnu-gcc-12.2.0 (GCC) 12.2.0")
C linker for the host machine: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc ld.gold 2.39
C compiler for the build machine: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/host-gcc (gcc 10.3.0 "gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0")
C linker for the build machine: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/host-gcc ld.bfd 2.34
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Program python3 found: YES (/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/python3)
Compiler for C supports arguments -D_GNU_SOURCE: YES 
Compiler for C supports arguments -Wbad-function-cast: YES 
Compiler for C supports arguments -Wduplicated-branches: YES 
Compiler for C supports arguments -Wduplicated-cond: YES 
Compiler for C supports arguments -Wformat-overflow=2: YES 
Compiler for C supports arguments -Wformat-truncation=1: YES 
Compiler for C supports arguments -Wformat=2: YES 
Compiler for C supports arguments -Wlogical-op: YES 
Compiler for C supports arguments -Wmissing-declarations: YES 
Compiler for C supports arguments -Wmissing-noreturn: YES 
Compiler for C supports arguments -Wmissing-prototypes: YES 
Compiler for C supports arguments -Wno-embedded-directive: NO 
Compiler for C supports arguments -Wold-style-definition: YES 
Compiler for C supports arguments -Wredundant-decls: YES 
Compiler for C supports arguments -Wreturn-type: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C supports arguments -Wswitch-enum: YES 
Compiler for C supports arguments -Wtrampolines: YES 
Compiler for C supports arguments -Wvla: YES 
Compiler for C supports arguments -Wwrite-strings: YES 
Compiler for C supports arguments -fdiagnostics-show-option: YES 
Compiler for C supports arguments -fno-strict-overflow: YES 
Compiler for C supports arguments -fstrict-aliasing: YES 
Compiler for C supports arguments -D_FORTIFY_SOURCE=2: YES 
Compiler for C supports arguments -fcf-protection=full: YES 
Compiler for C supports arguments -fstack-protector-strong: YES 
Compiler for C supports arguments -fstack-clash-protection: YES 
Compiler for C supports link arguments -Wl,-z,relro: YES 
Compiler for C supports link arguments -Wl,-z,now: YES 
Compiler for C supports link arguments -Wl,-z,noexecstack: YES 
Compiler for C supports function attribute malloc: YES 
Compiler for C supports function attribute nonnull: YES 
Compiler for C supports function attribute warn_unused_result: YES 
Compiler for C supports function attribute packed: YES 
Compiler for C supports function attribute format: YES 
Library m found: YES
Found pkg-config: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/pkg-config (0.29.2)
Run-time dependency libsystemd found: YES 252
Has header "alloca.h" : YES 
Has header "arpa/inet.h" : YES 
Has header "arpa/nameser.h" : YES 
Has header "dirent.h" : YES 
Has header "getopt.h" : YES 
Has header "inttypes.h" : YES 
Has header "net/ethernet.h" : YES 
Has header "net/if.h" : YES 
Has header "net/if_arp.h" : YES 
Has header "net/if_types.h" : NO 
Has header "netdb.h" : YES 
Has header "netinet/icmp6.h" : YES 
Has header "netinet/if_ether.h" : YES 
Has header "netinet/in.h" : YES 
Has header "netinet/in6.h" : NO 
Has header "netinet/in_systm.h" : YES 
Has header "netinet/ip.h" : YES 
Has header "netinet/ip6.h" : YES 
Has header "netinet/ip_icmp.h" : YES 
Has header "netinet/tcp.h" : YES 
Has header "resolv.h" : YES 
Has header "stddef.h" : YES 
Has header "sys/file.h" : YES 
Has header "sys/ioctl.h" : YES 
Has header "sys/mman.h" : YES 
Has header "sys/param.h" : YES 
Has header "sys/random.h" : YES 
Has header "sys/resource.h" : YES 
Has header "sys/socket.h" : YES 
Has header "sys/stat.h" : YES 
Has header "sys/time.h" : YES 
Has header "sys/types.h" : YES 
Has header "sys/wait.h" : YES 
Has header "syslog.h" : YES 
Has header "string.h" : YES 
Has header "termios.h" : YES 
Has header "unistd.h" : YES 
Has header "sys/un.h" : YES 
Has header "linux/if_tun.h" : YES 
Has header "netpacket/packet.h" : YES 
Configuring meson_config.h using configuration
Checking for function "asprintf" : YES 
Checking for function "daemon" : YES 
Checking for function "explicit_bzero" : YES 
Checking for function "explicit_memset" : NO 
Checking for function "fchmod" : YES 
Checking for function "getentropy" : YES 
Checking for function "gettimeofday" : YES 
Checking for function "memset_s" : NO 
Checking for function "mlockall" : YES 
Checking for function "putenv" : YES 
Checking for function "strsignal" : YES 
Checking for function "unsetenv" : YES 
Checking for function "fork" : YES 
Checking for function "recvmmsg" : YES 
Checking for function "res_init" : YES 
Checking for type "struct arphdr" : YES 
Checking for type "struct ether_arp" : YES 
Checking for type "struct ether_header" : YES 
Checking for type "struct icmp" : YES 
Checking for type "struct icmp6_hdr" : YES 
Checking for type "struct ip" : YES 
Checking for type "struct ip6_hdr" : YES 
Checking for type "struct nd_neighbor_solicit" : YES 
Checking for type "struct nd_opt_hdr" : YES 
Checking for function "getopt_long" : YES 
Run-time dependency miniupnpc found: YES 2.2.3
Run-time dependency threads found: YES
Run-time dependency curses found: YES 6.3.20220924
Run-time dependency readline found: YES 8.2
Has header "readline/readline.h" with dependency readline: YES 
Has header "readline/history.h" with dependency readline: YES 
Run-time dependency zlib found: YES 1.2.13
Run-time dependency lzo2 found: YES 2.10
Has header "lzo/lzo1x.h" with dependency lzo2: YES 
Run-time dependency liblz4 found: YES 1.9.4
Found CMake: NO
Run-time dependency vdeplug found: NO (tried pkgconfig and cmake)
Library dl found: YES
Run-time dependency openssl found: YES 3.0.5
Configuring config.h using configuration
Library rt found: YES
Run-time dependency systemd found: YES 252
Configuring tinc.service using configuration
Configuring tinc@.service using configuration
Build targets in project: 14

tinc 1.1pre18

  System
    prefix       : /usr
    sandbox      : NO
    watchdog     : YES

  User defined options
    Cross files  : /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/meson.conf
    bindir       : /usr/bin
    buildtype    : plain
    libdir       : /usr/lib
    libexecdir   : /usr/lib
    localstatedir: /var
    prefix       : /usr
    sbindir      : /usr/sbin
    strip        : true
    sysconfdir   : /etc
    docs         : disabled
    miniupnpc    : enabled
    runstatedir  : /run
    tests        : disabled

Found ninja-1.11.1 at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/ninja
Executing (target): ninja 
[69/94] Compiling C object src/tinc.p/tincctl.c.o
../src/tincctl.c: In function 'cmd_verify':
../src/tincctl.c:2913:31: warning: pointer 'data' may be used after 'realloc' [-Wuse-after-free]
 2913 |         size_t skip = newline - data;
      |                       ~~~~~~~~^~~~~~
In file included from ../src/tincctl.c:27:
In function 'xrealloc',
    inlined from 'cmd_verify' at ../src/tincctl.c:2939:9:
../src/xalloc.h:51:13: note: call to 'realloc' here
   51 |         p = realloc(p, n);
      |             ^~~~~~~~~~~~~
../src/tincctl.c: In function 'cmd_verify':
../src/tincctl.c:2912:17: warning: pointer 'newline' may be used after 'realloc' [-Wuse-after-free]
 2912 |         *newline++ = '\0';
      |          ~~~~~~~^~
In function 'xrealloc',
    inlined from 'cmd_verify' at ../src/tincctl.c:2939:9:
../src/xalloc.h:51:13: note: call to 'realloc' here
   51 |         p = realloc(p, n);
      |             ^~~~~~~~~~~~~
[71/94] Generating src/include/version_git.h with a custom command
fatal: not a git repository: '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git'
Traceback (most recent call last):
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/version.py", line 22, in <module>
    result = subp.run(cmd, stdout=subp.PIPE, encoding="utf-8", check=True)
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir', '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git', 'describe', '--always', '--tags', '--match=release-*']' returned non-zero exit status 128.
[94/94] Linking target src/tinc
[1/7] Generating src/include/version_git.h with a custom command
fatal: not a git repository: '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git'
Traceback (most recent call last):
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/version.py", line 22, in <module>
    result = subp.run(cmd, stdout=subp.PIPE, encoding="utf-8", check=True)
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir', '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git', 'describe', '--always', '--tags', '--match=release-*']' returned non-zero exit status 128.
[1/2] Installing files.
Installing src/tinc to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/.sysroot/tinc.target/usr/sbin
Stripping target 'src/tinc'.
Installing src/tincd to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/.sysroot/tinc.target/usr/sbin
Stripping target 'src/tincd'.
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/bash_completion.d/tinc to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/.sysroot/tinc.target/usr/share/bash-completion/completions
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/systemd/tinc.service to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/.sysroot/tinc.target/usr/lib/systemd/system
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/systemd/tinc@.service to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/.sysroot/tinc.target/usr/lib/systemd/system
[1/7] Generating src/include/version_git.h with a custom command
fatal: not a git repository: '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git'
Traceback (most recent call last):
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/version.py", line 22, in <module>
    result = subp.run(cmd, stdout=subp.PIPE, encoding="utf-8", check=True)
  File "/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '--git-dir', '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.git', 'describe', '--always', '--tags', '--match=release-*']' returned non-zero exit status 128.
[1/2] Installing files.
Installing src/tinc to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/install_pkg/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/usr/sbin
Stripping target 'src/tinc'.
Installing src/tincd to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/install_pkg/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/usr/sbin
Stripping target 'src/tincd'.
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/bash_completion.d/tinc to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/install_pkg/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/usr/share/bash-completion/completions
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/systemd/tinc.service to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/install_pkg/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/usr/lib/systemd/system
Installing /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/build/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/.x86_64-libreelec-linux-gnu/systemd/tinc@.service to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/install_pkg/tinc-4c6a9a9611442f958c3049a566ac4369653978e9/usr/lib/systemd/system
build timing details:
               total:      3.255
              unpack:      0.249
     pre-build setup:      0.003
           configure:      2.189
                make:      0.201
        make install:      0.585
        copy sysroot:      0.009
     cleanup install:      0.019
docker@8c5d656d5f75:/var/media/DATA/home-rudi/LibreELEC.tv$ 
eli-schwartz commented 1 year ago

Note that this actually builds correctly, because the error message from version.py is printed to the console, and its error code is checked by meson --internal vcstagger which then says "oh, the version.py errored out? Okay, that must mean the version is the static project version". So it goes and uses that.

The logging for this could be better, sure.

heitbaum commented 1 year ago

Note that this actually builds correctly, because the error message from version.py is printed to the console, and its error code is checked by meson --internal vcstagger which then says "oh, the version.py errored out? Okay, that must mean the version is the static project version". So it goes and uses that.

The logging for this could be better, sure.

yep - all builds fine - just tracking some of the "unnecessary warnings" in the distribution builds.