Skip to content

Commit

Permalink
Squashed 'deps/ccommon/' changes from f5efe29..c9c5ee5
Browse files Browse the repository at this point in the history
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: c9c5ee5
  • Loading branch information
kevyang committed Jul 30, 2018
1 parent b93c69d commit c210f77
Show file tree
Hide file tree
Showing 37 changed files with 2,477 additions and 981 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ check_symbol_exists(sys_signame signal.h HAVE_SIGNAME)

include(CheckFunctionExists)
check_function_exists(backtrace HAVE_BACKTRACE)
check_function_exists(accept4 HAVE_ACCEPT4)

include(TestBigEndian)
test_big_endian(HAVE_BIG_ENDIAN)
Expand Down
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: 2 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#cmakedefine HAVE_BACKTRACE

#cmakedefine HAVE_ACCEPT4

#cmakedefine HAVE_BIG_ENDIAN

#cmakedefine HAVE_LOGGING
Expand Down
Loading

0 comments on commit c210f77

Please sign in to comment.