Skip to content

Commit

Permalink
Sync ccommon and fix the build (#285)
Browse files Browse the repository at this point in the history
* Squashed 'deps/ccommon/' changes from f5efe29..55769cc

55769cc restore cmake for rust libraries (#241)
6b1d8d5 Improve the Rust build story (#240)
5955d6b move nodelay setting to the server socket, and accepted connections will inherit that (#238)
aafd20f formatting (#237)
3b5c069 Update ccommon_rs to use bytes v5.0 (#235)
df74087 Address clippy lints in rust code (#234)
7c5bbd1 Make metrics and options Send + Sync (#233)
c2e617e Ensure that manually implemented C options use the correct name (#232)
6e76741 Add some docs
b5b4c5a Change check_pipe to use nanosleep instead of usleep (#231)
eb0a389 Use name of field instead of description for C metrics (#230)
16ddc76 Fix broken buf impls (#229)
eefcdcb Avoid redundant rebuilds of rust packages in CI (#228)
33f62a8 Update bindgen to also generate bindings recursively (#227)
27ffc7c Implement bytes::Buf and Bytes::ButMut on Buf and OwnedBuf (#226)
f873930 Various small bugfixes and usability improvements for rust code (#225)
37a1ecd Port option parsing module to Rust (#224)
38f7556 Fix failed test detection (#215)
0ab1604 Conditionally use std::any::type_name if it's supported (#223)
98176d3 Backport changes from #265 (#222)
ba54096 Remove test for removed rust logging functionality (#221)
519118d Rewrite cmake cargo build wrapper (#220)
5d23b3a Fix some small typos found in #263 (#219)
475dda7 Clean up logging shim (#218)
1d28dd2 Expand rust bindings to add options, metrics, and ccbox (#217)
88b5400 Upstream changes from #261 (#216)
4e99e63 fix a bug and change how check is found (#214)
54067ef slightly simplify accept error-handling logic (#210)
e9fe980 Fix synchronize ccommon with pelikan deps/ccommon (#212)
7eb6424 Cleanup libcheck related code (#211)
683bc1a cc_bstring simplify and fix (#207)
8737d99 continue on server socket on non-blocking errors (#209)
2a62281 add atoi64 to bstring (#206)
f71c657 cc_option simplify _allowed_in_name (#205)
24e3131 Add ITT instrumentation option (#204)
236c98d Fix docs (#200)
e58f6a8 cc_array and cc_ring_array NULL fixes (#201)
1c8df42 Add basic support of build type (#199)
7107988 Fix now_ns() (#198)
da240e5 cc: extend cc_util module (#196)
4846b15 Fix TAILQ_REINIT (#195)
4f5dbb0 Update Cmake version to 2.8 (#197)
2e6f78a cc_mm use OS_DARWIN macro to detect OS (#194)
57acaf6 cc: extend queue module (#193)
a64ada2 cc: extend duration module (#192)
b117632 reverting CMake file changes (#191)
dea5bee backport changes made to ccommon in pelikan (#190)
a4c0334 add linebreak to stats_log() (#188)
05eb03e fix inconsistent naming and bump version (#187)
4acc53a Stats to file (#186)
2168fec minimize osx build config (#185)
42b24de Simplify rust options, specify fewer output targets (#183)
c9fa905 update CMakeRust used to latest version, tweaks to make build work (#184)
2ef0163 Reorder dependency includes in cmake, don't parallel build (#182)
a6a54d9 remove endian-specific logic from str*cmp (#177)
4c0668b epoll_create* ignores size hint in newer kernels, switch to new API (#179)
c9c5ee5 improve cc_bstring string literal and cstring names (#176)
0184d73 Add unit tests for buffer, fix buf/dbuf bugs and refactor (#174)
d7dab43 create a .cargo/config so intellij uses the same target dir as cmake (#173)
e710712 use accept4 for tcp_accept when available (#171)
21ba10e Remove cargo lock for shared lib, closes #169 (#172)
24660f1 update style guide (#170)
17baf1e Per thread logging (#168)

git-subtree-dir: deps/ccommon
git-subtree-split: 55769cc8ae9e7d5c9ceda0472498276aec1d1ed5

* Fixes to work with newer ccommon and cargo for rust builds

Fixes various places where ccommon rust libraries were renamed or
have interface changes.

Changes the rust builds to use cargo instead of cmake. This made it
easier to integrate the changes and makes building the rust portion
more intuitive for rust developers.

* add cargo build on osx to ci

* fix copy paste error in travis config

* fix the cmake rust build

* cleanup

* remove scripts folder
  • Loading branch information
brayniac authored May 13, 2020
1 parent 1387d88 commit 56ba70c
Show file tree
Hide file tree
Showing 76 changed files with 1,402 additions and 567 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ CMAKE_BINARY_DIR
# CMake generates a .cargo/config which is specific to the local
# setup. We don't want to include it within the repo
.cargo

# Cargo build directory
/target
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,44 @@ matrix:
packages:
- libsubunit-dev

- name: "cargo build"
language: rust
addons:
apt:
<<: *apt
packages:
- libsubunit-dev
script:
- cargo build
- cargo test
- cargo build --release
- cargo test --release

- os: osx
osx_image: xcode10.1
compiler: clang

- os: osx
osx_image: xcode10.1
language: rust
script:
- cargo build
- cargo test
- cargo build --release
- cargo test --release

allow_failures:
- os: osx
osx_image: xcode10.1
compiler: clang
- os: osx
osx_image: xcode10.1
language: rust
script:
- cargo build
- cargo test
- cargo build --release
- cargo test --release

before_install:
- ./ci/before-install.sh
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if(TARGET_HTTP)
set(HAVE_RUST on)
endif()

if(HAVE_RUST)
include(cmake/CMakeCargo.cmake)
endif(HAVE_RUST)

#set(CMAKE_INCLUDE_CURRENT_DIR)
include_directories(${include_directories}
"${PROJECT_BINARY_DIR}"
Expand Down Expand Up @@ -237,9 +241,6 @@ endif()
# vim:ts=4:sw=4:et

if(HAVE_RUST)
include(deps/ccommon/cmake/CMakeCargo.cmake)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_RUST=1")

# Create a .cargo file which sets the target directory
make_directory(.cargo)
file(WRITE .cargo/config "[build]\ntarget-dir=\"${CMAKE_BINARY_DIR}/target\"\n")
Expand Down
132 changes: 54 additions & 78 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@

[workspace]
members = [
"deps/ccommon/rust/cc_binding",
"deps/ccommon/rust/ccommon_rs",
"deps/ccommon/rust/ccommon-sys",
"deps/ccommon/rust/ccommon-rs",
"deps/ccommon/rust/ccommon-derive",
"src/server/pingserver-rs",
"src/server/twemcache-http",
"src/storage/cdb/cdbgen",
"src/storage/cdb/cdb_rs",
"src/rust-util/httpencode",
"src/rust-util/pelikan",
"src/rust-util/pelikan-sys",
"src/rustcore",
"src/server/pingserver-rs",
"src/server/twemcache-http",
"src/storage/cdb/cdbgen",
"src/storage/cdb/cdb_rs",
"test/server/pingserver-rs",
Expand Down
Loading

0 comments on commit 56ba70c

Please sign in to comment.