Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more bitslab stuff, including an object pool #291

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions Cargo.lock

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

48 changes: 47 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ profile := 'release'

_cargo := "cargo" + if toolchain != "" { " +" + toolchain } else { "" }

_testcmd := if no-nextest != "" { "test" } else { "nextest run" }

_rustflags := env_var_or_default("RUSTFLAGS", "")

# If we're running in Github Actions and cargo-action-fmt is installed, then add
Expand Down Expand Up @@ -119,7 +121,7 @@ test *ARGS="--all-features": (nextest "run " + ARGS)

# run a Nextest command
nextest *ARGS: (_get-cargo-command "nextest" "cargo-nextest" no-nextest)
{{ _cargo }} nextest {{ ARGS }}
{{ _cargo }} {{ _testcmd }} {{ ARGS }}

# run rustfmt for all crates, across workspaces
fmt:
Expand Down Expand Up @@ -211,6 +213,50 @@ oranda CMD="dev": (_get-cargo-bin "oranda")
./scripts/rfc2book.py
oranda {{ CMD }}


loom crate='' *args='': (_get-cargo-command "nextest" "cargo-nextest" no-nextest)
#!/usr/bin/env bash
set -euo pipefail
source "./scripts/_util.sh"

export RUSTFLAGS="--cfg loom ${RUSTFLAGS:-}"
export LOOM_MAX_PREEMPTIONS="${LOOM_MAX_PREEMPTIONS:-2}"
export LOOM_LOG="${LOOM_LOG:-mnemos=trace,debug}"

# if logging is enabled, also enable location tracking.
if [[ "${LOOM_LOG}" != "off" ]]; then
export LOOM_LOCATION=true
status "Enabled" "logging, LOOM_LOG=${LOOM_LOG}"
else
status "Disabled" "logging and location tracking"
fi

status "Configured" "loom, LOOM_MAX_PREEMPTIONS=${LOOM_MAX_PREEMPTIONS}"

if [[ "${LOOM_CHECKPOINT_FILE:-}" ]]; then
export LOOM_CHECKPOINT_FILE="${LOOM_CHECKPOINT_FILE:-}"
export LOOM_CHECKPOINT_INTERVAL="${LOOM_CHECKPOINT_INTERVAL:-100}"
status "Saving" "checkpoints to ${LOOM_CHECKPOINT_FILE} every ${LOOM_CHECKPOINT_INTERVAL} iterations"
fi

# if the loom tests fail, we still want to be able to print the checkpoint
# location before exiting.
set +e

# run loom tests
{{ _cargo }} {{ _testcmd }} \
--release \
--lib \
{{ if crate == '' { '--workspace'} else { '--package' } }} {{ crate }} \
{{ args }}
status="$?"

if [[ "${LOOM_CHECKPOINT_FILE:-}" ]]; then
status "Checkpoints" "saved to ${LOOM_CHECKPOINT_FILE}"
fi

exit "$status"

_get-cargo-command name pkg skip='':
#!/usr/bin/env bash
set -euo pipefail
Expand Down
15 changes: 13 additions & 2 deletions source/bitslab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ repository.workspace = true
homepage.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# See more keys and their definitions at
# https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
portable-atomic = { version = "1", default-features = false }
maitake-sync = { version = "0.1", default-features = false }

[dev-dependencies]
proptest = "1"
proptest = "1"
tracing = "0.1.37"

[target.'cfg(not(loom))'.dev-dependencies]
futures = { version = "0.3.16" }
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["fmt", "ansi"] }

[target.'cfg(loom)'.dev-dependencies.loom]
version = "0.7"
features = ["futures", "checkpoint"]
Loading