Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Squashed 'deps/ccommon/' changes from f5efe29..a6a54d9
Browse files Browse the repository at this point in the history
a6a54d9 remove endian-specific logic from str*cmp (twitter#177)
4c0668b epoll_create* ignores size hint in newer kernels, switch to new API (twitter#179)
c9c5ee5 improve cc_bstring string literal and cstring names (twitter#176)
0184d73 Add unit tests for buffer, fix buf/dbuf bugs and refactor (twitter#174)
d7dab43 create a .cargo/config so intellij uses the same target dir as cmake (twitter#173)
e710712 use accept4 for tcp_accept when available (twitter#171)
21ba10e Remove cargo lock for shared lib, closes twitter#169 (twitter#172)
24660f1 update style guide (twitter#170)
17baf1e Per thread logging (twitter#168)

git-subtree-dir: deps/ccommon
git-subtree-split: a6a54d9
  • Loading branch information
Yao Yue committed Oct 26, 2018
1 parent b93c69d commit b9e0086
Show file tree
Hide file tree
Showing 42 changed files with 2,511 additions and 1,478 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ endif()
# config.h.in has to include entries set/tested here for them to have effect

# version info
set(${PROJECT_NAME}_VERSION_MAJOR 1)
set(${PROJECT_NAME}_VERSION_MINOR 2)
set(${PROJECT_NAME}_VERSION_MAJOR 2)
set(${PROJECT_NAME}_VERSION_MINOR 0)
set(${PROJECT_NAME}_VERSION_PATCH 0)
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}
Expand Down Expand Up @@ -96,9 +96,7 @@ check_symbol_exists(sys_signame signal.h HAVE_SIGNAME)

include(CheckFunctionExists)
check_function_exists(backtrace HAVE_BACKTRACE)

include(TestBigEndian)
test_big_endian(HAVE_BIG_ENDIAN)
check_function_exists(accept4 HAVE_ACCEPT4)

# how to use config.h.in to generate config.h
# this has to be set _after_ the above checks
Expand Down Expand Up @@ -189,6 +187,5 @@ message(STATUS "CFLAGS: " ${CMAKE_C_FLAGS})
message(STATUS "HAVE_SIGNAME: " ${HAVE_SIGNAME})

message(STATUS "HAVE_BACKTRACE: " ${HAVE_BACKTRACE})
message(STATUS "HAVE_BIG_ENDIAN: " ${HAVE_BIG_ENDIAN})

message(STATUS "CHECK_WORKING: " ${CHECK_WORKING})
20 changes: 18 additions & 2 deletions ci/install-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,28 @@ CHECK_VERSION=0.12.0
CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz"
CHECK_DIR="check-${CHECK_VERSION}"

echo "building and installing check" >&2

(
cd "$TEMP" &&
wget "https://github.com/libcheck/check/releases/download/${CHECK_VERSION}/${CHECK_TARBALL}" &&
tar xvfz "${CHECK_TARBALL}" &&
tar xfz "${CHECK_TARBALL}" &&
cd "${CHECK_DIR}" &&
./configure --prefix="$CHECK_PREFIX" &&
make &&
make install
) || die "check build failed"
) >$TEMP/cmake-build.log 2>&1

RESULT=$?
if [[ $RESULT -ne 0 ]]; then
cat >&2 <<EOS
check build failed! log below:
EOS

cat $TEMP/cmake-build.log
else
echo "Success!" >&2
fi

exit $RESULT
55 changes: 55 additions & 0 deletions ci/local-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

## This file is potentially useful for doing a clean environment build on MacOS ##
## This is my personal way of running the build, YMMV - jsimms ##

set -euo pipefail
IFS=$'\n\t'

die() { echo "fatal: $*" >&2; exit 1; }

TOPLEVEL=$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel) || die "TOPLEVEL fail"

cd "$TOPLEVEL"

TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

BUILD_PATH=(
"$HOME/.cargo/bin"
"/usr/local/bin"
"/usr/local/sbin"
"/usr/bin"
"/usr/sbin"
"/bin"
"/sbin"
"/opt/X11/bin"
"/usr/X11R6/bin"
)

PATH=$(echo "${BUILD_PATH[@]}"|tr ' ' ':')

cat >&2 <<EOS
CC=${CC:-}
CFLAGS=${CFLAGS:-}
LDFLAGS=${LDFLAGS:-}
PATH=${PATH:-}
EOS

CMAKEFLAGS=(
-DHAVE_RUST=yes
-DRUST_VERBOSE_BUILD=yes
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
)

BUILD_DIR="${BUILD_DIR:-$TEMP}"

mkdir -p "$BUILD_DIR" && (
cd "$BUILD_DIR" &&
cmake "${CMAKEFLAGS[@]}" "$TOPLEVEL" &&
make -j all &&
make check &&
cd rust &&
cargo test
)
2 changes: 1 addition & 1 deletion config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#cmakedefine HAVE_BACKTRACE

#cmakedefine HAVE_BIG_ENDIAN
#cmakedefine HAVE_ACCEPT4

#cmakedefine HAVE_LOGGING

Expand Down
Loading

0 comments on commit b9e0086

Please sign in to comment.