goals.git
4 years agoVersion '0.2'. v'0.2'
Richard W.M. Jones [Sat, 18 Jan 2020 15:32:13 +0000 (15:32 +0000)]
Version '0.2'.

4 years agobuild: Reorder .gitignore
Richard W.M. Jones [Sat, 18 Jan 2020 15:31:40 +0000 (15:31 +0000)]
build: Reorder .gitignore

4 years agomaintainer: Add maintainer-commit, maintainer-tag goals.
Richard W.M. Jones [Sat, 18 Jan 2020 15:06:42 +0000 (15:06 +0000)]
maintainer: Add maintainer-commit, maintainer-tag goals.

4 years agobuild: %package and %version instead of using autoconf @PACKAGE_...@
Richard W.M. Jones [Sat, 18 Jan 2020 15:09:38 +0000 (15:09 +0000)]
build: %package and %version instead of using autoconf @PACKAGE_...@

4 years agomaintainer: Build Fedora package in copr.
Richard W.M. Jones [Sat, 18 Jan 2020 14:53:14 +0000 (14:53 +0000)]
maintainer: Build Fedora package in copr.

4 years agobuild: dist should have %tarfile as target.
Richard W.M. Jones [Sat, 18 Jan 2020 15:23:45 +0000 (15:23 +0000)]
build: dist should have %tarfile as target.

4 years agostdlib: Add fedora.gl.
Richard W.M. Jones [Sat, 18 Jan 2020 13:12:06 +0000 (13:12 +0000)]
stdlib: Add fedora.gl.

4 years agobuild: Add distcheck, maintainer-check-extra-dist and maintainer-release.
Richard W.M. Jones [Mon, 13 Jan 2020 12:40:51 +0000 (12:40 +0000)]
build: Add distcheck, maintainer-check-extra-dist and maintainer-release.

4 years agodocs: Build plain text version of documentation.
Richard W.M. Jones [Mon, 13 Jan 2020 12:51:21 +0000 (12:51 +0000)]
docs: Build plain text version of documentation.

Would build HTML version, but pod2html looks terrible.

4 years agobuild: Distribute src/.depend with tarball.
Richard W.M. Jones [Mon, 13 Jan 2020 12:06:26 +0000 (12:06 +0000)]
build: Distribute src/.depend with tarball.

4 years agobuild: Implement make dist rule.
Richard W.M. Jones [Sun, 12 Jan 2020 22:56:39 +0000 (22:56 +0000)]
build: Implement make dist rule.

4 years agobuild: Implement install rule.
Richard W.M. Jones [Sun, 12 Jan 2020 22:46:24 +0000 (22:46 +0000)]
build: Implement install rule.

4 years agoUpdate TODO.
Richard W.M. Jones [Sun, 12 Jan 2020 22:04:35 +0000 (22:04 +0000)]
Update TODO.

4 years agostdlib: Change print colour functions so they are atomic.
Richard W.M. Jones [Sun, 12 Jan 2020 22:00:58 +0000 (22:00 +0000)]
stdlib: Change print colour functions so they are atomic.

4 years agostdlib: Disable echo on split command.
Richard W.M. Jones [Sun, 12 Jan 2020 21:51:21 +0000 (21:51 +0000)]
stdlib: Disable echo on split command.

Fixes commit 17dc1d6e0ec8f194df3dd74a7033303ad9ff739c.

4 years agoIgnore local* files.
Richard W.M. Jones [Sun, 12 Jan 2020 21:44:24 +0000 (21:44 +0000)]
Ignore local* files.

Allows you to have ./localconfigure and/or ./localmake files to add
local parameters to configure or make.

4 years agostdlib: Implement split() function.
Richard W.M. Jones [Sun, 12 Jan 2020 21:18:36 +0000 (21:18 +0000)]
stdlib: Implement split() function.

4 years agoUpdate TODO.
Richard W.M. Jones [Sun, 12 Jan 2020 21:09:03 +0000 (21:09 +0000)]
Update TODO.

We have now implemented most relevant make functions.

4 years agostdlib: Implement last() and nth() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 21:07:57 +0000 (21:07 +0000)]
stdlib: Implement last() and nth() functions.

4 years agostdlib: Implement filter() and filter-out() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:48:29 +0000 (20:48 +0000)]
stdlib: Implement filter() and filter-out() functions.

4 years agostdlib: Protect some functions using "--".
Richard W.M. Jones [Sun, 12 Jan 2020 20:56:59 +0000 (20:56 +0000)]
stdlib: Protect some functions using "--".

If a parameter begins with a "-" character then it can be
misinterpreted as a shell command parameter.  Protect against this
using "--" in various places.

4 years agoUpdate TOOD.
Richard W.M. Jones [Sun, 12 Jan 2020 20:41:01 +0000 (20:41 +0000)]
Update TOOD.

4 years agotests: Don't suppress stderr in some tests.
Richard W.M. Jones [Sun, 12 Jan 2020 20:40:23 +0000 (20:40 +0000)]
tests: Don't suppress stderr in some tests.

Not necessary since we implemented PASS/FAIL in
commit 490d147a899cb682af67bc5bc3eb64a9ad00985e.

4 years agostdlib: Implement error() function.
Richard W.M. Jones [Sun, 12 Jan 2020 20:38:51 +0000 (20:38 +0000)]
stdlib: Implement error() function.

Currently not very useful because we lack conditionals, but
it could be useful if those were implemented.

4 years agostdlib: Implement read() and readlines() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:30:40 +0000 (20:30 +0000)]
stdlib: Implement read() and readlines() functions.

4 years agostdlib: Implement head() and tail() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:22:26 +0000 (20:22 +0000)]
stdlib: Implement head() and tail() functions.

4 years agostdlib: Implement realpath() function.
Richard W.M. Jones [Sun, 12 Jan 2020 20:02:57 +0000 (20:02 +0000)]
stdlib: Implement realpath() function.

4 years agostdlib: Implement join() function.
Richard W.M. Jones [Sun, 12 Jan 2020 19:56:36 +0000 (19:56 +0000)]
stdlib: Implement join() function.

4 years agostdlib: Implement dirname(), basename() and extension() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 19:51:56 +0000 (19:51 +0000)]
stdlib: Implement dirname(), basename() and extension() functions.

4 years agodocs: Document functions sort, wildcard and wrap.
Richard W.M. Jones [Sun, 12 Jan 2020 19:34:39 +0000 (19:34 +0000)]
docs: Document functions sort, wildcard and wrap.

4 years agostdlib: Implement subst function.
Richard W.M. Jones [Sun, 12 Jan 2020 19:11:04 +0000 (19:11 +0000)]
stdlib: Implement subst function.

4 years agodocs: Remove separate goals-reference manual.
Richard W.M. Jones [Sun, 12 Jan 2020 19:15:42 +0000 (19:15 +0000)]
docs: Remove separate goals-reference manual.

Goalfile(5) will contain both a tutorial and reference.

4 years agoeval: Remove a single trailing \n from "returning string" functions.
Richard W.M. Jones [Sun, 12 Jan 2020 19:13:09 +0000 (19:13 +0000)]
eval: Remove a single trailing \n from "returning string" functions.

4 years agotests: Add test of the wildcard function.
Richard W.M. Jones [Sun, 12 Jan 2020 18:50:38 +0000 (18:50 +0000)]
tests: Add test of the wildcard function.

4 years agocmdline: Implement -s (--silent or --quiet) option.
Richard W.M. Jones [Sun, 12 Jan 2020 18:42:47 +0000 (18:42 +0000)]
cmdline: Implement -s (--silent or --quiet) option.

4 years agotests: Add test of the sort function.
Richard W.M. Jones [Sun, 12 Jan 2020 18:36:50 +0000 (18:36 +0000)]
tests: Add test of the sort function.

4 years agobuild: Run make clean in parallel.
Richard W.M. Jones [Sun, 12 Jan 2020 18:01:41 +0000 (18:01 +0000)]
build: Run make clean in parallel.

4 years agoutils: Implement -j properly.
Richard W.M. Jones [Sun, 12 Jan 2020 17:54:08 +0000 (17:54 +0000)]
utils: Implement -j properly.

It now picks the default value from the number of cores.

4 years agotests: Add a basic test of dependencies.
Richard W.M. Jones [Sun, 12 Jan 2020 17:27:03 +0000 (17:27 +0000)]
tests: Add a basic test of dependencies.

4 years agotests: Consistency.
Richard W.M. Jones [Sun, 12 Jan 2020 17:26:39 +0000 (17:26 +0000)]
tests: Consistency.

Put the comment in the goalfile, and make sure the shell script
is using set -e if appropriate.

4 years agobuild: Hide make passthrough command.
Richard W.M. Jones [Sat, 11 Jan 2020 20:31:10 +0000 (20:31 +0000)]
build: Hide make passthrough command.

4 years agoparser: Fix longstanding bug where "()" was required after CLI targets.
Richard W.M. Jones [Sat, 11 Jan 2020 20:28:44 +0000 (20:28 +0000)]
parser: Fix longstanding bug where "()" was required after CLI targets.

