You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
magic_wormhole (provides the wormhole CLI tool, so cargo install magic-wormhole; wormhole send works, just like python's pip(si) install magic-wormhole; wormhole send)
But.. now I'm reading about the [features] property in Cargo.toml, and maybe we should use those instead?
core feature gets you the sans-io library
io-tokio gets you the IO layer that presents a Tokio-friendly API
cli gets you the command-line tool
and then we could make all three be the default (so cargo install magic-wormhole gets you a functional CLI). Applications that don't want the CLI (but use Tokio) could use feature=[core, io-tokio] (or however they spell it). And if they want a different IO library, then [core, io-threads] or whatever could work.
We'd have just the one repository, and just the one published crate.
I haven't used these "features" much.. does that seem reasonable?
The text was updated successfully, but these errors were encountered:
Yes this sounds reasonable. Most of the Rust packages uses features where there will be a default feature which is like these are sane defaults and there will be additional features which gives additional stuff. So from your explanation above it feels like core should be default feature and io-tokio is feature when user opts in for tokio dependency.
I'm not fully familiar with wormhole so not sure which should be default feature. i.e core or cli or both core and cli.
Ok, based on your comments and those of some other rust folks, I'm gonna aim for this:
one crate, named magic-wormhole
cargo install magic-wormhole gets you bin/wormhole (Cargo.toml will have a [[bin]] name = "wormhole" with path = "src/bin/main.rs")
there are two features, named io-blocking and io-tokio, both on by default
apps probably want to add a dependency like magic-wormhole = { version = "0.1", default-features = false, features = ["io-tokio"] }
but if they forget, things will still work, they'll just get some spurious dependencies
I still want to see if cargo install magic-wormhole picks up the non-required IO layers, or if the required-features in our Cargo.toml is enough to avoid those.
I've been thinking we should publish a couple of different crates:
wormhole
CLI tool, socargo install magic-wormhole; wormhole send
works, just like python'spip(si) install magic-wormhole; wormhole send
)But.. now I'm reading about the
[features]
property in Cargo.toml, and maybe we should use those instead?core
feature gets you the sans-io libraryio-tokio
gets you the IO layer that presents a Tokio-friendly APIcli
gets you the command-line tooland then we could make all three be the default (so
cargo install magic-wormhole
gets you a functional CLI). Applications that don't want the CLI (but use Tokio) could use feature=[core, io-tokio]
(or however they spell it). And if they want a different IO library, then[core, io-threads]
or whatever could work.We'd have just the one repository, and just the one published crate.
I haven't used these "features" much.. does that seem reasonable?
The text was updated successfully, but these errors were encountered: