Smaller, easier, more powerful, and more reliable than make. An implementation of djb's redo.

Overview

redo - a recursive build system

Smaller, easier, more powerful, and more reliable than make.

This is an implementation of Daniel J. Bernstein's redo build system. He never released his version, so other people have implemented different variants based on his published specification.

This version, sometimes called apenwarr/redo, is probably the most advanced one, including parallel builds, improved logging, extensive automated tests, and helpful debugging features.

To build and test redo, run:

	./do -j10 test

To install it, run something like this:

	DESTDIR= PREFIX=/usr/local ./do -j10 install

Comments
  • Add compatibility to Python 3 (and retain Python 2)

    Add compatibility to Python 3 (and retain Python 2)

    This PR tries to make redo also available for Python 3. I came across this as I make data analyses using redo and Python 3 and using two Pythons struck me as odd.

    I tested this version under Python 2.7 and Python 3.7 and all tests pass.

    opened by mlell 9
  • Avoid bashism >&file

    Avoid bashism >&file

    The >& form is only for file descriptors, passing a file name there is a bash extension.

    $ /bin/dash -c 'echo foo >&/dev/null'
    /bin/dash: 1: Syntax error: Bad fd number
    
    opened by tv42 8
  • Replaced all instances of 'python' with 'python2'

    Replaced all instances of 'python' with 'python2'

    On systems where 'python' refers to python3, redo failed to launch. All invocations of python have been made explicitly python2 invocations. All tests pass on an Arch Linux system as of this commit.

    opened by sudonym1 7
  • Add redo-static

    Add redo-static

    redo-static marks each argument as static (i.e an input sources), even if they were previously marked as generated.

    It's not exactly elegant, but I've encountered two cases where it seems necessary:

    1. foo.do generates foo, but then the build is restructured and foo becomes a source (non-generated) file. redo warns that you've modified a generated file.
    2. redo foo triggers default.do to build foo, but default.do doesn't know how to build foo (it's supposed to be a source file). This is probably a bug, discussed here: https://groups.google.com/forum/#!topic/redo-list/6_XvB6ZKlZ8
    opened by timbertson 3
  • GettingStarted.md: Add -E option to sudo to preserve environment

    GettingStarted.md: Add -E option to sudo to preserve environment

    Sudo does not always preserve the environment so when doing the install with sudo and a DESTDIR= it will not be set in the sudo session. This makes install fail. This can be fixed by adding the -E option to sudo.

    opened by BlameJohnny 2
  • Failing to restore SIGPIPE leads to surprising and dangerous behavior

    Failing to restore SIGPIPE leads to surprising and dangerous behavior

    Python chooses to ignore SIGPIPE, however most unix processes expect to terminate on the signal. Therefore failing to restore the default action results in surprising behavior. For example, we expect dd if=/dev/zero | head -c1 to return immediately. However, prior to this commit, that pipeline would hang forever. Insidious forms of data corruption or loss were also possible.

    See:

    http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html http://blog.nelhage.com/2010/02/a-very-subtle-bug/

    opened by traviscross 2
  • Performance improvement to state.files() on simple branch

    Performance improvement to state.files() on simple branch

    In a slightly-odd real-world case this sped up redo-targets by an order of magnitude (if you are curious it was a generated website with lots and lots of directories like 2001/11/05/title/index.html)

    opened by jasom 2
  • Suggestion: tidy up the project root by allowing .do files within do/ directories

    Suggestion: tidy up the project root by allowing .do files within do/ directories

    Hi,

    It could be just my eye, but I think a growing project using redo will soon have its root directory filled up with different .do files, when the number of different build targets grows. I spent a while studying the problem, and ended up in this suggestion where .do files are allowed to reside in a specific do/ directory on any level of .do file lookup.

    On the downside, the number of looked-up paths for a matching .do file doubles, but on the upside, there's now one separate place where you'll find all the build related stuff. I think it's for the better.

    But I'll leave it to you to decide.

    /Pyry Jahkola

    opened by pyrtsa 2
  • Avoid symlinking to /bin/true in minimal/do, which fails when /bin/true is busybox

    Avoid symlinking to /bin/true in minimal/do, which fails when /bin/true is busybox

    Installing redo on Alpine (which uses busybox for most everything incl /bin/true) yields an error,

    redo-always: applet not found
    

    because minimal/do symlinks /bin/true to redo-always, and /bin/true is in turn a link to busybox, which uses $0 to figure out what to do.

    This PR changes minimal/do, making it create a +x file containing just ":" instead of symlinking to /bin/true.

    opened by tonyg 1
  • Use os.path.realpath to allow symlinking from e.g. /opt/redo/bin into /usr/local/bin

    Use os.path.realpath to allow symlinking from e.g. /opt/redo/bin into /usr/local/bin

    Reproduction steps

    PREFIX=/opt/redo ./redo install
    ln -sf /opt/redo/bin/* /usr/local/bin/.
    

    Expected outcome

    Running redo should work

    Actual outcome

    Running redo complains about an unavailable module

    Remedy

    Set path by expanding symlinks to find the canonical path to the invoked executable.

    opened by tonyg 1
  • Fix simple branch

    Fix simple branch

    Hi,

    Attached two commits for the simple branch.

    The first one add a test for a problem I found when I had a target depending on two redo-stamp targets that were also marked with redo-always. Basically, the use case for this is:

    cflags.do:

    redo-always
    echo $CFLAGS >$3
    redo-stamp <$3
    

    config.do:

    redo-always
    echo $CONFIG >$3
    redo-stamp <$3
    

    compile.do

    redo-ifchange cflags config
    . ./cflags
    . ./config
    cc-$CONFIG $CFLAGS -o $3
    ...
    

    This was a very useful technique I found to be able to depend on environment variables.

    The problem was that compile.do was always rebuilt even if neither cflags or config changed. I should have fixed that.

    The other problem is that the test 130 failed because ls -l shown -rw-r--r--. instead of just -rw-r--r-- making the test fail. I don't know if the correction is ideal but it works on my computer. You might want to drop this find a workaround (such as tr -d .).

    Mildred

    opened by mildred 1
  • make install.do not try changing permissions of existing directories

    make install.do not try changing permissions of existing directories

    Except when necessary, I prefer not to install into /usr/local as root. My setup is as follows:

    $ ls -ld /usr/local/bin /usr/local/share/man/man1
    drwxrwsr-x 3 root staff 4096 Jun  8 11:29 /usr/local/bin
    drwxrwsr-x 2 root staff 4096 Oct 12  2021 /usr/local/share/man/man1
    

    Since I'm a member of the staff group it all works out. But running do on install.do failed with an error message:

    Installing to: /usr/local
    install: cannot change permissions of ‘/usr/local/share/man/man1’: Operation not permitted
    install: cannot change permissions of ‘/usr/local/bin’: Operation not permitted
    

    This change calls "$INSTALL" only when the directory to be installed isn't already there.

    opened by nrnrnr 0
  • minimal/do: allow for relative shebangs

    minimal/do: allow for relative shebangs

    The current version of do expects #! to be followed by a /. A variety of tested systems treat the first word which follows #! as a path (which could be absolute or relative). Additionally, #! can be followed by spaces before the first path character. This patch addresses this potential incompatibility as a side effect.

    An example usecase of relative paths in shebang in a redo based build system can be seen here:

    https://git.sr.ht/~tk/pack/commit/01438f00d44adf33f59da729b347eca60cb461a8

    This patch was tested to work in a variety of situations and systems.

    Possibly mandatory legalese: I disclaim any copyright to this patch thereby placing it in the public domain, in line with the public domain status of minimal/do.

    opened by EliteTK 1
  • FIX default.required.rc.od to save changes

    FIX default.required.rc.od to save changes

    The default.required.rc.od modifier seems to be broken in the current build. It does not allow variables which have been modified in targets using appendln or replaceln to actually propagate upward to the file which calls include mytarget.required.rc. I added an rc_save call after the successful evaluation of base target and it appears to work as expected now.

    opened by gotnone 0
  • Re-implement rc_splitwords to accommodate arbitrarily many words

    Re-implement rc_splitwords to accommodate arbitrarily many words

    Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash. Test patterns:

    rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j
    
    rc_splitwords $(seq 10000)
    rc_splitwords "$(seq 10000)"
    

    For the long sequence tests, performance was still a sub-second response with bash being considerably slower than the other shells.

    As a side note: I object to the suppression of empty arguments, as these might be valid input, but kept it for compatibility.

    opened by spacefrogg 1
Owner
Making WireGuard 2FA easy @Tailscale, and generally fighting off the demons of complexity.
null
Python package used on Hardfight projects to make building, testing and deploying easy.

Hardfight Devtools Build, test and deploy Hardfight projects easly ?? What is it Devtools is a Python tool to make building, testing and deploying int

Hardfight 1 Dec 5, 2021
🔨🐍Make-like build automation tool for Python projects with extensive DSL features.

Pyke (WIP, Beta Release) Make-like build automation tool for Python projects with extensive DSL features. Features: Users can specify tasks, subtasks,

Ire 17 Jul 5, 2022
A small clone of GNU Make based on file checksums

Pyke This weekend project is a small clone (most of the code is in a single file of just about 200LoC) of GNU Make with the twist that it rebuilds a t

Antonio De Lucreziis 3 Nov 24, 2021
PlatformIO is a professional collaborative platform for embedded development :alien: A place where Developers and Teams have true Freedom! No more vendor lock-in!

PlatformIO Quick Links: Web | PlatformIO IDE | Project Examples | Docs | Donate | Contact Us Social: LinkedIn | Twitter | Facebook | Community Forums

PlatformIO 6.5k Jan 8, 2023
Package, distribute, and update any app for Linux and IoT.

Snapcraft Package, distribute, and update any app for Linux and IoT. Snaps are containerised software packages that are simple to create and install.

null 1.1k Jan 2, 2023
Buildout is a deployment automation tool written in and extended with Python

Buildout Buildout is a project designed to solve 2 problems: Application-centric assembly and deployment Assembly runs the gamut from stitching togeth

buildout 552 Nov 26, 2022
Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

null 5 Jul 4, 2022
A project designed to make taking notes easier than ever - by doing it all on command line

A project designed to make taking notes easier than ever - by doing it all on command line! Yes, all of your files are easily accessible through one command interface, and can be written to at any time! #ad #sponsored

null 1 Dec 10, 2021
A smooth and powerful Telegram Userbot made to make Telegram easier.

| Xᴇɴᴏ Bᴏᴛ Is One Of The Fastest & Smoothest Bot On Telegram Based on Telethon|

SimpleBoy 1 Dec 1, 2021
Param: Make your Python code clearer and more reliable by declaring Parameters

Param Param is a library providing Parameters: Python attributes extended to have features such as type and range checking, dynamically generated valu

HoloViz 304 Jan 7, 2023
Much faster than SORT(Simple Online and Realtime Tracking), a little worse than SORT

QSORT QSORT(Quick + Simple Online and Realtime Tracking) is a simple online and realtime tracking algorithm for 2D multiple object tracking in video s

Yonghye Kwon 8 Jul 27, 2022
A library for python made by me,to make the use of MySQL easier and more pythonic

my_ezql A library for python made by me,to make the use of MySQL easier and more pythonic This library was made by Tony Hasson , a 25 year old student

null 3 Nov 19, 2021
This project aim to create multi-label classification annotation tool to boost annotation speed and make it more easier.

This project aim to create multi-label classification annotation tool to boost annotation speed and make it more easier.

null 4 Aug 2, 2022
Providing a working, flexible, easier and faster installer than the one officially provided by Arch Linux

Purpose The purpose is to bring more people to Arch Linux by providing a working, flexible, easier and faster installer than the one officially provid

André Luís 0 Nov 9, 2022
Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before.

Stopmagic gives you the power of creating amazing Stop Motion animations faster and easier than ever before. This project is maintained by Aldrin Mathew.

Aldrin's Art Factory 67 Dec 31, 2022
A simple script to make the operation of AltServer-Linux more easier with cli

A simple script to make the operation of AltServer-Linux more easier with cli

powen 23 Dec 13, 2022
Use PyTgCalls easier than before.

PyTgCalls wrapper Making it easier for you to use pytgcalls. Features No need to care about audio convertion. Play directly from URLs, YouTube and loc

Calls Music 12 Jul 21, 2022
This is a GUI for scrapping PDFs with the help of optical character recognition making easier than ever to scrape PDFs.

pdf-scraper-with-ocr With this tool I am aiming to facilitate the work of those who need to scrape PDFs either by hand or using tools that doesn't imp

Jacobo José Guijarro Villalba 75 Oct 21, 2022