• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast, general purpose, graph based build and task execution utility.

Walk

Build Status Go Report Card Latest Version

walk is a fast, general purpose, graph based build and task execution utility.

Heavily inspired by make and redo.

Features

  • Fast parallel execution.
  • Graph based dependency management.
  • Maximum composability with existing UNIX tooling.
  • Describe targets and their dependencies as simple executables.
  • Universal execution; execute walk from any directory.

Installation

Using Go 1.7+:

$ go get -u github.com/ejholmes/walk

Or grab the latest release from https://github.com/ejholmes/walk/releases.

Usage

walk is built on top of a very simple concept; when you want to build a target, walk executes a file called Walkfile to determine:

  1. What other targets the given target depends on.
  2. How to build the target.

For example, if you wanted to build a program called prog from main.c and parse.c, you might write a Walkfile like this:

#!/bin/bash

# The first argument is the "phase", which will either be `deps` or `exec`. In
# the `deps` phase, the Walkfile should print the name of the targets that this
# target depends on.
phase=$1

# The second argument is the name of the target, like `prog`, `parse.o`, etc.
target=$2

case $target in
  prog)
    case $phase in
      # Prog depends on the object files we'll build from source. We simply
      # print each dependency on a single line.
      deps)
        echo main.o
        echo parse.o
        ;;
      exec) exec gcc -Wall -o $target $($0 deps $target) ;;
    esac ;;

  # A generic recipe for building a .o file from a corresponding .c file.
  *.o)
    case $phase in
      deps) echo ${target//.o/.c} ;;
      exec) exec gcc -Wall -o $target -c $($0 deps $target) ;;
    esac ;;

  # When invoking walk(1) without any arguments, it defaults to a target called
  # `all`.
  all)
    case $phase in
      deps) echo prog ;;
    esac ;;

  # In general, it's good practice to include a fallback rule like this, in
  # case someone tries to build a target that we don't know how to build (or
  # someone makes a typo).
  *.c|*.h) ;; # static files
  *) >&2 echo "No rule for target \"$target\"" && exit 1 ;;
esac

When you execute walk all, the following happens internally:

  1. walk resolves all of the dependencies, and builds a graph:

    $ Walkfile deps all
    prog
    $ Walkfile deps prog
    parse.o
    main.o
    $ Walkfile deps parse.o
    parse.c
    $ Walkfile deps main.o
    main.c
    $ Walkfile deps parse.c
    $ Walkfile deps main.c
  2. walk executes all of the targets, starting with dependencies:

    $ Walkfile exec parse.c
    $ Walkfile exec main.c
    $ Walkfile exec main.o
    $ Walkfile exec parse.o
    $ Walkfile exec prog
    $ Walkfile exec all

Ultimately, all of our targets end up getting invoked, and prog is built:

$ walk
ok	main.c
ok	parse.c
ok	parse.o
ok	main.o
ok	prog
ok	all

We can print the dependency graph to verify that our dependency chain is what we expect:

$ walk -p dot
digraph {
  "(root)" -> "all"
  "all" -> "prog"
  "prog" -> "main.o"
  "prog" -> "parse.o"
  "parse.o" -> "parse.c"
  "main.o" -> "main.c"
}

And that's it. Wait, that's it? That's it. walk is quite simply, just syntactic sugar over executing a binary as a graph.

See also man walk.

More Repositories

1

vagrant-heroku

A Vagrant base box that closely mirrors the Celadon Cedar stack on heroku
Shell
244
star
2

active_admin_editor

Rich text editor for Active Admin using wysihtml5.
Ruby
184
star
3

metaforce

A ruby client for interacting with the Salesforce Metadata and Services API's.
Ruby
66
star
4

cloudwatch

Treat cloudwatch log streams as io.Reader and io.Writers.
Go
32
star
5

animate.scss

animate.css for the rails asset pipeline.
Ruby
29
star
6

chip8

CHIP-8 emulator in Go
Go
27
star
7

vim-forcedotcom

Force.com syntax highlighting in vim.
Vim Script
22
star
8

uTorrent-Notifier

An application that runs in the system tray and notifies you when a download finishes
C#
17
star
9

exsidekiq

Sidekiq client for Elixir.
Elixir
14
star
10

elusive-iconfont-sass-rails

Elusive Iconfont for Rails 3.1+ asset pipeline.
Ruby
10
star
11

openssag

Mac/Linux driver for the Orion StarShoot Autoguider
C++
10
star
12

slash

A framework for Slack slash commands with Go
Go
9
star
13

Arduino-Focuser

