Skip to content

Build regression when using git clone --depth=1 #179

@Elv13

Description

@Elv13

Hi,

It worked until recently, now it does:

root@cda0d75c8eb4:/# git clone https://github.com/signalwire/libks.git --depth=1                                                    Cloning into 'libks'...
remote: Enumerating objects: 142, done.
remote: Counting objects: 100% (142/142), done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 142 (delta 28), reused 80 (delta 16), pack-reused 0
Receiving objects: 100% (142/142), 287.71 KiB | 3.16 MiB/s, done.
Resolving deltas: 100% (28/28), done.
root@cda0d75c8eb4:/# cd links
bash: cd: links: No such file or directory
root@cda0d75c8eb4:/# cd libks
root@cda0d75c8eb4:/libks# git clone https://github.com/signalwire/libks.git --depth=1^C
root@cda0d75c8eb4:/libks# git log
commit 940d659c583b255a96cac77e7e9fe62195c40e0b (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Anthony Minessale <anthm@signalwire.com>
Date:   Thu Nov 9 14:19:28 2023 -0600

    Merge pull request #171 from signalwire/realloc_crash
    
    maybe fix, at least doesn't crash
(reverse-i-search)`': ^C
root@cda0d75c8eb4:/libks# cd /libks && git clean -xfd; git reset --hard; PACKAGE_RELEASE="0" cmake .     -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release     && make package -j12 && mv *.deb /
HEAD is now at 940d659 Merge pull request #171 from signalwire/realloc_crash
Platform is linux
Build type: Release CXX Flags: 
Install prefix: /usr
-- Found Git: /usr/bin/git (found version "2.30.2") 
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
LibKS2 Version 2.0
Detecting last git tag to generate a Debian complian changelog.
fatal: No names found, cannot describe anything.
fatal: option '--count' must come before non-option arguments
Found last git tag: 
Generating a changelog using commits since git tag: 
CMake Error at CMakeLists.txt:315 (string):
  string sub-command REPLACE requires at least four arguments.


-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for clock_getres in rt
-- Looking for clock_getres in rt - found
-- Looking for clock_nanosleep in rt
-- Looking for clock_nanosleep in rt - found
-- Looking for strftime in rt
-- Looking for strftime in rt - found
-- Looking for sched_setscheduler in c
-- Looking for sched_setscheduler in c - found
-- Looking for malloc in c
-- Looking for malloc in c - found
-- Looking for usleep in c
-- Looking for usleep in c - found
-- Looking for pthread_attr_setschedparam
-- Looking for pthread_attr_setschedparam - found
-- Looking for memmem
-- Looking for memmem - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for sched.h
-- Looking for sched.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Found LibM: /usr/lib/x86_64-linux-gnu/libm.so  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'uuid'
--   Found uuid, version 2.36.1
Found UUID setup target at imported location: /usr/lib/x86_64-linux-gnu/libuuid.so
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1w")  
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1w") found components: Crypto SSL 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
Compiler supports visibility
-- Configuring incomplete, errors occurred!
See also "/libks/CMakeFiles/CMakeOutput.log".
See also "/libks/CMakeFiles/CMakeError.log".

It appears the git magic you are doing is a little birttle. There are other instances of these errors when doing a Google search, so I am not alone doing this. The fix is to do a full clone. Thankfully the library is quite small, but full clones slow down CI jobs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions