Skip to content

Commit

Permalink
Enable github runner (#64)
Browse files Browse the repository at this point in the history
* Add github actions workflow
* Fix build error when avx512 is enabled
  • Loading branch information
leeopop authored Feb 19, 2024
1 parent 8f9dbd2 commit 1698203
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 207 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
DPDK_VERSION: 22.11.4

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update && sudo apt install -y linux-headers-generic build-essential libnuma-dev git meson python3-pyelftools curl libclang-dev clang llvm-dev libbsd-dev
- name: Install DPDK
run: |
wget -O dpdk.tar.xz https://fast.dpdk.org/rel/dpdk-${DPDK_VERSION}.tar.xz
mkdir dpdk-src
tar -xvJf dpdk.tar.xz -C dpdk-src --strip-components=1
cd dpdk-src
meson setup build
ninja -C build
sudo ninja -C build install
sudo ldconfig
rm -rf dpdk-src
- name: Install minimal Rust with clippy and rustfmt
run: |
curl -f -sSf https://sh.rustup.rs | bash -s -- -y --profile minimal --component clippy rustfmt
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Check
run: |
clang --version
llvm-config --version
cargo --version
gcc --version
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"dpdk-sys"
Expand Down
37 changes: 0 additions & 37 deletions Dockerfile

This file was deleted.

121 changes: 0 additions & 121 deletions INSTALL-DOCKER.md

This file was deleted.

37 changes: 0 additions & 37 deletions Jenkinsfile

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# rust-dpdk

[![Build Status](https://jenkins.redwit.io/buildStatus/icon?job=ANLAB-KAIST%2Frust-dpdk%2Fmain)](https://jenkins.redwit.io/job/ANLAB-KAIST/job/rust-dpdk/job/main/)
[![Build Status](https://github.com/ANLAB-KAIST/rust-dpdk/actions/workflows/build.yml/badge.svg)](https://github.com/ANLAB-KAIST/rust-dpdk/actions/workflows/build.yml)

Tested with <https://github.com/rust-lang/rust-bindgen> v0.65.
Tested with <https://github.com/DPDK/dpdk.git> v22.11.

## Goals
Expand Down Expand Up @@ -48,5 +47,5 @@ If your NIC requires kernel drivers, they are found at the above link.
Now add `rust-dpdk` to your project's `Cargo.toml` and use it!
```{.toml}
[dependencies]
rust-dpdk = { git = "https://github.com/ANLAB-KAIST/rust-dpdk.git" }
rust-dpdk-sys = { git = "https://github.com/ANLAB-KAIST/rust-dpdk", branch = "main" }
```
3 changes: 0 additions & 3 deletions bors.toml

This file was deleted.

12 changes: 6 additions & 6 deletions dpdk-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ impl State {

// Heuristically remove platform-specific headers
let platform_set = vec![
"x86", "x86_64", "x64", "arm", "arm32", "arm64", "amd64", "generic",
"x86", "x86_64", "x64", "arm", "arm32", "arm64", "amd64", "generic", "gfni", "32", "64",
];

// Remove blacklist headers
let blacklist_prefix = vec!["rte_acc_"];
let mut name_set: Vec<String> = vec![];
Expand All @@ -328,6 +329,7 @@ impl State {
continue 'outer;
}
}
// println!("cargo:warning=header-name: {}", file_name);
new_vec.push(file.clone());
}
new_vec.sort_by(|left, right| {
Expand Down Expand Up @@ -420,7 +422,6 @@ impl State {
let storage = some_or!(f.get_storage_class(), continue);
let return_type = some_or!(f.get_result_type(), continue);
let is_decl = f.is_declaration();
let is_def = f.is_definition();
let is_inline_fn = f.is_inline_function();

let comment = f
Expand All @@ -436,10 +437,7 @@ impl State {
// Skip hidden implementations
continue;
}
if clang::StorageClass::Static == storage && !(is_decl && is_inline_fn) {
continue;
}
if clang::StorageClass::None == storage && !is_def {
if clang::StorageClass::Static != storage || !(is_decl && is_inline_fn) {
continue;
}
// println!("cargo:warning={} {} {} {:?}", name, is_decl, f.is_inline_function(), storage);
Expand Down Expand Up @@ -845,10 +843,12 @@ impl State {
.clang_arg(dpdk_config_path.to_str().unwrap())
.clang_arg("-march=native")
.clang_arg("-Wno-everything")
.clang_arg("-DALLOW_INTERNAL_API") // We will not use internal API, but it is necessary to generate bindings.
.opaque_type("vmbus_bufring")
.opaque_type("rte_avp_desc")
.opaque_type("rte_.*_hdr")
.opaque_type("rte_arp_ipv4")
.opaque_type("__*")
.generate()
.unwrap()
.write_to_file(target_path)
Expand Down

0 comments on commit 1698203

Please sign in to comment.