Skip to content

Commit

Permalink
fixup! refactor!: rollup-http-server based on libcmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmikhalevich committed Mar 20, 2024
1 parent 47e9d8b commit 250a383
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 1,470 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
crossbuild-essential-riscv64 \
gcc-12-riscv64-linux-gnu \
g++-12-riscv64-linux-gnu \
libclang-dev \
&& \
wget -O ${LINUX_HEADERS_FILEPATH} ${LINUX_HEADERS_URLPATH} && \
echo "7d0238324661a3850fe2e07e5c4485a94da5d5162dbb67def0f1541ed1dc3b45 ${LINUX_HEADERS_FILEPATH}" | sha256sum --check && \
Expand Down Expand Up @@ -79,10 +80,11 @@ RUN make -C ${BUILD_BASE}/tools/sys-utils/libcmt/ -j$(nproc) ioctl.install mock.
PREFIX=/usr/x86_64-linux-gnu TARGET_PREFIX=/usr/riscv64-linux-gnu
USER developer
RUN make -C ${BUILD_BASE}/tools/sys-utils/ -j$(nproc) all
ENV CPATH="${CMT_BASE}/install/include:${CPATH}"

# build rust tools
# ------------------------------------------------------------------------------
FROM tools-env as rust-env
FROM c-builder as rust-env
ENV PATH="/home/developer/.cargo/bin:${PATH}"

USER developer
Expand Down
98 changes: 29 additions & 69 deletions rollup-http/rollup-http-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rollup-http/rollup-http-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rollup-http-server"
version = "0.1.0"
edition = "2021"
authors = ["Marko Atanasievski <[email protected]>"]
authors = ["Marko Atanasievski <[email protected]>, Sofia Rodrigues <[email protected]>, Alex Mikhalevich <[email protected]>"]

[lib]
name = "rollup_http_server"
Expand Down Expand Up @@ -30,7 +30,7 @@ rstest = "0.12"


[build-dependencies]
bindgen = "0.59"
bindgen = "0.69.4"
cc = "1.0"
tonic-build = "0.5"

Expand Down
17 changes: 17 additions & 0 deletions rollup-http/rollup-http-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,25 @@
// limitations under the License.
//

use std::env;
use std::path::PathBuf;

extern crate cc;

fn main() {
// link the libcmt shared library
println!("cargo:rustc-link-lib=cmt");

let bindings = bindgen::Builder::default()
// the input header we would like to generate bindings for
.header("src/rollup/wrapper.h")
// invalidate the built crate whenever any of the included header files changed
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("Unable to generate bindings");

let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
1 change: 0 additions & 1 deletion rollup-http/rollup-http-server/src/dapp_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
//

use std::os::unix::io::RawFd;
use std::sync::Arc;

use async_mutex::Mutex;
Expand Down
Loading

0 comments on commit 250a383

Please sign in to comment.