4 years agotests: More basic tests.
Richard W.M. Jones [Sat, 11 Jan 2020 11:57:08 +0000 (11:57 +0000)]
tests: More basic tests.

4 years agotests: Print PASS/FAIL for each test.
Richard W.M. Jones [Sat, 11 Jan 2020 20:07:47 +0000 (20:07 +0000)]
tests: Print PASS/FAIL for each test.

Simple test harness.

4 years agorun: Improve consistency of error messages.
Richard W.M. Jones [Fri, 10 Jan 2020 19:43:17 +0000 (19:43 +0000)]
run: Improve consistency of error messages.

Make sure we always print the line number and the full name + params
of any goal or tactic which fails.

4 years agojobs: Wait for completion even in the error case.
Richard W.M. Jones [Fri, 10 Jan 2020 19:38:43 +0000 (19:38 +0000)]
jobs: Wait for completion even in the error case.

Previously if we hit an error (last_exn being set) then we exited the
loop immediately and re-raised the exception.  However this means jobs
which are still running would continue to run after goals exited.
Move the wait code outside the loop to ensure we always wait for jobs
to complete even in the error case.

4 years agotests: Add basic tests.
Richard W.M. Jones [Fri, 10 Jan 2020 08:31:06 +0000 (08:31 +0000)]
tests: Add basic tests.

Use 'make check' to run them.

4 years agoparser: Allow an empty goal statement with no targets, deps or code.
Richard W.M. Jones [Fri, 10 Jan 2020 12:30:51 +0000 (12:30 +0000)]
parser: Allow an empty goal statement with no targets, deps or code.

This allows you to write "do nothing" goals like:

  goal all ;

4 years agobuild: Add 'make maintainer-clean' passthrough rule.
Richard W.M. Jones [Fri, 10 Jan 2020 12:16:53 +0000 (12:16 +0000)]
build: Add 'make maintainer-clean' passthrough rule.

4 years agostdlib: Add wrap function.
Richard W.M. Jones [Fri, 10 Jan 2020 12:15:41 +0000 (12:15 +0000)]
stdlib: Add wrap function.

4 years agostdlib: Don't add \n after quoted_string.
Richard W.M. Jones [Fri, 10 Jan 2020 12:15:23 +0000 (12:15 +0000)]
stdlib: Don't add \n after quoted_string.

4 years agorun: Add %goals_final_check variable when evaluating tactics.
Richard W.M. Jones [Fri, 10 Jan 2020 08:42:41 +0000 (08:42 +0000)]
run: Add %goals_final_check variable when evaluating tactics.

This is true ("1") if this is the final check that the goal evaluation
was successful.  It allows tactics to behave differently when
evaluating if we need a rebuild vs checking that the rebuild was
successful.

4 years agoSplit implementation into dependency analysis and traversal.
Richard W.M. Jones [Thu, 9 Jan 2020 18:11:42 +0000 (18:11 +0000)]
Split implementation into dependency analysis and traversal.

4 years agoutils: Add unique () function.
Richard W.M. Jones [Thu, 9 Jan 2020 18:11:26 +0000 (18:11 +0000)]
utils: Add unique () function.

4 years agojobs: Don't let Failure exception escape from worker.
Richard W.M. Jones [Thu, 9 Jan 2020 11:53:54 +0000 (11:53 +0000)]
jobs: Don't let Failure exception escape from worker.

Also stop the wait () function if the stop flag is set so we don't
wait forever for jobs which are never going to be run.

4 years agocmdline: Make sure all errors go through main () function.
Richard W.M. Jones [Thu, 9 Jan 2020 11:50:27 +0000 (11:50 +0000)]
cmdline: Make sure all errors go through main () function.

4 years agojobs: Introduce stop_all function to stop job submission on error.
Richard W.M. Jones [Thu, 9 Jan 2020 11:49:50 +0000 (11:49 +0000)]
jobs: Introduce stop_all function to stop job submission on error.

4 years agoUpdate TODO.
Richard W.M. Jones [Wed, 8 Jan 2020 22:06:29 +0000 (22:06 +0000)]
Update TODO.

4 years agobuild: Create man/ subdirectory before building man pages.
Richard W.M. Jones [Wed, 8 Jan 2020 21:57:33 +0000 (21:57 +0000)]
build: Create man/ subdirectory before building man pages.

4 years agoImplement parallel jobs (-j option).
Richard W.M. Jones [Wed, 8 Jan 2020 11:43:26 +0000 (11:43 +0000)]
Implement parallel jobs (-j option).

