Skip to content

Commit 9d63f78

Browse files
committed
use build.rs to remove dnoland paths
Make build more friendly Address @qmonnet comments Address some of @qmonnet comments scratch work for nix env dpdk + musl complete static working bad idea better idea hold on, I got a better idea I think this is better scratch scratch 2 gnu and musl working cleanup cleanup 2 cleanup 3 sorta workin Needs cleanup but we are nearly done with our build system here victory victory 2 victory 3 actual readme (sorta) admonitions not working? Fix error in README.md crt-static was breaking tests This is not good for a number of reasons. May need to drop glibc support :/ Make Dockerfile.dev-env work with busybox coreutils impl Expand justfile Demo prep Work toward tests in CI Significant cleanup Test README automatically hack the test runner Sadly not happy with CI Reduce MSRV catch up to dpdk-sys a bit restore nix for docs build
1 parent b6458fc commit 9d63f78

File tree

125 files changed

+1741
-32038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1741
-32038
lines changed

.cargo/config.toml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
[target.'cfg(debug_assertions)']
2-
runner = 'sudo -E'
3-
rustflags = [
4-
"-C", "linker=clang",
5-
"-C", "link-arg=-fuse-ld=lld",
6-
"-C", "link-arg=--ld-path=/home/dnoland/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld.lld",
7-
"-C", "opt-level=0",
8-
"-C", "lto=false",
9-
]
1+
[env]
2+
DEV_ENV = { value = "compile-env", relative = true, force = false }
3+
SYSROOT = { value = "compile-env/sysroot", relative = true, force = false }
4+
5+
PATH = { value = "compile-env/bin", relative = true, force = true }
6+
LD_LIBRARY_PATH = { value = "compile-env/lib", relative = true, force = true }
7+
LIBCLANG_PATH = { value = "compile-env/lib", relative = true, force = true }
108

11-
[target.'cfg(not(debug_assertions))']
12-
rustflags = [
13-
"-C", "linker=clang",
14-
"-C", "link-arg=-fuse-ld=lld",
15-
"-C", "link-arg=--ld-path=/home/dnoland/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld.lld",
16-
"-C", "opt-level=3",
17-
"-C", "codegen-units=1",
18-
"-C", "linker-plugin-lto",
19-
"-C", "lto=thin",
20-
"-C", "embed-bitcode=yes",
21-
# Full RELRO as a basic security measure
22-
# <https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro>
23-
"-C", "relro-level=full",
24-
# "-Z", "sanitizer=cfi",
25-
# "-Z", "sanitizer=safestack",
26-
]
9+
[build]
10+
target = [
11+
"x86_64-unknown-linux-gnu",
12+
"x86_64-unknown-linux-musl",
13+
]

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
image: "dpdk-sysroot",
3-
"name": "dpdk-dev-container",
2+
image: "ghcr.io/githedgehog/dataplane/development-environment:debug",
3+
"name": "datataplane-development-environment",
44
"mounts": [
55
"source=/mnt/huge/2M,target=/mnt/huge/2M,type=bind",
66
"source=/mnt/huge/1G,target=/mnt/huge/1G,type=bind"

.github/workflows/build-and-deploy-docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: Build and deploy
1+
name: Build and deploy docs
22
on:
3-
pull_request:
43
push:
4+
branches:
5+
- main
56
permissions:
67
contents: read
78
pages: write
@@ -24,7 +25,7 @@ jobs:
2425
id: extract_hash
2526

2627
- name: Install nix
27-
uses: cachix/install-nix-action@v27
28+
uses: cachix/install-nix-action@v30
2829

2930
- name: Nix cache
3031
id: cache-nix-packages
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build project
2+
on: [ push, pull_request ]
3+
4+
permissions:
5+
contents: write
6+
packages: read
7+
id-token: write
8+
jobs:
9+
build:
10+
name: build project
11+
runs-on:
12+
- lab
13+
timeout-minutes: 180
14+
container:
15+
image: ghcr.io/githedgehog/dpdk-sys/dev-env:main-rust-pinned
16+
credentials:
17+
username: ${{ github.actor }}
18+
password: ${{ secrets.GITHUB_TOKEN }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: compile-env is self
23+
run: just _ci-compile-env-hack
24+
- run: just cargo build
25+
- run: just cargo build --release
26+
- run: just cargo test
27+
- run: just cargo test --release
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on: [ push, pull_request ]
2+
3+
permissions:
4+
contents: write
5+
packages: read
6+
id-token: write
7+
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
profile: [ "debug", "release" ]
13+
just_version: [ "1.36.0" ]
14+
rust_toolchain: [ "stable", "1.82.0", "nightly-2024-10-22" ]
15+
runs-on:
16+
- lab
17+
timeout-minutes: 180
18+
steps:
19+
- name: login to ghcr.io
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: install just
26+
uses: extractions/setup-just@v2
27+
with:
28+
just-version: ${{matrix.just_version}}
29+
- name: install rustup
30+
uses: dtolnay/rust-toolchain@stable
31+
with:
32+
toolchain: ${{matrix.rust_toolchain}}
33+
targets: "x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl"
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: refresh-compile-env
37+
run: just --yes refresh-compile-env
38+
- run: just --yes fake-nix
39+
- name: just build (glibc)
40+
run: just cargo +${{matrix.rust_toolchain}} build --profile=${{matrix.profile}} --target=x86_64-unknown-linux-gnu
41+
- name: just test (glibc)
42+
run: just cargo +${{matrix.rust_toolchain}} test --profile=${{matrix.profile}} --target=x86_64-unknown-linux-gnu
43+
- name: just build
44+
run: just cargo +${{matrix.rust_toolchain}} build --profile=${{matrix.profile}} --target=x86_64-unknown-linux-musl
45+
- name: just test
46+
run: just cargo +${{matrix.rust_toolchain}} test --profile=${{matrix.profile}} --target=x86_64-unknown-linux-musl

.github/workflows/update-flake.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@
33
/result*
44
/target/**
55
/design-docs/src/mdbook/book/**
6-
/dpdk-sys/sysroot/**
6+
/sysroot/**
7+
/nix/result*
8+
/sysroot
9+
/dev-env
10+
/compile-env/
11+
/dev-env-template/etc
12+
/sterile

0 commit comments

Comments
 (0)