Project for the Arduino Focuser
C#
9
star
14

Arduino-Telescope--ASCOM-Driver-

ASCOM Driver for the Arduino Telescope
C#
8
star
15

heroku-buildpack-bower

Heroku buildpack to run bower.
8
star
16

octopart

Ruby gem for the Octopart API v2.
Ruby
8
star
17

mockjax

Define ajax stubs in your request specs.
JavaScript
8
star
18

hookshot

A Go http router that de-multiplexes and authorizes GitHub Webhooks.
Go
8
star
19

empire-demo

Ruby
7
star
20

darkmatter

YAML Front Matter for Rails
Ruby
6
star
21

metaforce-demo

Demo of how to use Metaforce and Rake for Force.com migrations.
Ruby
5
star
22

coreos-graphite

A set of unit files for running graphite under cores.
5
star
23

Arduino.NET-DLL

COM library for using the Arduino.NET library for simple serial communication
C#
4
star
24

dotfiles

My dotfiles
Vim Script
3
star
25

12factor

Run 12factor applications
Go
3
star
26

dressing

A Capybara driver for Sauce Labs.
Ruby
3
star
27

Arduino.NET

This is an Arduino library for a flexible serial protocol.
C++
3
star
28

plextrics

Metrics from heroku logs
Ruby
3
star
29

sinatra-template

Sinatra template app with sprockets support and RSpec/Capybara.
Ruby
2
star
30

Synodic-Solutions-Code-Scraps

Ahhh, the good old days.
PHP
2
star
31

forem-active-admin-test

Testing forem with acive admin
Ruby
2
star
32

buble

Go
2
star
33

restangular-collections

Collections for restangular
JavaScript
2
star
34

metaforce-delivery_method

Delivery method for sending emails from Ruby using Salesforce
Ruby
2
star
35

Arduino-Focuser--ASCOM-Driver-

ASCOM Driver for the Arduino Focuser
C#
2
star
36

sigp

Debug unix signals
Go
2
star
37

flock

Go sync.Locker backed by flock(2)
Go
2
star
38

swarm-ecs

Generate a text file from ECS container hosts for Docker Swarm
Go
1
star
39

openfocus-updater

C++
1
star
40

rabbitmq-clusterctl

A Go command for common operations tasks in HA rabbitmq.
Go
1
star
41

openfocus

An open source implementation of a motorized telescope focuser
C#
1
star
42

raggity

Raggity is a locally hosted sinatra application for serving and browsing git repositories.
Ruby
1
star
43

rally

An API for tying cloud services together
Ruby
1
star
44

docker-collectd

Docker container for running collectd configured via confd + etcd.
Shell
1
star
45

octopart-js

JavaScript library for the Octopart API.
Ruby
1
star
46

ejholmes.github.io

My blog.
CSS
1
star
47

Arduino-Dome--ASCOM-Driver-

Arduino dome ASCOM driver
C#
1
star
48

robut-shipr

A Robut plugin for shipr
Ruby
1
star
49

shipit

Continuous delivery made easy(er)
Ruby
1
star
50

jwplayer-ember-conflicts

JavaScript playlists don't work with jwplayer when emberjs is loaded.
1
star
51

dbdc

A Ruby gem for the Force.com REST API. Coming soon...
Ruby
1
star
52

docker-carbon

Docker container for running carbon.
Shell
1
star
53

exercism.io

Exercism.io solutions with elixir
Elixir
1
star
54

utorrent-notifier-daemon

Linux daemon for sending notifications when events happen in utorrent.
C
1
star
55

vpce-nlb-alb

Experiments with issues using VPCe/NLB/ALB together
HCL
1
star
56

pgstream

Log streaming library for Go
Go
1
star
57

Arduino-Telescope--Embedded-

Arduino telescope embedded software
C++
1
star
58

libopenfocus

C/C++ library for OpenFocus
C++
1
star
59

inspector

Inspect http requests
Go
1
star
60

Arduino-Dome--Embedded-

Arduino dome embedded software
C++
1
star
61

asset-sync-sinatra

Super small sinatra app that utilizes the asset_sync gem to sync assets to S3.
Ruby
1
star
62

nginx

Nginx for Empire
HTML
1
star
63

Arduino-Focuser--Embedded-

Arduino focuser firmware
C++
1
star
64

heroku-buildpack-sshkey

A heroku buildpack for using an ssh key for pulling in private GitHub dependencies.
Shell
1
star
65

databasedotlocal

A Rack application to mock the Database.com/Salesforce.com REST API.
Ruby
1
star