Commit graph

20 commits

Author SHA1 Message Date
Avery Pennarun
2eb9e91c7c .gitignore and clean.do: add minimal/.do* 2018-11-16 00:32:07 -05:00
Avery Pennarun
2023d36676 minimal/do: didn't work correctly with multi-level auto dir creation.
If we tried to build target a/b/c/d and a/b/c didn't exist yet, we
would correctly name the temp file something like a__b/c__d.tmp.  But
if a/b didn't exist yet, we named the temp file a/b__c/d.tmp, which
didn't work.  Instead, name it a/b__c__d.tmp as expected.
2018-11-02 04:27:28 -04:00
Avery Pennarun
2efbbc26b9 Don't crash on targets in directories that don't exist yet.
The reason we'd crash is that we tried to pre-create a file called
$target.redo.tmp, which wouldn't work because the directory containing
$target didn't exist.

We now try to generate a smarter filename by using the innermost directory
of target that *does* exist.  It's a little messy, but the idea is to make
sure we won't have to rename() across a filesystem boundary if, for example,
there's a mounted filesystem in the middle of the hierarchy somewhere.
2011-03-22 23:00:34 -07:00
Avery Pennarun
94b34ea031 Generate redo version codes in Documentation/*.1 automatically.
We have to go through some pretty scary gyrations to extract this
information from git, but it can be done.  This works with both tarballs
generated by 'git archive', or with your local git repo.

(Requested by 'David' on the mailing list.)
2011-01-17 23:01:40 -08:00
Avery Pennarun
fb5275938d minimal/do: use ".did" stamp files instead of empty target files.
If all.do runs and creates no output, we shouldn't create a file called
'all', but we should remember that 'all' has been run successfully.  We do
this by creating 'all.did' during the build.

Since minimal/do always just wipes everything out every time it runs, we can
safely remove the .did files after minimal/do terminates, so this doesn't
clutter things too much in normal use.

This fixes some edge cases, particularly that 'minimal/do clean' no longer
leaves stupid files named "clean" lying around, and the redo-sh directory
can now be rebuilt correctly since we rebuild it as long as redo-sh.did
doesn't exist.  (We don't want to "rm -rf redo-sh" because it makes me
nervous.)
2011-01-01 04:11:20 -08:00
Avery Pennarun
fb388b3dde Automatically select a good shell instead of relying on /bin/sh.
This includes a fairly detailed test of various known shell bugs from the
autoconf docs.

The idea here is that if redo works on your system, you should be able to
rely on a *good* shell to run your .do files; you shouldn't have to work
around zillions of bugs like autoconf does.
2010-12-21 04:44:39 -08:00
junkblocker
bab7b40a49 Don't rely on GNU find behaviour in clean.do. 2010-12-17 11:40:42 -08:00
Avery Pennarun
6e5ec95c6a Add an 'install' target.
(usable as 'make install' or 'redo install', of course)
2010-12-12 02:48:42 -08:00
Avery Pennarun
4b48448233 Add a bunch of manpages. 2010-12-12 02:12:21 -08:00
Avery Pennarun
80fedc84fe minimal/do: make redo-ifchange (etc) into subprograms in a temp dir.
Using aliases for them was cute, but it didn't work with things like:

	find -name '*.c' | xargs redo-ifchange

since xargs doesn't know about aliases.
2010-12-11 21:47:55 -08:00
Avery Pennarun
49f0a041b2 clean.do: cleanup *.tmp files that might have been left lying around.
...and fix a bug where builder.py can't handle it if its temp file is
deleted out from under it.
2010-12-11 21:10:57 -08:00
Avery Pennarun
b9987433c9 Disable the tests that don't work with minimal/do.
...only when running under minimal/do, of course.

The tests in question mostly fail because they're testing particular
dependency-related behaviour, and minimal/do doesn't support dependencies,
so naturally it doesn't work.
2010-12-11 21:06:12 -08:00
Avery Pennarun
362ca2997a A whole bunch of cleanups to state.Lock.
Now t/curse passes again when parallelized (except for the countall
mismatch, since we haven't fixed the source of that problem yet).  At least
it's consistent now.

There's a bunch of stuff rearranged in here, but the actual important
problem was that we were doing unlink() on the lock fifo even if ENXIO,
which meant a reader could connect in between ENXIO and unlink(), and thus
never get notified of the disconnection.  This would cause the build to
randomly freeze.
2010-11-19 06:07:41 -08:00
Avery Pennarun
c1f09f564b Support for default.*.do rules.
I *think* this was the last missing part from djb's spec.  Certainly it's an
important one for any real project.
2010-11-16 03:04:11 -08:00
Avery Pennarun
4243f31e1b Add minimal/do, a stripped-down redo implementation in 977 bytes of sh.
This could be good for distributing with your packages, so that people who
don't have redo installed can at least build it.  Also, we could use it for
building redo itself.

Will surely need to get slightly bigger as I inevitably discover I've
forgotten a critical feature.
2010-11-16 00:27:52 -08:00
Avery Pennarun
2e71e20ce2 When auto-choosing a .redo dir, prefer ones uphill that already exist.
So if we're in redo/t/ and running 'redo hello', we'll detect redo/.redo and
use that one rather than creating a new redo/t/.redo directory.

The downside of this is we get slightly different behaviour if the *first*
thing you build isn't from the root.  Probably that's bad, but it should
hopefully be rare.
2010-11-12 23:23:06 -08:00
Avery Pennarun
f43187b73a 'make clean' can now safely remove .redo dirs. 2010-11-12 22:50:23 -08:00
Avery Pennarun
3c2fc49c63 Complicate the test build a bit to show unnecessary dependency re-checking.
'./redo -d test' reveals that we check and re-check things like CC and LD
even when they're children of objects that don't need to be rebuilt, and who
we've already checked earlier in the build cycle.  We need to be a little
smarter about pruning if we want dependency checking to be fast.
2010-11-12 22:15:34 -08:00
Avery Pennarun
07d3e3b13c Extremely basic integration of wvtest for testing.
And move test scripts into t/ subdir to keep things clean.

As part of that, make sure redo adds itself to the PATH on startup so that
subscripts can find it.
2010-11-12 17:19:42 -08:00
Avery Pennarun
a51764c907 Extremely basic first crack at implementing djb's redo.
And a test program.
2010-11-12 05:25:03 -08:00