A suggestion @f0rodo mentioned is being able to split rune run out of the rune CLI to simplify the process of installing from source.
One possible way we could implement this is by creating multiple sub-commands, taking inspiration from how Cargo does custom subcommands.
rune - a top-level binary which takes rune foo some-args and calls the rune-foo program with some-args as its arguments
rune-run - execute a Rune
rune-build - compile a Runefile into a Rune
rune-graph - take a Runefile and turn it into a DOT graph that can be visualised
...
We can then use the required-features field in Cargo.toml to make sure a particular subcommand is only installed when running cargo install with the corresponding feature flag.
For example:
# crates/rune-cli/Cargo.toml
[package]
name = "hotg-rune-cli"
[[bin]]
name = "rune"
path = "src/bin/rune.rs"
[[bin]]
name = "rune-run"
path = "src/bin/rune-run.rs"
required-features = ["run"]
[[bin]]
name = "rune-build"
path = "src/bin/rune-build.rs"
required-features = ["build"]
...
[features]
default = ["run", "build", "..."]
# Subcommands
run = []
build = []
# Normal feature flags for altering behaviour
wasmer-runtime = ["wasmer", "run"]
wasm3-runtime = ["wasm3", "run"]
That way you can run cargo install hotg-rune-cli to get rune run and rune build, or you could choose to just get rune build by using cargo install hotg-rune-cli --no-default-features --features build.
A suggestion @f0rodo mentioned is being able to split
rune run
out of therune
CLI to simplify the process of installing from source.One possible way we could implement this is by creating multiple sub-commands, taking inspiration from how Cargo does custom subcommands.
rune
- a top-level binary which takesrune foo some-args
and calls therune-foo
program withsome-args
as its argumentsrune-run
- execute a Runerune-build
- compile a Runefile into a Runerune-graph
- take a Runefile and turn it into a DOT graph that can be visualisedWe can then use the
required-features
field inCargo.toml
to make sure a particular subcommand is only installed when runningcargo install
with the corresponding feature flag.For example:
That way you can run
cargo install hotg-rune-cli
to getrune run
andrune build
, or you could choose to just getrune build
by usingcargo install hotg-rune-cli --no-default-features --features build
.