Skip to content

Commit

Permalink
feat: update to 2023, fix bear on mbp
Browse files Browse the repository at this point in the history
  • Loading branch information
DieracDelta committed Jan 1, 2024
1 parent 7f342fb commit 0f4019f
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 163 deletions.
182 changes: 88 additions & 94 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resolver = "2"
exclude = ["target_dirs", ".github"]

[workspace.package]
rust-version = "1.71.0"
rust-version = "1.75.0"
edition = "2021"
version = "0.1.0"
exclude = ["target_dirs", ".github", "target"]
Expand Down
37 changes: 37 additions & 0 deletions compile_commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"arguments": [
"/nix/store/3gz297am1parf7xr1j7vkhx82vx143vv-clang-wrapper-11.1.0/bin/clang++",
"-O2",
"-ffunction-sections",
"-fdata-sections",
"-fPIC",
"-gdwarf-2",
"-fno-omit-frame-pointer",
"-arch",
"arm64",
"-stdlib=libc++",
"-Wall",
"-Wextra",
"-std=c++20",
"-isystem",
"/nix/store/1r1j5n4ja7bg7lgwiqzr8hd47mjciqc4-nix-2.19.2-dev/include/nix",
"-isystem",
"/nix/store/w393wyn9cmw6hzsnfj4k25ffb433an12-boehm-gc-8.2.2-dev/include",
"-isystem",
"/nix/store/1r1j5n4ja7bg7lgwiqzr8hd47mjciqc4-nix-2.19.2-dev/include/nix",
"-isystem",
"/nix/store/1r1j5n4ja7bg7lgwiqzr8hd47mjciqc4-nix-2.19.2-dev/include/nix",
"-DNIX_2_4_0",
"-DNIX_2_6_0",
"-DNIX_2_9_0",
"-c",
"-o",
"/Users/jrestivo/dev/dawn/target_dirs/nix_rustc/debug/build/dawn-bindings-b497435e10cda334/out/plugin.o",
"plugin.cpp"
],
"directory": "/Users/jrestivo/dev/dawn/dawn-bindings",
"file": "/Users/jrestivo/dev/dawn/dawn-bindings/plugin.cpp",
"output": "/Users/jrestivo/dev/dawn/target_dirs/nix_rustc/debug/build/dawn-bindings-b497435e10cda334/out/plugin.o"
}
]
6 changes: 3 additions & 3 deletions dawn-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ crate_type = ["cdylib"]
test = false

