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
feat(install): one git install command, with the studio behind a feature
`cargo install --git https://github.com/LeadcodeDev/rustmotion` did not work at
all before this: cargo refused it with "multiple packages with binaries found:
rustmotion, rustmotion-studio". That check is not about the workspace — cargo
searches the whole repository for any Cargo.toml and demands that exactly one
package declare a `[[bin]]`. Verified, not assumed: neither `default-members`
nor `required-features` changes the count.
So one package has to own both binaries, and it has to be `rustmotion`, because
`cargo install rustmotion` from crates.io must keep delivering a command. The
studio was a package that depended on `rustmotion` for `loader` and `encode`,
so making it a dependency of `rustmotion` was a cycle — which cargo refuses
even for an optional dependency.
It becomes a module instead: `crates/rustmotion/src/studio/`. With no second
package there is no cycle, and because `lib.rs` already declares
`extern crate self as rustmotion`, all of the studio's `rustmotion::loader::…`
paths stay valid verbatim. The only code change is requalifying its 82 internal
`crate::` paths to `crate::studio::`. The alternative — extracting `loader`,
`encode`, `include`, `assets` and the `engine` extensions into a third crate —
would have moved 14 900 lines and added two crates to the published set to
reach the same command.
cargo install --git <url> # CLI
cargo install --git <url> --features studio # CLI + studio
`studio` is out of the default build on purpose: it pulls gpui and a native GUI
toolchain, which do not build everywhere the CLI builds, a headless server
being the obvious case. Its seven dependencies are optional and the second
`[[bin]]` carries `required-features = ["studio"]`.
Two consequences worth naming.
CI: `--workspace` used to compile the studio because it was a member. Behind a
non-default feature it would not, so clippy and the tests would have stayed
green over 11 600 lines nobody checks any more. Both jobs now pass
`--features rustmotion/studio`. Test count is unchanged at 1701 with the
feature, 1510 without.
`serde_json/preserve_order` moves into the `studio` feature rather than the
default: the studio rewrites the user's scenario files and must not reorder
their keys. `validate --fix` would want the same thing, but turning it on by
default would change the key order of every file it rewrites, which is a
separate decision.
Either command installs the `rustmotion` CLI. Add the `studio` feature to get
24
+
the live preview window (`rustmotion-studio`) alongside it:
25
+
26
+
```bash
27
+
cargo install --git https://github.com/LeadcodeDev/rustmotion --features studio
28
+
```
29
+
30
+
The studio is not in the default build because it pulls gpui and a native GUI
31
+
toolchain, which do not build everywhere the CLI builds — a headless server
32
+
being the obvious case.
33
+
17
34
**Requirements:** Rust toolchain + C++ compiler (for openh264). **Recommended:**`ffmpeg` CLI for 10-bit H.264 and H.265/VP9/ProRes/WebM/GIF output.
18
35
19
36
### Shell Completions
@@ -2155,11 +2172,12 @@ crates/
2155
2172
│ └── *.rs # one file per component (Painter implementation)
2156
2173
└── rustmotion/src/
2157
2174
├── cli/ # the `rustmotion` binary (clap subcommands)
2175
+
├── studio/ # the `rustmotion-studio` binary (feature `studio`)
2158
2176
├── encode/ # video/audio encoders and muxing
2159
2177
└── loader.rs # JSON/HTML → ResolvedScenario
2160
2178
```
2161
2179
2162
-
The `rustmotion` crate is where the binary lives — a crate with only a `[lib]` target installs nothing executable via `cargo install`.
2180
+
The `rustmotion` crate is where both binaries live — a crate with only a `[lib]` target installs nothing executable via `cargo install`, and `cargo install --git <url>` refuses a repository in which more than one package declares a `[[bin]]`. That second constraint is why the studio is a module of this crate (`src/studio/`, behind the `studio` feature) rather than a package of its own.
0 commit comments