Richard W.M. Jones [Tue, 12 Dec 2023 18:29:14 +0000 (18:29 +0000)]
stdlib/fedora: Check result from koji latest-build to avoid infinite loop
If 'koji latest-build' command fails then we could end up in an
infinite loop because 'koji wait-repo ... --build=' gives an error.
Richard W.M. Jones [Tue, 24 Jan 2023 15:59:33 +0000 (15:59 +0000)]
stdlib/fedora.gl: Add new %fedora-retry-failed flag
Richard W.M. Jones [Tue, 24 Jan 2023 15:36:33 +0000 (15:36 +0000)]
stdlib: Fix detection of already build package when rpmautospec
Fixes: commit
dc1c16833922b20e6949058a3813a595bb89194b
Richard W.M. Jones [Tue, 24 Jan 2023 13:45:56 +0000 (13:45 +0000)]
Support rpmautospec / %autochangelog
Richard W.M. Jones [Tue, 24 Jan 2023 13:05:02 +0000 (13:05 +0000)]
stdlib/fedora.gl: Quote parameters of 'test' command
Richard W.M. Jones [Fri, 4 Feb 2022 11:09:18 +0000 (11:09 +0000)]
deps: Try to print the dependency cycle in error message
Instead of:
*** error: function:wrap:6:0: adding fedora-rebuild ("ocaml-odoc") creates a dependency cycle
it now prints:
*** error: function:wrap:4:0: dependency cycle: fedora-rebuild ("ocaml-odoc") -> fedora-rebuild ("ocaml-mdx") -> fedora-rebuild ("ocaml-odoc-parser") -> fedora-rebuild ("ocaml-ppx-expect") -> fedora-rebuild ("ocaml-ppx-inline-test") -> fedora-rebuild ("ocaml-time-now") -> fedora-rebuild ("ocaml-ppx-base") -> fedora-rebuild ("ocaml-ppx-js-style") -> fedora-rebuild ("ocaml-octavius") -> fedora-rebuild ("ocaml-odoc")
Richard W.M. Jones [Fri, 4 Feb 2022 11:36:47 +0000 (11:36 +0000)]
Use old code-generator for menhir
The new code generator breaks include statements.
Richard W.M. Jones [Tue, 5 Oct 2021 12:12:28 +0000 (13:12 +0100)]
stdlib/fedora.gl: Try to cache dependencies
For the large number of OCaml packages (~ 200) it takes a very long
time to recompute the list of dependencies. The real reason for this
is that we calculate the bin2src hash table over and over again for
each dependency. Each time it takes about 6 seconds.
Try one approach to caching this.
This does improve performance quite a lot, at the minor annoyance of
leaving ".depcache" files in the Fedora directory.
A future approach might consider allowing bin2src to be created once
when goals starts up and then making it available to all shell script
snippets. I'm not sure how to implement that.
Another possible approach in future would be to internalize the
(key, value) cache implied here. This would let us cache the result
of earlier runs so no recomputation would be needed.
Richard W.M. Jones [Tue, 5 Oct 2021 11:35:54 +0000 (12:35 +0100)]
configure: Fix checking of missing programs
Richard W.M. Jones [Tue, 5 Oct 2021 11:04:06 +0000 (12:04 +0100)]
configure: Use longer, non-deprecated form for OCaml warnings flags
In OCaml 4.13:
Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters,
like 'CDEFLMPSUVYZX', is deprecated.
Use the equivalent signed form: +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3.
Richard W.M. Jones [Mon, 1 Mar 2021 19:49:07 +0000 (19:49 +0000)]
Try a simpler algorithm for detecting cycles.
Fixes: commit
5f25b73757c74fde044315e9b82aa70da8fcfbc0
Richard W.M. Jones [Sun, 28 Feb 2021 21:45:39 +0000 (21:45 +0000)]
stdlib/fedora.gl: master -> rawhide
Richard W.M. Jones [Fri, 21 Aug 2020 20:19:02 +0000 (21:19 +0100)]
stdlib/fedora.gl: Simpler quicker way to work out dependencies.
This removes the O(n^3) loop.
Richard W.M. Jones [Fri, 17 Apr 2020 18:49:25 +0000 (19:49 +0100)]
Detect dependency cycles earlier and print a better error.
This has a noticable negative effect on performance so we should
revisit the algorithm when we have the time.
Richard W.M. Jones [Sat, 4 Apr 2020 09:10:54 +0000 (10:10 +0100)]
fedora: Increase timeout for koji wait-repo commands.
And if it fails because of a transient problem, retry.
Thanks: Miro Hrončok
Richard W.M. Jones [Thu, 27 Feb 2020 13:14:27 +0000 (13:14 +0000)]
stdlib/fedora: Use rpmdev-bumpspec -r flag for < Rawhide builds.
We want to preserve the upgrade path to Rawhide.
Richard W.M. Jones [Thu, 27 Feb 2020 08:20:31 +0000 (08:20 +0000)]
run: Improve error message if a predicate script fails.
In particular always print the fully resolved parameters of the
predicate.
Richard W.M. Jones [Wed, 26 Feb 2020 13:48:12 +0000 (13:48 +0000)]
More suggestions for TODO.
Richard W.M. Jones [Tue, 25 Feb 2020 22:35:31 +0000 (22:35 +0000)]
stdlib: Get rid of %koji and %fedpkg.
These were used to do riscv builds, but they complicated the rules and
could also have been done using a $PATH override. Remove this
completely.
Richard W.M. Jones [Tue, 25 Feb 2020 22:33:39 +0000 (22:33 +0000)]
Fix whitespace.
Richard W.M. Jones [Sat, 25 Jan 2020 22:14:12 +0000 (22:14 +0000)]
Version 0.3.
Richard W.M. Jones [Tue, 28 Jan 2020 10:49:34 +0000 (10:49 +0000)]
Update TODO.
Richard W.M. Jones [Sat, 25 Jan 2020 22:08:57 +0000 (22:08 +0000)]
dist: Add extra files to tarball.
We need files like ‘Makefile.am’ and ‘compile’ in order for the
tarball to be built without autotools.
Fixes commit
bed4036653ce47a91b96dd0ead65341aa80d6b97.
Richard W.M. Jones [Tue, 21 Jan 2020 14:22:43 +0000 (14:22 +0000)]
docs: Document some shell functions.
Richard W.M. Jones [Tue, 21 Jan 2020 13:46:06 +0000 (13:46 +0000)]
tests: Add basic test of predicates.
Richard W.M. Jones [Mon, 20 Jan 2020 20:00:49 +0000 (20:00 +0000)]
Update TODO.
Richard W.M. Jones [Mon, 20 Jan 2020 19:53:16 +0000 (19:53 +0000)]
docs: Document %stdlib dir.
Richard W.M. Jones [Mon, 20 Jan 2020 19:52:21 +0000 (19:52 +0000)]
Implement %tmpdir.
Richard W.M. Jones [Mon, 20 Jan 2020 15:01:06 +0000 (15:01 +0000)]
Rename tactic -> predicate.
Predicates always have the form ‘is-foo’ (like ‘*foo’ for tactics).
Richard W.M. Jones [Mon, 20 Jan 2020 14:12:22 +0000 (14:12 +0000)]
Implement keep-going (-k) option.
Richard W.M. Jones [Mon, 20 Jan 2020 12:22:49 +0000 (12:22 +0000)]
jobs: If multiple jobs fail, save and print all the exceptions.
Don't "forget" earlier exceptions.
Richard W.M. Jones [Mon, 20 Jan 2020 12:20:04 +0000 (12:20 +0000)]
jobs: Remove unnecessary 'a retire and 'a to_string types.
Richard W.M. Jones [Mon, 20 Jan 2020 12:09:56 +0000 (12:09 +0000)]
Use automake.
This simplifies rebuilding of files like config.status and run when
the configuration changes. We still don't actually use make/automake
for anything substantial - all rules are passed through to goals.
Richard W.M. Jones [Sat, 18 Jan 2020 21:10:13 +0000 (21:10 +0000)]
stdlib: Improve performance of fedora.gl.
Richard W.M. Jones [Sat, 18 Jan 2020 20:52:36 +0000 (20:52 +0000)]
run: Set OCAMLRUNPARAM to display stack traces by default.
Richard W.M. Jones [Sat, 18 Jan 2020 20:50:57 +0000 (20:50 +0000)]
stdlib: Fix %branch -> %fedora-branch.
Fixes commit
69f0ac6d4b9a1fd1b2985cefe95d4f06d55004f3
Richard W.M. Jones [Sat, 18 Jan 2020 15:33:41 +0000 (15:33 +0000)]
Version 0.2.
Richard W.M. Jones [Sat, 18 Jan 2020 16:02:23 +0000 (16:02 +0000)]
install: Fix install path for stdlib, and install man pages.
Richard W.M. Jones [Sat, 18 Jan 2020 15:51:37 +0000 (15:51 +0000)]
dist: Replace install-sh symlink with a copy of the file.
Richard W.M. Jones [Sat, 18 Jan 2020 15:31:40 +0000 (15:31 +0000)]
build: Reorder .gitignore
Richard W.M. Jones [Sat, 18 Jan 2020 15:06:42 +0000 (15:06 +0000)]
maintainer: Add maintainer-commit, maintainer-tag goals.
Richard W.M. Jones [Sat, 18 Jan 2020 15:09:38 +0000 (15:09 +0000)]
build: %version instead of using autoconf @PACKAGE_VERSION@.
And don't bother with @PACKAGE_NAME@.
Richard W.M. Jones [Sat, 18 Jan 2020 14:53:14 +0000 (14:53 +0000)]
maintainer: Build Fedora package in copr.
Richard W.M. Jones [Sat, 18 Jan 2020 15:23:45 +0000 (15:23 +0000)]
build: dist should have %tarfile as target.
Richard W.M. Jones [Sat, 18 Jan 2020 13:12:06 +0000 (13:12 +0000)]
stdlib: Add fedora.gl.
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.
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.
Richard W.M. Jones [Mon, 13 Jan 2020 12:06:26 +0000 (12:06 +0000)]
build: Distribute src/.depend with tarball.
Richard W.M. Jones [Sun, 12 Jan 2020 22:56:39 +0000 (22:56 +0000)]
build: Implement make dist rule.
Richard W.M. Jones [Sun, 12 Jan 2020 22:46:24 +0000 (22:46 +0000)]
build: Implement install rule.
Richard W.M. Jones [Sun, 12 Jan 2020 22:04:35 +0000 (22:04 +0000)]
Update TODO.
Richard W.M. Jones [Sun, 12 Jan 2020 22:00:58 +0000 (22:00 +0000)]
stdlib: Change print colour functions so they are atomic.
Richard W.M. Jones [Sun, 12 Jan 2020 21:51:21 +0000 (21:51 +0000)]
stdlib: Disable echo on split command.
Fixes commit
17dc1d6e0ec8f194df3dd74a7033303ad9ff739c.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 21:18:36 +0000 (21:18 +0000)]
stdlib: Implement split() function.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 21:07:57 +0000 (21:07 +0000)]
stdlib: Implement last() and nth() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:48:29 +0000 (20:48 +0000)]
stdlib: Implement filter() and filter-out() functions.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 20:41:01 +0000 (20:41 +0000)]
Update TOOD.
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.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 20:30:40 +0000 (20:30 +0000)]
stdlib: Implement read() and readlines() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:22:26 +0000 (20:22 +0000)]
stdlib: Implement head() and tail() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 20:02:57 +0000 (20:02 +0000)]
stdlib: Implement realpath() function.
Richard W.M. Jones [Sun, 12 Jan 2020 19:56:36 +0000 (19:56 +0000)]
stdlib: Implement join() function.
Richard W.M. Jones [Sun, 12 Jan 2020 19:51:56 +0000 (19:51 +0000)]
stdlib: Implement dirname(), basename() and extension() functions.
Richard W.M. Jones [Sun, 12 Jan 2020 19:34:39 +0000 (19:34 +0000)]
docs: Document functions sort, wildcard and wrap.
Richard W.M. Jones [Sun, 12 Jan 2020 19:11:04 +0000 (19:11 +0000)]
stdlib: Implement subst function.
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.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 18:50:38 +0000 (18:50 +0000)]
tests: Add test of the wildcard function.
Richard W.M. Jones [Sun, 12 Jan 2020 18:42:47 +0000 (18:42 +0000)]
cmdline: Implement -s (--silent or --quiet) option.
Richard W.M. Jones [Sun, 12 Jan 2020 18:36:50 +0000 (18:36 +0000)]
tests: Add test of the sort function.
Richard W.M. Jones [Sun, 12 Jan 2020 18:01:41 +0000 (18:01 +0000)]
build: Run make clean in parallel.
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.
Richard W.M. Jones [Sun, 12 Jan 2020 17:27:03 +0000 (17:27 +0000)]
tests: Add a basic test of dependencies.
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.
Richard W.M. Jones [Sat, 11 Jan 2020 20:31:10 +0000 (20:31 +0000)]
build: Hide make passthrough command.
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.
Richard W.M. Jones [Sat, 11 Jan 2020 11:57:08 +0000 (11:57 +0000)]
tests: More basic tests.
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.
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.
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.
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.
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 ;
Richard W.M. Jones [Fri, 10 Jan 2020 12:16:53 +0000 (12:16 +0000)]
build: Add 'make maintainer-clean' passthrough rule.
Richard W.M. Jones [Fri, 10 Jan 2020 12:15:41 +0000 (12:15 +0000)]
stdlib: Add wrap function.
Richard W.M. Jones [Fri, 10 Jan 2020 12:15:23 +0000 (12:15 +0000)]
stdlib: Don't add \n after quoted_string.
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.
Richard W.M. Jones [Thu, 9 Jan 2020 18:11:42 +0000 (18:11 +0000)]
Split implementation into dependency analysis and traversal.
Richard W.M. Jones [Thu, 9 Jan 2020 18:11:26 +0000 (18:11 +0000)]
utils: Add unique () function.
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.
Richard W.M. Jones [Thu, 9 Jan 2020 11:50:27 +0000 (11:50 +0000)]
cmdline: Make sure all errors go through main () function.
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.
Richard W.M. Jones [Wed, 8 Jan 2020 22:06:29 +0000 (22:06 +0000)]
Update TODO.
Richard W.M. Jones [Wed, 8 Jan 2020 21:57:33 +0000 (21:57 +0000)]
build: Create man/ subdirectory before building man pages.
Richard W.M. Jones [Wed, 8 Jan 2020 11:43:26 +0000 (11:43 +0000)]
Implement parallel jobs (-j option).
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.
Richard W.M. Jones [Tue, 7 Jan 2020 20:42:53 +0000 (20:42 +0000)]
docs: Add empty Goalfile(5) and goals-reference(5).