diff --git a/README.md b/README.md index b724c32..baa38e9 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ will print out hello world - Figure out how to communicate (e.g. which port, etc). It might be possible to do over stdin/stdout, but likely would need to check. - Figure out how to get stuff out of nix. +- Add debugger flag +- initialize a NixRepl in a sensible enough way # Thanks diff --git a/dawn-bindings/build.rs b/dawn-bindings/build.rs index f2c9273..7c95a8c 100644 --- a/dawn-bindings/build.rs +++ b/dawn-bindings/build.rs @@ -48,15 +48,18 @@ fn main() -> miette::Result<()> { let mut build = cc::Build::new(); build - .cpp(true) .opt_level(2) + // .flag("-lc++abi") + .cpp(true) .shared_flag(true) .flag("-std=c++20") + .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. diff --git a/dawn-bindings/plugin.cpp b/dawn-bindings/plugin.cpp index 26ad886..6658749 100644 --- a/dawn-bindings/plugin.cpp +++ b/dawn-bindings/plugin.cpp @@ -36,19 +36,19 @@ static void enable_dap(EvalState &state, const PosIdx pos, Value **args, class PluginInstance { Context *context; - RegisterPrimOp primop; + // RegisterPrimOp primop; public: // constructor PluginInstance() - : - primop({ - .name = "enable-dap", - .args = {}, - .doc = "lol", - .fun = enable_dap, - .experimentalFeature = {}, - }) + // : + // primop({ + // .name = "enable-dap", + // .args = {}, + // .doc = "lol", + // .fun = enable_dap, + // .experimentalFeature = {}, + // }) { context = initialize_plugin(); } @@ -57,5 +57,12 @@ class PluginInstance { ~PluginInstance() { deinitialize_plugin(context); } }; + // addFlag({ + // .longName = "debugger", + // .description = "Start an interactive environment if evaluation fails.", + // .category = MixEvalArgs::category, + // .handler = {&startReplOnEvalErrors, true}, + // }); + // global variable that will be initialized when the plugin is dl-open-ed PluginInstance x{}; diff --git a/dawn-plugin/src/main.rs b/dawn-plugin/src/main.rs index 964a25e..514e1d4 100644 --- a/dawn-plugin/src/main.rs +++ b/dawn-plugin/src/main.rs @@ -9,8 +9,8 @@ #![allow(clippy::unused_async, clippy::module_name_repetitions)] //! nix debugger implementation -use dap_server::codec::DebugAdapterCodec; -use dap_server::debugger::{Client, DebugAdapter, State}; +use dawn_infra::codec::DebugAdapterCodec; +use dawn_infra::debugger::{Client, DebugAdapter, State}; use debug_types::ProtocolMessage; use nix_debugger::{NixDebugAdapter, NixDebugState}; use tokio_util::codec::{FramedRead, FramedWrite}; diff --git a/dawn-plugin/src/nix_debugger.rs b/dawn-plugin/src/nix_debugger.rs index b8ea046..73a6c4c 100644 --- a/dawn-plugin/src/nix_debugger.rs +++ b/dawn-plugin/src/nix_debugger.rs @@ -7,7 +7,7 @@ use debug_types::{ }; use either::Either; -use dap_server::debugger::{Client, DebugAdapter, State}; +use dawn_infra::debugger::{Client, DebugAdapter, State}; use debug_types::requests::RequestCommand::{ BreakpointLocations, ConfigurationDone, Disconnect, Initialize, Launch, };