Skip to content

Commit

Permalink
Fix synchronize ccommon with pelikan deps/ccommon (#212)
Browse files Browse the repository at this point in the history
* ThreadSanitizer: Fix thread leak in test_thread in ring_array suite (#212)

Summary:
fixes ring_array test case that was leaking a thread

* cmake: fix check detection (#216)

Building on Ubuntu 18.04 fails with missing symbols message
due to lack of proper libraries being automatically linked
against tests.

This patch uses pkgconfig to automatically detect system-installed
libcheck, and also gets rid of the unnecessery symbol requirement in
favor of a simple version check.

* fix python2-ism (#199)

this shows the age of my shell script snippets :)

Tested this with both python 2.7.14 and 3.6.3.

* CDB with an FFI-friendly implementation

straight copy-pasta of src/server/{twemcache => cdb}

checkpoint - squash

remove flag

checkpoint

create cdb workspace so shared libs link properly

gah i need someone who knows cmake

failling, about to try rando CMakeRust module

got further with this Rust macro stuff

omg, actual progress

oops, add the macros

rearrange and clean up dependencies

clean up cruft

compiles and links on debian

beginning pelikan side of integration

checkpoint

generate both static and shared targets

shared library building ftw?

this is fine.

checkpoint - string still getting truncated

fix build

check

try and fix build

debugging cmake vars

checkpoint

hi wil

revert

change to system calling scheme, no diff

finally seems to have linked properly

checkpoint

checkpoint

ignore cdb files

squash

add compile_commands.json to gitignore

squash

squash

remove redundant return

hook up cdb_get, munge a response and cleanup

missed two places for raw_val

need to rework storage strategy

shit, revert this mess

Revert "shit, revert this mess"

This reverts commit e369bd7.

gahhhhhh

ugh, this is sketchy

bindgen is compiling and linking

compiles again, finally
  • Loading branch information
michalbiesek authored and Yao Yue committed Sep 12, 2019
1 parent 7eb6424 commit e9fe980
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ endif(COVERAGE)
include(FindPackageHandleStandardArgs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")

find_package(Check)
find_package(PkgConfig QUIET)

if(PKG_CONFIG_FOUND)
pkg_check_modules(CHECK QUIET check>=0.10)
endif()

if(NOT CHECK_FOUND)
find_package(Check QUIET 0.10)
endif()

if (HAVE_ITT_INSTRUMENTATION)
if(PKG_CONFIG_FOUND)
Expand Down
5 changes: 4 additions & 1 deletion ci/install-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'
realpath() { python -c "from __future__ import print_function; import os,sys; print(os.path.realpath(sys.argv[1]))" "$1"; }

TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'


CHECK_VERSION=0.12.0
CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz"
Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ set(SOURCE
cc_ring_array.c
cc_signal.c)

# targets to build: here we have both static and dynmaic libs
# targets to build: here we have both static and dynamic libs
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
add_library(${PROJECT_NAME}-static STATIC ${SOURCE})
add_library(${PROJECT_NAME}-shared SHARED ${SOURCE})
if (OS_PLATFORM STREQUAL "OS_LINUX")
target_link_libraries(${PROJECT_NAME}-static rt)
target_link_libraries(${PROJECT_NAME}-shared rt)
target_link_libraries(${PROJECT_NAME}-static rt m pthread)
target_link_libraries(${PROJECT_NAME}-shared rt m pthread)
endif(OS_PLATFORM STREQUAL "OS_LINUX")
set_target_properties(${PROJECT_NAME}-static
PROPERTIES
Expand Down
1 change: 1 addition & 0 deletions test/ring_array/check_ring_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ START_TEST(test_thread)
}
}

pthread_join(producer, NULL);
ring_array_destroy(&arr);
#undef ELEM_SIZE
#undef CAP
Expand Down

0 comments on commit e9fe980

Please sign in to comment.