From 8f25f54998bbb34b2e18df19b14c3b76f6ce73eb Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Thu, 10 Oct 2024 19:46:09 -0600 Subject: [PATCH] Significant cleanup --- .github/workflows/build-project.yml | 16 ----------- dpdk-sys/build.rs | 12 ++++---- justfile | 44 +++++------------------------ 3 files changed, 12 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index d1997c3c..f63b6805 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -24,19 +24,3 @@ jobs: run: just install-rust - name: just build run: just build --release - build-on-gh: - runs-on: ubuntu-latest - container: - image: ghcr.io/githedgehog/dpdk-sys/dev-env:main-llvm18-8e2b295283f9a3b63603395541ee173c1c00c91d - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: compile-env is self - run: just _ci-compile-env-hack - - name: install rust - run: just install-rust - - name: just build - run: just build --release diff --git a/dpdk-sys/build.rs b/dpdk-sys/build.rs index 82bbfa4d..56a3ed82 100644 --- a/dpdk-sys/build.rs +++ b/dpdk-sys/build.rs @@ -69,7 +69,6 @@ fn bind(path: &Path, sysroot: &str) { .expect("Unable to generate bindings") .write_to_file(path.join("generated.rs")) .expect("Couldn't write bindings!"); - } fn main() { @@ -100,18 +99,17 @@ fn main() { "rte_kvargs", "rte_telemetry", "rte_log", + "ibverbs", + "mlx5", + "nl-route-3", + "nl-3", + "numa", ]; - let depends_no_whole_archive = ["ibverbs", "mlx5", "nl-route-3", "nl-3", "numa"]; - depends.iter().for_each(|dep| { println!("cargo:rustc-link-lib=static:+whole-archive,+bundle={dep}"); }); - depends_no_whole_archive.iter().for_each(|dep| { - println!("cargo:rustc-link-lib=static:-whole-archive,+bundle={dep}"); - }); - let rerun_if_changed = ["build.rs"]; rerun_if_changed.iter().for_each(|file| { diff --git a/justfile b/justfile index a1278d74..4130de82 100644 --- a/justfile +++ b/justfile @@ -14,7 +14,7 @@ toolchain := "1.81.0" default_profile := "debug" _container_source := "ghcr.io/githedgehog/dpdk-sys" -llvm_version := "18" +llvm_version := "19" dev_env_container := _container_source + "/dev-env:main-llvm" + llvm_version compile_env_container := _container_source + "/compile-env:main-llvm" + llvm_version @@ -30,18 +30,16 @@ install-rust toolchain=toolchain: rustup target add x86_64-unknown-linux-musl [script] -build *args: +_cargo-with-rust-flags *args: {{ _just_debuggable_ }} source ./just.env declare -a args=({{args}}) - echo args: "${args[@]}" PROFILE="{{default_profile}}" - TOOLCHAIN="+{{toolchain}}" declare -a extra_args=() for arg in "${args[@]}"; do case "$arg" in +*) - declare -r TOOLCHAIN="${arg}" + declare -rx RUST_TOOLCHAIN="${arg}" ;; --debug|--profile=debug) [ -z "${RUSTFLAGS:-}" ] && declare -rx RUSTFLAGS="${RUSTFLAGS_DEBUG}" @@ -55,34 +53,11 @@ build *args: ;; esac done - echo "Building with RUSTFLAGS: ${RUSTFLAGS:-}" - cargo "${TOOLCHAIN}" build "${extra_args[@]}" - - -# for arg in "${args[@]}"; do -# if [[ "$arg" == "--release" ]]; then -# [ -z "${RUSTFLAGS:-}" ] && declare -rx RUSTFLAGS="${RUSTFLAGS_RELASE}" -# fi -# if [[ "$arg" == "--debug" ]]; then -# [ -z "${RUSTFLAGS:-}" ] && declare -rx RUSTFLAGS="${RUSTFLAGS_DEBUG}" -# fi -# done -# case "{{profile}}" in -# release) -# echo "Building with release RUSTFLAGS" -# export RUSTFLAGS="${RUSTFLAGS_RELASE}" -# ;; -# debug) -# echo "Building with release RUSTFLAGS" -# export RUSTFLAGS="${RUSTFLAGS_DEBUG}" -# ;; -# *) -# echo "Building with default (debug) RUSTFLAGSs" -# export RUSTFLAGS="${RUSTFLAGS_DEBUG}" -# ;; -# esac -# cargo +{{toolchain}} build {{args}} + >&2 echo "With RUSTFLAGS=\"${RUSTFLAGS:-}\"" + cargo "${RUST_TOOLCHAIN:-+{{toolchain}}}" "${extra_args[@]}" +[script] +cargo *args: (_cargo-with-rust-flags args) [script] dev-env: \ @@ -119,11 +94,6 @@ dev-env: \ "{{dev_env_container}}" \ /bin/bash -[script] -test *args="": build - {{ _just_debuggable_ }} - cargo test {{args}} - [script] pull-compile-env: {{ _just_debuggable_ }}