4 years agobuild: Remove man/*.? man pages when running 'make clean'.
Richard W.M. Jones [Wed, 8 Jan 2020 16:18:38 +0000 (16:18 +0000)]
build: Remove man/*.? man pages when running 'make clean'.

Fixes commit abfde4ea239de6b9458243a862d5da0302a241a4.

4 years agodocs: Add empty Goalfile(5) and goals-reference(5).
Richard W.M. Jones [Tue, 7 Jan 2020 20:42:53 +0000 (20:42 +0000)]
docs: Add empty Goalfile(5) and goals-reference(5).

4 years agodocs: Write man pages to man/ subdirectory.
Richard W.M. Jones [Tue, 7 Jan 2020 20:39:55 +0000 (20:39 +0000)]
docs: Write man pages to man/ subdirectory.

Allows us to test multi-parameter goals.

4 years agodocs: Expand the basic man page.
Richard W.M. Jones [Tue, 7 Jan 2020 20:36:56 +0000 (20:36 +0000)]
docs: Expand the basic man page.

4 years agodocs: Use pod2man -u option.
Richard W.M. Jones [Tue, 7 Jan 2020 20:36:20 +0000 (20:36 +0000)]
docs: Use pod2man -u option.

4 years agocmdline: Don't convert Goalfile, includes to absolute paths.
Richard W.M. Jones [Tue, 7 Jan 2020 18:24:19 +0000 (18:24 +0000)]
cmdline: Don't convert Goalfile, includes to absolute paths.

We actually want these to be relative to the -C directory,
same as make.

4 years agoAdd documentation subdirectory.
Richard W.M. Jones [Tue, 7 Jan 2020 17:10:20 +0000 (17:10 +0000)]
Add documentation subdirectory.

4 years agoIn debug mode (-d) print all shell scripts executed.
Richard W.M. Jones [Tue, 7 Jan 2020 17:10:05 +0000 (17:10 +0000)]
In debug mode (-d) print all shell scripts executed.

4 years agoAdd README file for the project.
Richard W.M. Jones [Tue, 7 Jan 2020 15:56:09 +0000 (15:56 +0000)]
Add README file for the project.

4 years agoUpdate TODO.
Richard W.M. Jones [Tue, 7 Jan 2020 15:30:53 +0000 (15:30 +0000)]
Update TODO.

4 years agoeval: Split running external code according to return type.
Richard W.M. Jones [Tue, 7 Jan 2020 13:31:46 +0000 (13:31 +0000)]
eval: Split running external code according to return type.

Previously we were wrongly hiding stdout in some cases.

Fixes commit a48b05d35f0646322e8178ff10f8ed7af3e739aa
and commit 2ac1b84cb49ad04e27b4543436b0227153fbfb15.

4 years agoImplement pure functions.
Richard W.M. Jones [Tue, 7 Jan 2020 08:57:58 +0000 (08:57 +0000)]
Implement pure functions.

4 years agolexer: Use @{...} for quiet code sections.
Richard W.M. Jones [Mon, 6 Jan 2020 21:38:07 +0000 (21:38 +0000)]
lexer: Use @{...} for quiet code sections.

4 years agoparser: Fix parsing of patterns containing explicit tactic names.
Richard W.M. Jones [Mon, 6 Jan 2020 20:54:09 +0000 (20:54 +0000)]
parser: Fix parsing of patterns containing explicit tactic names.

4 years agoparser: Fix tracking of beginning of line for error messages.
Richard W.M. Jones [Mon, 6 Jan 2020 20:51:39 +0000 (20:51 +0000)]
parser: Fix tracking of beginning of line for error messages.

4 years agoCopy system environment into initial env, and also add %stdlib.
Richard W.M. Jones [Mon, 6 Jan 2020 12:53:15 +0000 (12:53 +0000)]
Copy system environment into initial env, and also add %stdlib.

4 years agoAllow functions "returning strings" (etc), redefine sort function.
Richard W.M. Jones [Mon, 6 Jan 2020 09:51:15 +0000 (09:51 +0000)]
Allow functions "returning strings" (etc), redefine sort function.

4 years agoStandardize running code in a single function, include prelude.sh.
Richard W.M. Jones [Sun, 5 Jan 2020 21:23:59 +0000 (21:23 +0000)]
Standardize running code in a single function, include prelude.sh.

4 years agoUpdate TODO
Richard W.M. Jones [Sun, 5 Jan 2020 21:09:45 +0000 (21:09 +0000)]
Update TODO

4 years agoFunctions return expressions instead of only lists of strings.
Richard W.M. Jones [Sun, 5 Jan 2020 13:10:43 +0000 (13:10 +0000)]
Functions return expressions instead of only lists of strings.

4 years agobuild: Create dependencies for Goalfile itself.
Richard W.M. Jones [Sat, 4 Jan 2020 12:02:24 +0000 (12:02 +0000)]
build: Create dependencies for Goalfile itself.

4 years agostdlib: Implement sort function.
Richard W.M. Jones [Sat, 4 Jan 2020 11:56:00 +0000 (11:56 +0000)]
stdlib: Implement sort function.

4 years agoUpdate TODO.
Richard W.M. Jones [Sat, 4 Jan 2020 11:48:22 +0000 (11:48 +0000)]
Update TODO.

4 years agobuild: Generate complete OCaml dependencies.
Richard W.M. Jones [Sat, 4 Jan 2020 09:49:21 +0000 (09:49 +0000)]
build: Generate complete OCaml dependencies.

Because we didn't use -I src on the ocamldep command line, ocamldep
didn't generate the complete set of dependencies.

4 years agoAst: Standard location for ocamldoc comments.
Richard W.M. Jones [Sat, 4 Jan 2020 09:41:52 +0000 (09:41 +0000)]
Ast: Standard location for ocamldoc comments.

4 years agostdlib: Implement wildcard function.
Richard W.M. Jones [Fri, 3 Jan 2020 21:45:34 +0000 (21:45 +0000)]
stdlib: Implement wildcard function.

4 years agoImplement functions.
Richard W.M. Jones [Fri, 3 Jan 2020 21:33:48 +0000 (21:33 +0000)]
Implement functions.

4 years agoAst: Remove functions which were moved to Eval module.
Richard W.M. Jones [Fri, 3 Jan 2020 21:10:16 +0000 (21:10 +0000)]
Ast: Remove functions which were moved to Eval module.

Updates commit f36210fd16a8e4e4d6ecdd8825bf8b8307943472.

4 years agobuild: Add depend goal and 'make depend'.
Richard W.M. Jones [Fri, 3 Jan 2020 19:26:13 +0000 (19:26 +0000)]
build: Add depend goal and 'make depend'.

4 years agobuild: Don't always pass -d to goals.
Richard W.M. Jones [Fri, 3 Jan 2020 19:24:24 +0000 (19:24 +0000)]
build: Don't always pass -d to goals.

We can enable debugging on a case-by-case basis when necessary.

4 years agobuild: Fix construction of parser.mli
Richard W.M. Jones [Fri, 3 Jan 2020 19:23:50 +0000 (19:23 +0000)]
build: Fix construction of parser.mli

4 years agobuild: Fix ocamldep invocation.
Richard W.M. Jones [Fri, 3 Jan 2020 19:19:01 +0000 (19:19 +0000)]
build: Fix ocamldep invocation.

4 years agobuild: Fix 'goals clean' rule.
Richard W.M. Jones [Fri, 3 Jan 2020 19:18:48 +0000 (19:18 +0000)]
build: Fix 'goals clean' rule.

4 years agostdlib: Fix *file tactic.
Richard W.M. Jones [Fri, 3 Jan 2020 19:07:11 +0000 (19:07 +0000)]
stdlib: Fix *file tactic.

Broken test if there is more than one dependency.

4 years agorun: Fix whitespace.
Richard W.M. Jones [Fri, 3 Jan 2020 19:07:07 +0000 (19:07 +0000)]
run: Fix whitespace.

4 years agorun: Better debugging and error messages for goals and tactics.
Richard W.M. Jones [Fri, 3 Jan 2020 18:49:31 +0000 (18:49 +0000)]
run: Better debugging and error messages for goals and tactics.

4 years agorun: If multiple goals match a tactic, at most one must have a CODE section.
Richard W.M. Jones [Fri, 3 Jan 2020 15:09:28 +0000 (15:09 +0000)]
run: If multiple goals match a tactic, at most one must have a CODE section.

This now works the same way as make.

4 years agoDon't default to echoing tactic command.
Richard W.M. Jones [Fri, 3 Jan 2020 15:12:02 +0000 (15:12 +0000)]
Don't default to echoing tactic command.

4 years agoUpdate TODO
Richard W.M. Jones [Fri, 3 Jan 2020 11:24:24 +0000 (11:24 +0000)]
Update TODO

4 years agoIn dependency file, use ; between statements.
Richard W.M. Jones [Fri, 3 Jan 2020 14:50:55 +0000 (14:50 +0000)]
In dependency file, use ; between statements.

So this parses correctly.