Skip to content

package rlibs in several containing frontends

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

MaulingMonkey/cargo-container

cargo-container

Wrap vanilla cargo rlibs/packages in generated "containers" for various ends.

GitHub crates.io License Build Status Build Status

Quickstart

  • Clone this repository
  • Open in VS Code
  • Install extensions recommended by workspace
  • Hit F5

This will build and run one of the example projects of example/multiplatform in Chrome

Basic Guide

  • cargo install cargo-container
  • Author a Container.toml workspace instead of a regular Cargo.toml workspace
    • Write a [workspace] like you would in Cargo.toml, with members (and optionally exclude)
    • Define one or more [[build]] sections defining what crates to wrap with what tools
    • Optional: specify more crates to auto-install via [local-install]
  • Author the crates to wrap in said boilerplate
  • Run cargo container build. This will:
    • Install any bin dependencies specified by [local-install]
    • Run tools to generate Cargo.toml projects
    • Generate a Cargo.toml alongside Container.toml that references the generated dependencies
    • Runs tools to build generated Cargo.toml projects
  • Profit!

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Alternatives

Why not vanilla cargo / build.rs / metabuild scripts ?

  • Cargo is intentionally not trying to support everything to keep things simple/sane. Understandable, but crippling.
  • Dependency builds are isolated even when you have use cases for them modifying the final output.
  • No support for additional build rules after invoking rustc.

There's already a slew of nonstandard build tools for various specialized needs as a result:

These are generally non-composable, incoherent, require extra setup steps to install, etc.

Why not cargo run tools -- [...] / .cargo/config aliases?

This is pretty neato.

I want something more zero-config/automatic/declarative for early projects though. Kind of a metabuild equivalent. I will steal as much inspiration from this as I can.

Why not cargo make ?

It seems pretty great, but has a few drawbacks:

  • It's unopinionated and lacks standardization - projects will be inconsistent
  • Bring your own build rules
  • No sane defaults for way too many project types
  • Little-to-no support for creating reusable standard rules, unless you count hardcoding wget s into your own makefiles - which I don't.

Why not [non rust toolchain] ?

  • Packaging build rules in crates sounds neato.
  • Auto-adding build rules based on dependencies sounds neato.

About

package rlibs in several containing frontends

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published