Next: , Previous: , Up: goredo   [Index]


There are three basic main commands, originally suggested by DJB in his articles:


Forcefully and sequentially build specified targets. This is the main command you will explicitly use from the command line. If no targets are given, then all target will be used by default.


Rebuild specified targets if they are out-of-date and record them as a dependency for the currently run target. This is the main command you will use in .do files.


Record the non-existent file dependency for the currently run target. Target will be rebuilt if any of the given files appear. Can be used only inside .do file.

Pay attention that redo-ifchange enables parallel builds of the given targets, but ordinary redo is not: it builds specified targets sequentially and stops when error happens.

-x option can be used to enable tracing (set -x) of the currently run shell script .do file. -xx option enables tracing for all invoked .do files further.

With -j option you can enable parallel builds, probably with an infinite number of workers (=0). Also you can set $REDO_JOBS to automatically apply that setting globally.

Read about log storage capabilities.

-log-pid ($REDO_LOG_PID=1) can be used to prefix job’s stderr with the PID, that could be useful during parallel builds. -d ($REDO_DEBUG=1) enables debug messages.

-no-progress ($REDO_NO_PROGRESS=1) and -no-status ($REDO_NO_STATUS=1) disable statusline and progress display. $NO_COLOR=1 disables progress/debug messages colouring.

By default all build commands use fsync to assure data is reached the disk. You can disable its usage with $REDO_NO_SYNC=1 environment variable, for speeding up the build process.

If redo sees some target modified externally, then by default it warns user about that, does not build that target, but continues the build process further. That is convenient in most cases: you can build your project with manual targets alterings, without touching possibly more complicated .do files. With $REDO_STOP_IF_MODIFIED=1 redo won’t continue and will exit with failure message.

There are other commands that could be found in other implementations too:


Record current target as an always-do dependency. By definition it should be always build. goredo tries to build it once per run.


Record "stamp" dependency. It reads stdin and stores its hash in the dependency database. It is not used anyhow, it is dummy. Read about stamping in the FAQ. It is left only for compatibility with some other implementations.

redo-targets, redo-ood

Show all known targets, possibly limited by specified directories. redo-ood shows only the out-of-date ones.


Recursively show all source files the given targets depend on.


It is not in other distributions, but it is some kind of opposite of redo-sources – shows the targets that will be affected by specified files change.

And there are some maintenance and debug commands:


Removes either temporary (tmp), log files (log), lock files (lock), or everything related to goredo (full).


Display .do search paths for specified target (similar to apenwarr/redo):

$ redo-whichdo x/y/a.b.o

Dependency DOT graph generator. For example to visualize your dependencies with GraphViz:

$ redo target [...] # to assure that **/.redo/*.dep are filled up
$ redo-dot target [...] >
$ dot -Tpng > whatever.png # possibly add -Gsplines=ortho

When you copy your worktree to different place, then copied files ctime will change. And because recorded dependency information differs from updated ctimes, out-of-date algorithm will fallback to rereading the whole files for hash calculation, that is much slower. If you do not want to rebuild your targets from the ground, then redo-depfix can traverse through all dependency files and recalculate dependency information.

Also if it finds legacy .rec dependency files, it converts them to binary format.


Convert specified .dep file to recfile on stdout. Aimed to be used mainly for debugging purposes.

Next: Out-of-date determination, Previous: Usage rules, Up: goredo   [Index]