diff --git a/anneal/Cargo.toml b/anneal/Cargo.toml index 065c7eb10d..140b637732 100644 --- a/anneal/Cargo.toml +++ b/anneal/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "tools/doc_gen", "v2/setup"] +members = [".", "tools/doc_gen", "v2/toolchain-config"] [package] name = "cargo-anneal" diff --git a/anneal/v2/result b/anneal/v2/result new file mode 120000 index 0000000000..3f8097e847 --- /dev/null +++ b/anneal/v2/result @@ -0,0 +1 @@ +/nix/store/592hg0sahwy2p9vnj2wq31arkymvyl23-anneal-toolchain-omnibus-0.1.0 \ No newline at end of file diff --git a/anneal/v2/src/main.rs b/anneal/v2/src/main.rs new file mode 100644 index 0000000000..2f94d34eb1 --- /dev/null +++ b/anneal/v2/src/main.rs @@ -0,0 +1,49 @@ + + +/// Anneal: A Literate Verification Toolchain +#[derive(clap::Parser, Debug)] +#[command(name = "cargo-anneal", version, about, long_about = None)] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(clap::Subcommand, Debug)] +enum Commands { + /// Setup Anneal dependencies + Setup(SetupArgs), +} + +#[derive(clap::Args, Debug)] +#[group(multiple = false)] +struct SetupArgs { + /// Path to the toolchain archive + #[arg(long)] + archive: Option, + /// Path to the external toolchain directory + #[arg(long)] + dir: Option, + /// Pull toolchain archive from remote explicitly + #[arg(long)] + remote: bool, +} + +fn is_development_environment() -> bool { + std::env::var("__ZEROCOPY_LOCAL_DEV").is_ok() +} + +fn main() { + let mut args_iter = std::env::args_os().peekable(); + let bin_name = args_iter.next().unwrap_or_else(|| "cargo-anneal".into()); + // If we're being run as a cargo plugin, the second argument will be "anneal". + if args_iter.peek().is_some_and(|arg| arg == "anneal") { + args_iter.next(); + } + let args = Cli::parse_from(std::iter::once(bin_name).chain(args_iter)); + if is_development_environment() { + + } else { + + } + println!("Hello, world!"); +} diff --git a/anneal/v2/setup/Cargo.toml b/anneal/v2/toolchain-config/Cargo.toml similarity index 88% rename from anneal/v2/setup/Cargo.toml rename to anneal/v2/toolchain-config/Cargo.toml index c03681fe57..087279d396 100644 --- a/anneal/v2/setup/Cargo.toml +++ b/anneal/v2/toolchain-config/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "setup" +name = "toolchain-config" version = "0.1.0" edition = "2024" diff --git a/anneal/v2/setup/build.rs b/anneal/v2/toolchain-config/build.rs similarity index 100% rename from anneal/v2/setup/build.rs rename to anneal/v2/toolchain-config/build.rs diff --git a/anneal/v2/setup/src/lib.rs b/anneal/v2/toolchain-config/src/lib.rs similarity index 100% rename from anneal/v2/setup/src/lib.rs rename to anneal/v2/toolchain-config/src/lib.rs