[build-dependencies]
cc = "1.0.79"
pkg-config = "0.3.27"
cbindgen = "0.24.5"
cc = "1.0.83"
pkg-config = "0.3.28"
cbindgen = "0.26.0"
miette = { version = "5.10.0", features = ["fancy"] }
5 changes: 2 additions & 3 deletions dawn-bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ fn main() -> miette::Result<()> {
.cpp(true)
.shared_flag(true)
.flag("-std=c++20")
.cpp_set_stdlib("c++")
.cpp_set_stdlib("c++")
.add_pkg_config(nix_expr)
.add_pkg_config(nix_store)
.add_pkg_config(nix_main)
.cargo_metadata(false)
.file("plugin.cpp")
;
.file("plugin.cpp");

// HACK: For some reason, rustc doesn't link libc++ on macOS by itself even
// though cc-rs has been told cpp(true). So we force it.
Expand Down
1 change: 1 addition & 0 deletions dawn-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub struct Context {}

#[no_mangle]
pub extern "C" fn initialize_plugin() -> *mut Context {
println!("We initialized debugging context");
Box::into_raw(Box::new(Context {}))
}

Expand Down
28 changes: 14 additions & 14 deletions dawn-infra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ categories = { workspace = true }
exclude = { workspace = true }

[dependencies]
tokio = {version = "1.26.0", default-features = false, features = [ "full" ] }
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
snafu = "0.7.4"
tokio = {version = "1.35.1", default-features = false, features = [ "full" ] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
snafu = "0.8.0"
debug_types = "1.0.0"
tokio-util = { version = "0.7.7", features = ["codec"]}
futures = { version = "0.3.26"}
async-trait = "0.1.65"
tokio-util = { version = "0.7.10", features = ["codec"]}
futures = { version = "0.3.30"}
async-trait = "0.1.76"


serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0.47", features = ["unbounded_depth"] }
bytes = { version = "1.4.0"}
memchr = { version = "2.5.0"}
serde = { version = "1.0.193", features = ["derive"] }
serde_json = { version = "1.0.108", features = ["unbounded_depth"] }
bytes = { version = "1.5.0"}
memchr = { version = "2.7.1"}
httparse = { version = "1.8.0"}
nll = { git = "https://github.com/EspressoSystems/nll" }
futures-util = { version = "0.3.26"}
either = "1.8.1"
futures-util = { version = "0.3.30"}
either = "1.9.0"

tower-lsp = { version = "0.19.0" }
tower-lsp = { version = "0.20.0" }
tower-service = "0.3.2"

atomic_enum = "0.2.0"
28 changes: 14 additions & 14 deletions dawn-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ categories = { workspace = true }
exclude = { workspace = true }

[dependencies]
tokio = {version = "1.26.0", default-features = false, features = [ "full" ] }
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
snafu = "0.7.4"
tokio = {version = "1.35.1", default-features = false, features = [ "full" ] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
snafu = "0.8.0"
debug_types = "1.0.0"
tokio-util = { version = "0.7.7", features = ["codec"]}
futures = { version = "0.3.26"}
async-trait = "0.1.65"
tokio-util = { version = "0.7.10", features = ["codec"]}
futures = { version = "0.3.30"}
async-trait = "0.1.76"


serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0.47", features = ["unbounded_depth"] }
bytes = { version = "1.4.0"}
memchr = { version = "2.5.0"}
serde = { version = "1.0.193", features = ["derive"] }
serde_json = { version = "1.0.108", features = ["unbounded_depth"] }
bytes = { version = "1.5.0"}
memchr = { version = "2.7.1"}
httparse = { version = "1.8.0"}
nll = { git = "https://github.com/EspressoSystems/nll" }
futures-util = { version = "0.3.26"}
either = "1.8.1"
futures-util = { version = "0.3.30"}
either = "1.9.0"

tower-lsp = { version = "0.19.0" }
tower-lsp = { version = "0.20.0" }
tower-service = "0.3.2"

dawn-infra = { path = "../dawn-infra" }
Expand Down
1 change: 1 addition & 0 deletions dawn-plugin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use debug_types::ProtocolMessage;
use nix_debugger::{NixDebugAdapter, NixDebugState};
use tokio_util::codec::{FramedRead, FramedWrite};
use tracing::error;

///! debugger
pub mod nix_debugger;

Expand Down
57 changes: 37 additions & 20 deletions flake.lock

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

22 changes: 13 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-release = {
url = "github:NixOS/nix?ref=2.17.0";
url = "github:NixOS/nix?ref=2.19.2";
};
bear-fix = {
url = "github:emilazy/nixpkgs/fix-bear";
};
};

outputs = inputs@{ self, nixpkgs, utils, fenix, nix-release }:
outputs = inputs@{ self, nixpkgs, utils, fenix, nix-release, bear-fix }:
utils.lib.eachDefaultSystem (system:
let
fenixStable = fenix.packages.${system}.stable.withComponents [ "cargo" "clippy" "rust-src" "rustc" "rustfmt" "llvm-tools-preview" ];
overlaid = final: prev:
{
rustc = fenixStable;
cargo = fenixStable;
rust-src = fenixStable;
# rustc = fenixStable;
# cargo = fenixStable;
# rust-src = fenixStable;
nix = nix-release.packages.${system}.nix-clang11Stdenv;
};
pkgs = import nixpkgs {
Expand All @@ -40,17 +43,18 @@
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
buildInputs =
with pkgs; [
rust-src
# rust-src
pkg-config
fenixStable
fenix.packages.${system}.rust-analyzer
just
cargo-expand
cargo
rustc
# cargo
# rustc
nix
nix.dev
bear
bear-fix.legacyPackages.${system}.bear
# bear
rust-cbindgen # for executable cbindgen
clang-tools_15 # for up to date clangd
clang_11
Expand Down
14 changes: 9 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ default: build lint test

build:
echo Building nix dap adapter..
cargo build --release --workspace --examples --bins --tests
cargo build --workspace --examples --bins --tests

build_bindings:
echo Building nix dap adapter..
cargo build --release --package dawn-bindings
cargo build --package dawn-bindings

run_plugin_mbp:
nix --option plugin-files ./target_dirs/nix_rustc/debug/libnix_bindings.dylib repl
nix --option plugin-files ./target_dirs/nix_rustc/debug/libdawn_bindings.dylib repl

test:
echo Testing nix dap adapter...
cargo test --release --workspace -- --nocapture --test-threads=1
cargo test --workspace -- --nocapture --test-threads=1

clean:
echo Cleaning...
cargo clean

lint:
echo Linting…
cargo clippy --release --workspace --examples --bins --tests
cargo clippy --workspace --examples --bins --tests

fmt:
cargo fmt
Expand All @@ -31,3 +31,7 @@ fix:

doc:
cargo doc --workspace --open

gen_compile_commands:
cargo clean
bear -- cargo build --package dawn-bindings

0 comments on commit 0f4019f

Please sign in to comment.