Skip to content

Commit

Permalink
Make build more friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-noland committed Oct 23, 2024
1 parent 20a95cc commit 5c3f972
Show file tree
Hide file tree
Showing 834 changed files with 126,981 additions and 14,734 deletions.
37 changes: 12 additions & 25 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
[target.'cfg(debug_assertions)']
runner = 'sudo -E'
rustflags = [
"-C", "linker=clang",
"-C", "link-arg=-fuse-ld=lld",
"-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",
"-C", "opt-level=0",
"-C", "lto=false",
]
[env]
DEV_ENV = { value = "compile-env", relative = true, force = false }
SYSROOT = { value = "compile-env/sysroot", relative = true, force = false }

PATH = { value = "compile-env/bin", relative = true, force = true }
LD_LIBRARY_PATH = { value = "compile-env/lib", relative = true, force = true }
LIBCLANG_PATH = { value = "compile-env/lib", relative = true, force = true }

[target.'cfg(not(debug_assertions))']
rustflags = [
"-C", "linker=clang",
"-C", "link-arg=-fuse-ld=lld",
"-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",
"-C", "opt-level=3",
"-C", "codegen-units=1",
"-C", "linker-plugin-lto",
"-C", "lto=thin",
"-C", "embed-bitcode=yes",
# Full RELRO as a basic security measure
# <https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro>
"-C", "relro-level=full",
# "-Z", "sanitizer=cfi",
# "-Z", "sanitizer=safestack",
]
[build]
target = [
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
]
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
image: "dpdk-sysroot",
"name": "dpdk-dev-container",
image: "ghcr.io/githedgehog/dataplane/development-environment:debug",
"name": "datataplane-development-environment",
"mounts": [
"source=/mnt/huge/2M,target=/mnt/huge/2M,type=bind",
"source=/mnt/huge/1G,target=/mnt/huge/1G,type=bind"
Expand Down
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ updates:
directories:
- /
schedule:
interval: "daily"
interval: "weekly"
versioning-strategy: "widen"
groups:
dev-dependencies:
applies-to: version-updates
applies-to: "version-updates"
patterns:
- "*"
update-types:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/check-developer-experience.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# The primary point of this workflow is to ensure that the developer experience is good.
# We take a very vanilla ubuntu image, install needed dependencies via normal means,
# and then run the build and test steps as described in the README.md file.

# The artifacts produced by these builds are not intended to be used for anything other than
# ensuring that the developer experience is good.

# Production artifacts are produced in a sterile environment (in another CI workflow).
name: Developer Experience
on:
- push

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true

permissions:
contents: write
packages: read
id-token: write
jobs:
build:
strategy:
fail-fast: false
matrix:
profile: [ "debug", "release" ]
just_version: [ "1.36.0" ]
rust_toolchain: [ "stable", "1.82.0", "nightly-2024-10-22" ]
runs-on:
- lab
timeout-minutes: 180
steps:
- name: login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: install just
uses: extractions/setup-just@v2
with:
just-version: ${{matrix.just_version}}
- name: install rustup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{matrix.rust_toolchain}}
targets: "x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl"
- name: Checkout
uses: actions/checkout@v4
- name: refresh-compile-env
run: just --yes refresh-compile-env
- run: just --yes fake-nix
- name: just build (glibc)
run: just cargo +${{matrix.rust_toolchain}} build --profile=${{matrix.profile}} --target=x86_64-unknown-linux-gnu
- name: just test (glibc)
run: just cargo +${{matrix.rust_toolchain}} test --profile=${{matrix.profile}} --target=x86_64-unknown-linux-gnu
- name: just build
run: just cargo +${{matrix.rust_toolchain}} build --profile=${{matrix.profile}} --target=x86_64-unknown-linux-musl
- name: just test
run: just cargo +${{matrix.rust_toolchain}} test --profile=${{matrix.profile}} --target=x86_64-unknown-linux-musl
55 changes: 55 additions & 0 deletions .github/workflows/sterile-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This is a sterile build and test workflow that uses the `dev-env` container image
# to build and test the project in a sterile environment.
# Artifacts produced by this workflow are intended to be used for production.
name: Sterile build + test
on:
- push

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true

permissions:
contents: "write"
packages: "read"
id-token: "write"
jobs:
compile:
runs-on:
- "lab"
strategy:
fail-fast: false
matrix:
dpdk_sys:
- "main"
just:
- "1.36.0"
rust:
- "pinned"
profile:
- "debug"
- "release"
steps:
- name: login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: install just
uses: extractions/setup-just@v2
with:
just-version: ${{matrix.just}}
- name: Checkout
uses: actions/checkout@v4
- run: just sterile cargo build --profile=${{ matrix.profile }} --target=x86_64-unknown-linux-gnu
- run: just sterile cargo test --profile=${{ matrix.profile }} --target=x86_64-unknown-linux-gnu
- run: just sterile cargo build --profile=${{ matrix.profile }} --target=x86_64-unknown-linux-musl
- run: just sterile cargo test --profile=${{ matrix.profile }} --target=x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v4
with:
name: dpdk-sys-${{ matrix.dpdk_sys }}-rust-${{ matrix.rust }}-target
path: target
retention-days: 1
compression-level: 6
overwrite: false
30 changes: 0 additions & 30 deletions .github/workflows/update-flake.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
/result*
/target/**
/design-docs/src/mdbook/book/**
/dpdk-sys/sysroot/**
/sysroot/**
/nix/result*
/sysroot
/dev-env
/compile-env/
/dev-env-template/etc
/sterile
Loading

0 comments on commit 5c3f972

Please sign in to comment.