a freeform Rust build system

Overview

tinyrick: a freeform Rust build system

       .---.              ^
     o{__ω__ o{          ^0^  -Let me out!
~~ ( // *|* \xx\)      xx`|'
        = =  xxxx&x      ' `

EXAMPLE

$ cd example

$ tinyrick
running 1 test
test smoketest ... ok

$ tinyrick -h
Usage: tinyrick [options]

Options:
    -l, --list          list available tasks
    -h, --help          print usage info
    -v, --version       print version info

ABOUT

I'm tinyrick (TINYRICK!) and I build Rust projects. With tinyrick, you configure your build in the same normal Rust code as the rest of your project. Or keep picking your nose with make, it's up to you.

Look at my pants! tinyrick! You think my pants are one size fits all? No, of course not! So get the pants that fit you. Get a tinyrick.rs that fits your workflow. Task dependency trees, get em while they're hot! Segfaults, get em while they're not. Smarter, butter, faster, stranger.

Don't shell out, lib out. Your build is more portable that way. tinyricktinyricktinyrick. If you look closely, that last period is actually a micro rick rendered in ASCII; even tinier tinyrick!

CRATE

https://crates.io/crates/tinyrick

API DOCUMENTATION

https://docs.rs/tinyrick/

RUNTIME REQUIREMENTS

SETUP

tinyrick.rs

Write some tasks in a tinyrick.rs build configuration script at the top-level directory of your Rust project:

fn banner() {
    println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
}

fn test() {
    tinyrick::exec!("cargo", &["test"]);
}

fn build() {
    tinyrick::deps(test);
    tinyrick::exec!("cargo", &["build", "--release"]);
}

fn publish() {
    tinyrick::exec!("cargo", &["publish"]);
}

fn clean() {
    tinyrick::exec!("cargo", &["clean"]);
}

fn main() {
    tinyrick::phony!(clean);
    tinyrick::wubba_lubba_dub_dub!(build; banner, test, publish, clean);
}

Cargo.toml

Now, wire up the tinyrick command line interface by configuring your top-level Cargo.toml:

[package]
name = "derpmobile"
description = "hyperadvanced derpmobiles"
version = "3.1.4"

[dependencies]
tinyrick = { version = "0.0.10", optional = true }

[features]
letmeout = ["tinyrick"]

[[bin]]
name = "tinyrick"
path = "tinyrick.rs"
required-features = ["letmeout"]

Launch a terminal session in your project directory. Install and run the tinyrick tool:

$ cargo install tinyrick
$ tinyrick

Watch how he behaves... I hope tinyrick is practicing good manners :P

What happens when you run:

  • tinyrick banner?
  • tinyrick test?
  • tinyrick clean?
  • tinyrick build?
  • tinyrick -h?
  • tinyrick --list?
  • VERBOSE=1 tinyrick build?

I bet the freakin' moon explodes if you run VERBOSE=1 tinyrick build build build! (Hold onto your pants~)

DEBRIEFING

Where are my pants? Let's break down the code so far:

  • fn name() { ... } declares a task named name.
  • deps(requirement) caches a dependency on task requirement.
  • exec!(...) spawns raw shell command processes.
  • VERBOSE=1 enables command string emission during processing.
  • phony!(...) disables dependency caching for some tasks.
  • wubba_lubba_dub_dub!(default; ...) exposes a default task and some other tasks to the tinyrick command line.
  • letmeout is a feature gate, so that neither the tinyrick package, nor your tinyrick binary escape with your Rust package when you tinyrick publish.

DoN't UsE sHelL cOmMaNdS!1

Just because the tinyrick library offers several supremely convenient macros for executing shell commands doesn't mean that you should always shell out. No way, man!

Whenever possible, use regular Rust code, as in the banner() example. There's like a ba-jillion crates of prewritten Rust code, so you might as well use it!

CONTRIBUTING

For more details on developing tinyrick itself, see DEVELOPMENT.md.

SEE ALSO

  • Inspired by the excellent mage build system for Go projects
  • GNU make, a classic task runner
  • cmake for C/C++ projects
  • dale offers similar task runner features for D projects
  • vast for UNIX shell script projects

EVEN MORE EXAMPLES

  • The included example project provides a fully qualified demonstration of how to build projects with tinyrick.
  • For a more practical example, see ios7crypt-rs, a little modulino library + command line tool for deliciously dumb password encryption.
  • tinyrick_extras defines some common workflow tasks as plain old Rust functions, that you can sprinkle onto your tinyrick just like any other Rust crate.
Comments
  • Express some dependencies in terms of directories and other files

    Express some dependencies in terms of directories and other files

    As a developer, I want my builds to run faster, by skipping unnecessary rebuilds when enough of the file artifacts are already up to date.

    • [ ] Expand the dependency notation, giving programmers a make-like way to declare dependencies on files.
    • [x] File dependencies can be placed on raw files.
    • [ ] File dependencies can be placed on directories.
    • [ ] File dependencies can be placed on symbolic links.
    • [ ] Tasks can declare that they emit / are responsible for, generating named file/directory patterns.
    • [ ] Include conventional file and recursive directory glob patterns out of the box, so that tinyrick maintains a high level of cross-platform, cross-shell interpreter support.
    • [ ] Query Cargo TOML configurations to automatically identify file dependencies.
    opened by mcandre 1
  • Help developers easily port Rust applications

    Help developers easily port Rust applications

    Experiment with Cargo.toml configurations for generating ports, in a way that works from any environment, to any environment. Build configurations that work only when running from specific host OS's are no bueno.

    (Preferably without using tonixxx, Vagrant, or any VM's/containers.)

    opened by mcandre 1
  • Git Flow

    Git Flow

    Move development work into develop branch, so that master doesn't have to use the version = "*", path = ".." crap in the example project.

    opened by mcandre 0
  • Expand testing

    Expand testing

    Rewrite my github.com/mcandre/* project Rust builds in terms of tinyrick, in order to test the limits of what kinds of workflows tinyrick actually supports reasonably flexibly.

    • [x] rustcheck (deprecated)
    • [x] bronze
    • [x] ios7crypt-rs
    • [x] dumbpointers
    • [x] comments/rust
    • [x] scriptname/rust
    • [x] modulinos/rust
    • [x] parhello/rust
    • [x] version/rust
    • [x] forkbombs/rust
    • [x] toys/rust
    opened by mcandre 0
  • clean tasks

    clean tasks

    • [-] clean_cargo_lock (For some reason, the Cargo.lock file appears to be immutable until the cargo cleans parent process terminates.)
    • [x] clean_cargo
    • [x] clean

    Pending #11

    opened by mcandre 0
  • show commands and simplify command error handling

    show commands and simplify command error handling

    • [x] unwrap() process::Command's rather than obfuscate any error messages.
    • [x] accept a VERBOSE environment variable to enable printing the commands being executed.
    opened by mcandre 0
  • Consider changing the name (again)

    Consider changing the name (again)

    Experiment with changing the main binary name from cargo[-]tinyrick to tinyrick, and having the per-project build configurations change from tinyrick.rs to rick[.rs].

    This would mainly satisfy my need for tab completion without depending on cargo completions scripts. We'd still be a cargo wrapper, just no longer a cargo "plugin" at that point.

    opened by mcandre 0
  • Publish

    Publish

    • [x] cargo publish
    • [x] Temporarily drop the custom dependency path from example/Cargo.toml to express more clearly how to use tinyrick in the user's projects.
    opened by mcandre 0
  • Add option to run in workspace, add workspace tests

    Add option to run in workspace, add workspace tests

    Notes

    • Added functionality to run in workspace packages, in root workspace directory and in workspace members as well
    • Added workspace example and tests in the build script
    • Ran cargo fmt
    opened by x0f5c3 0
  • Drop redundant tasks

    Drop redundant tasks

    Use a proper tree data structure to prune redundant tasks.

    For example, when task build depends on test and users invoke tinyrick build test, then the code inside of test should only be executed once.

    opened by mcandre 0
  • Soft assertions

    Soft assertions

    Allow tasks to declare that the rest of a build should continue, such as applying more linters, so that the full report is visible, while still presenting an accurate overall exit status code based on any failing tasks.

    opened by mcandre 0
  • Fix clean task

    Fix clean task

    Use decorators to implement customizable clean tasks, to resolve the problem where clean wipes out tinyrick sandbox and breaks the rest of the command line execution.

    opened by mcandre 0
  • Simplify macros with Kleene operator

    Simplify macros with Kleene operator

    Reduce the code involved in the shell-related macros by using the new Kleene operator.

    https://github.com/rust-lang/rust/issues/48075

    Note: This requires updating Rust to v1.32.0+.

    opened by mcandre 0
Releases(v0.0.9)
  • v0.0.9(Nov 1, 2018)

    Changes:

    • Offer convenience function for querying host's preferred binary suffix (cygwin, WLS, etc. are right out).
    • Update documentation

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.9.zip(2.75 MB)
  • v0.0.8(Oct 31, 2018)

    Changes:

    • Standardize build configuration filename to tinyrick.rs
    • Offer -h/--help, -v/--version, and -l/--list tasks command line flags
    • Update walkthrough

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.8.zip(2.75 MB)
  • v0.0.7(Oct 28, 2018)

    Changes:

    • wubba_lubba_dub_dub! now runs inside your main(), where you can declare any additional static initializers.
    • dep() caches dependent task runs, instead of running them every time.
    • phony!() disables caching for the given tasks.
    • Added more examples to the README

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.7.zip(2.69 MB)
  • v0.0.6(Oct 27, 2018)

    Changes:

    • API distinguishes between commands expected to succeed, vs. commands whose exit statuses are queriable
    • Clarify install behavior in example project
    • Add .gitignore to example project

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.6.zip(2.69 MB)
  • v0.0.5(Oct 27, 2018)

    Changes:

    • Fixed command execution when no arguments are supplied
    • Expand tests
    • Fix internal build

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.5.zip(2.69 MB)
  • v0.0.4(Oct 27, 2018)

    Changes:

    • Namespaced macros, curtesy of Rust 1.30
    • tinyrick's own development build system shifted from make to sh to work around an issue with ulimits.
    • Shaggier shaggy dog README with more semi-lucid drooling

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.4.zip(2.69 MB)
  • v0.0.3(Oct 24, 2018)

  • v0.0.2(Oct 21, 2018)

    • Set package, binary, lib name to tinyrick and per-project build configuration to rick[.rs], paving the way for extra-cargo operations.
    • Added shell! macros for convenient command line calls
    • Added more tasks to example project
    • Began removing some boilerplate from rick files
    • Shifted tinyrick's own build setup a tiny bit more portable

    Release archive includes binaries for a variety of x86_64 Linux systems. Other major OS's such as macOS and Windows can compile binaries from source.

    Source code(tar.gz)
    Source code(zip)
    tinyrick-0.0.2.zip(1.97 MB)
  • v0.0.1(Oct 21, 2018)

Owner
Andrew
Just run BOINC. https://boinc.bakerlab.org/
Andrew
Powerful database anonymizer with flexible rules. Written in Rust.

[Data]nymizer Powerful database anonymizer with flexible rules. Written in Rust. Datanymizer is created & supported by Evrone. What else we develop wi

[Data]nymizer 381 Dec 26, 2022
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

⚡️ Lightning-fast linter for .env files. Written in Rust ?? Dotenv-linter can check / fix / compare .env files for problems that may cause the applica

null 1.5k Jan 9, 2023
Rust Code Completion utility

Racer - code completion for Rust RACER = Rust Auto-Complete-er. A utility intended to provide Rust code completion for editors and IDEs. Maybe one day

null 3.4k Jan 4, 2023
Format Rust code

rustfmt Quick start On the Stable toolchain On the Nightly toolchain Installing from source Usage Running cargo fmt Running rustfmt directly Verifying

The Rust Programming Language 4.8k Jan 7, 2023
The Rust toolchain installer

rustup: the Rust toolchain installer Master CI Build Status Windows macOS Linux Etc rustup installs The Rust Programming Language from the official re

The Rust Programming Language 5.1k Jan 8, 2023
Repository for the Rust Language Server (aka RLS)

Rust Language Server (RLS) The RLS provides a server that runs in the background, providing IDEs, editors, and other tools with information about Rust

The Rust Programming Language 3.6k Jan 7, 2023
🦀 The ultimate search extension for Rust

Rust Search Extension 简体中文 The ultimate search extension for Rust Search docs, crates, builtin attributes, official books, and error codes, etc in you

Huhu 962 Dec 30, 2022
The Curly programming language (now in Rust!)

Curly Curly is a functional programming language that focuses on iterators. Some of its main implementation features include sum types, iterators, lis

Curly Language 30 Jan 6, 2023
Some WIP payload in Rust running on M1.

m1saka Some WIP payload in Rust running on M1. Project informations The aim of this payload is to provide exploration capabilities while providing a s

Mary 10 Mar 7, 2021
A library to compile USDT probes into a Rust library

sonde sonde is a library to compile USDT probes into a Rust library, and to generate a friendly Rust idiomatic API around it. Userland Statically Defi

Wasmer 39 Oct 12, 2022
⚙️ Workshop Publishing Utility for Garry's Mod, written in Rust & Svelte and powered by Tauri

⚙️ gmpublisher Currently in Beta development. A powerful and feature-packed Workshop publisher for Garry's Mod is finally here! Click for downloads Ar

William 484 Jan 7, 2023
compile rust code into memes

cargo-memex Besides their size, rust binaries have a significant disadvantage: rust binaries are not memes yet. cargo-memex is a cargo subcommand that

Matthias Seitz 243 Dec 11, 2022
A neofetch alike program that shows hardware and distro information written in rust.

nyafetch A neofetch alike program that shows hardware and distro information written in rust. installing install $ make install # by default, install

null 16 Dec 15, 2022
Automated license checking for rust. cargo lichking is a Cargo subcommand that checks licensing information for dependencies.

cargo-lichking Automated license checking for rust. cargo lichking is a Cargo subcommand that checks licensing information for dependencies. Liches ar

Nemo157 120 Dec 19, 2022
Create target folder as a RAMdisk for faster Rust compilation.

cargo-ramdisk This crate is only supported for unix like systems! cargo-ramdisk creates a ramdisk at the target folder of your project for ridiculousl

PauMAVA 20 Jan 8, 2023
cargo extension that can generate BitBake recipes utilizing the classes from meta-rust

cargo-bitbake cargo bitbake is a Cargo subcommand that generates a BitBake recipe that uses meta-rust to build a Cargo based project for Yocto Install

null 60 Oct 28, 2022
A small utility to compare Rust micro-benchmarks.

cargo benchcmp A small utility for comparing micro-benchmarks produced by cargo bench. The utility takes as input two sets of micro-benchmarks (one "o

Andrew Gallant 304 Dec 27, 2022
"goto" implementation for Rust

Goto/Label for Rust Tired of using newfangled control flow mechnisms like "loop," "while," and "for"? Well worry no more! Finally, "goto" and "label"

Dagan Martinez 92 Nov 9, 2022
Fegeya Elitebuild, small, powerful build system. Written in Rust.

Fegeya Elitebuild Small, powerful, work-in-progress build system. Written in Rust. Features: No functions (all are built-ins) All variables are global

Ferhat Geçdoğan 25 Nov 9, 2022
Dione is an anonymize and encrypted messaging system build on top on a peer to peer layer.

Secure and Anonymous Messaging WARNING: Currently Dione is not ready to be used nor does it fulfill its goal of being an anonymous messenger. In order

Dione 41 Jan 5, 2023