Giter Club home page Giter Club logo

redo's Introduction

redo - An implementation of djb's redo

Installation

Like any self-respecting compiler is written in the language it compiles, redo is used to build itself. This is done using a simplistic POSIX Shell implementation of redo located in the bootstrap/ directory. You might want to edit the file config.sh to suite your needs.

$ bootstrap/redo clean install

Dependencies

Changes to djb's original design

The "_" wildcard

djb intended the string "default" to be used as a wildcard string, e.g. "default.o.do" when looking for dofiles. This implementation uses both "default" and "_" (preferring the latter), e.g. "_.o.do"

Dependencies

djb mentions three different kinds of dependencies: source-, target- and absent-files. This implementation additionally uses "virtual" in its prereqs to indicate targets that do not produce output.

credits

djb

for his original design notes

similar work

Avery Pennarun's implementation of redo in Python

https://github.com/apenwarr/redo

Chris Forno's implementation of redo in Haskell

https://github.com/jekor/redo

Jonathan de Boyne Pollard's implementation of redo in C++

https://jdebp.eu/Softwares/redo/

redo's People

Contributors

drwilly avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

redo's Issues

target in subdirectory always out of date

Maybe I'm using this thing wrong, but I don't think I am. The below behavior feels wrong. Just because 1 is no longer in my $PWD it's being considered out of date by redo.

$ mkdir demo && cd demo

$ echo 'set -x && echo 1' > 1.do

$ chmod 755 1.do

$ redo-ifchange 1
redo    1.do:1  ...
+ echo 1

$ redo-ifchange 1

$ redo-ifchange 1

$ cd ..

$ redo-ifchange demo/1
redo    1.do:demo/1     ...
+ echo 1

$ redo-ifchange demo/1
redo    1.do:demo/1     ...
+ echo 1

$ redo-ifchange demo/1
redo    1.do:demo/1     ...
+ echo 1

compile error using skalibs master

I think this shows everything you'd need to reproduce the issue:

[Tue 07-25 11:53:55AM]$ ./bootstrap/redo clean install
redo	clean.do:clean	...
redo	install.do:install	...
redo	install.do:install	redo.do:redo	...
redo	install.do:install	redo.do:redo	ld.do:ld	...
redo	install.do:install	redo.do:redo	_.o.do:checksum.o	...
redo	install.do:install	redo.do:redo	_.o.do:checksum.o	cc.do:cc	...
redo	install.do:install	redo.do:redo	_.o.do:environment.o	...
redo	install.do:install	redo.do:redo	_.o.do:options.o	...
redo	install.do:install	redo.do:redo	_.o.do:path.o	...
redo	install.do:install	redo.do:redo	_.o.do:prereqs.o	...
redo	install.do:install	redo.do:redo	_.o.do:reporting.o	...
redo	install.do:install	redo.do:redo	_.o.do:stralloc_string.o	...
redo	install.do:install	redo.do:redo	_.o.do:redo.o	...
src/redo.c:194:21: error: invalid operands to binary expression ('void' and 'int')
        if(fd_close(outfd) == -1) {
           ~~~~~~~~~~~~~~~ ^  ~~
src/redo.c:204:20: error: invalid operands to binary expression ('void' and 'int')
        if(fd_close(dbfd) == -1) {
           ~~~~~~~~~~~~~~ ^  ~~
2 errors generated.
redo	install.do:install	redo.do:redo	_.o.do:redo.o	_.o.do returned 1
redo	install.do:install	redo.do:redo	redo.do returned 1
redo	install.do:install	install.do returned 1

[Tue 07-25 11:54:10AM]$ clang --version
clang version 4.0.0-1ubuntu1 (tags/RELEASE_400/rc1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

[Tue 07-25 11:54:15AM]$ git log -1
commit c78df25809bab3c66a95b761a8adfb1d42978145 (HEAD -> master, origin/master, origin/HEAD)
Author: Wilke Schwiedop <[email protected]>
Date:   Mon Apr 17 10:50:08 2017 +0200

    adjustments for skalibs 2.5.0.0

[Tue 07-25 11:57:19AM]$ ls ~/prefices/credo/lib/
libskarnet.so  libskarnet.so.2.5  libskarnet.so.2.5.1  libskarnet.so.2.5.1.1  skalibs

proposal: redo-watch

One feature of "modern" build systems is the ability to watch for changes in source files, then automatically invoke the build system in response. This is generally done via inotify, at the cost of making it linux-specific.

How do you feel about this feature? Would it fit better in this repo, or a fork, or as some kind of credo extension? Do you care about macos/windows support?

A bit of research on how this might be implemented in a skalibs-based project:

  • skarnet only has one example of anything similar, and it's linux-only and filed into a "*-linux" package.
  • I was unable to find a C library that abstracts the problem of watching files across operating systems. The closest thing was libfswatch, but it still had lots of caveats.

better defaults in config.sh ?

You might use some/all of these as default values in your config.sh:

--- config.sh
+++ config.sh
@@ -1,7 +1,7 @@
-PREFIX="$HOME"
+PREFIX="$HOME/prefix/credo"
 
 CC="clang"
 CFLAGS="-g -O0 -Wall -pedantic"
 
-INC=""
-LIBPATH=""
+INC="-I$PREFIX/include"
+LIBPATH="-L$PREFIX/lib -Wl,-rpath=\\\$ORIGIN/../lib"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.