Commit graph

408 commits

Author SHA1 Message Date
Eelco Dolstra
a5619f1dff * Set the NIX_STORE and NIX_BUILD_TOP environment variables in
builders to point to the store and the temporary build directory,
  respectively.  Useful for purity checking.
* Also set TEMPDIR, TMPDIR, TEMP, and TEMP to NIX_BUILD_TOP to make
  sure that tools in the builder store temporary files in the right
  location.
2004-03-12 10:45:08 +00:00
Eelco Dolstra
dbf547645d * Resolve an ambiguity between ifs and attribute selection, e.g., `if
b then x else y.z'.
2004-02-19 13:11:12 +00:00
Eelco Dolstra
0dfdafdf6d * Allow linking against an external Berkeley DB / ATerm library. 2004-02-16 16:37:16 +00:00
Eelco Dolstra
f34de12140 * Allow the location of the store to be specified (--with-store-dir).
* Do not create stuff in localstatedir when doing `make install'
  (since we may not have write access).  In general, installation of
  constant code/data should be separate from the initialisation of
  mutable state.
2004-02-16 15:23:19 +00:00
Eelco Dolstra
fbc48a469c * Inherited attributes in recursive attribute sets are in scope of the
non-inherited attributes.
2004-02-16 09:18:35 +00:00
Eelco Dolstra
76c0e85929 * The environment variable NIX_ROOT can now be set to execute Nix in a
chroot() environment.
* A operation `--validpath' to register path validity.  Useful for
  bootstrapping in a pure Nix environment.
* Safety checks: ensure that files involved in store operations are in
  the store.
2004-02-14 21:44:18 +00:00
Eelco Dolstra
6f5a5ea5ea * Regression fix: realise substitutes and detect cycles. 2004-02-13 10:45:09 +00:00
Eelco Dolstra
00fe1a506f * When creating a new generation, also make the normal form of the
derivation (i.e., the closure store expression) a root of the
  garbage collector.  This ensures that running `nix-collect-garbage
  --no-successors' is safe.
2004-02-11 10:25:31 +00:00
Eelco Dolstra
92e832348d * Lots of manual stuff. Reference pages for most Nix commands.
* nix-pull now requires the full url to the manifest, i.e.,
  `/MANIFEST/' is no longer automatically appended.
* nix-prefetch-url works again.
2004-02-10 16:14:47 +00:00
Eelco Dolstra
6551b36790 * Print what generation we are switching to; honour --dry-run flag. 2004-02-10 13:42:58 +00:00
Eelco Dolstra
618aa69b01 * In --upgrade': added flags --lt', --leq', --always' to specify
whether we want to upgrade if the current version is less than the
  available version (default), when it is less or equal, or always.
  
* Added a flag `--dry-run' to show what would happen in `--install',
  `--uninstall', and `--upgrade', without actually performing the
  operation.
2004-02-09 11:59:39 +00:00
Eelco Dolstra
06a75a7e0c * A command `--switch-generation' to switch to a specific generation
of the current profile, e.g.,

    $ nix-env --list-generations
    ...
    39   2004-02-02 17:53:53
    40   2004-02-02 17:55:18
    41   2004-02-02 17:55:41
    42   2004-02-02 17:55:50   (current)

    $ nix-env --switch-generation 39

    $ ls -l /nix/var/nix/profiles/default
    ... default -> default-39-link

* Also a command `--rollback' which is just a convenience operation to
  rollback to the oldest generation younger than the current one.

  Note that generations properly form a tree.  E.g., if after
  switching to generation 39, we perform an installation action,
  a generation 43 is created which is a descendant of 39, not 42.  So
  a rollback from 43 ought to go back to 39.  This is not currently
  implemented; generations form a linear sequence.
2004-02-08 14:07:43 +00:00
Eelco Dolstra
b8675aee54 * In `--list-generations', show what the current generation is. 2004-02-06 16:16:55 +00:00
Eelco Dolstra
73ab2ed4fd * A command `--list-generations' to show all generations for a
profile.
2004-02-06 16:03:27 +00:00
Eelco Dolstra
7c0fa4474f * More refactoring. 2004-02-06 14:57:10 +00:00
Eelco Dolstra
7abf9911d9 * Refactoring. 2004-02-06 14:49:41 +00:00
Eelco Dolstra
49bafe1faf * Use the profile pointed to by ~/.nix-profile if no --profile
argument is specified.
2004-02-06 10:59:06 +00:00
Eelco Dolstra
66e94d3275 * Improvements to profiles. Generations are now per-profile, e.g.,
default -> default-94-link
  default-82-link -> /nix/store/cc4480...
  default-83-link -> /nix/store/caeec8...
  ...
  default-94-link -> /nix/store/2896ca...
  experimental -> experimental-2-link
  experimental-1-link -> /nix/store/cc4480...
  experimental-2-link -> /nix/store/a3148f...

* `--profile' / `-p' -> `--switch-profile' / `-S'
* `--link' / `-l' -> `--profile' / `-p'
* The default profile is stored in $prefix/var/nix/profiles.
  $prefix/var/nix/links is gone.  Profiles can be stored anywhere.
* The current profile is now referenced from ~/.nix-profile, not
  ~/.nix-userenv.
* The roots to the garbage collector now have extension `.gcroot', not
  `.id'.
2004-02-06 10:30:20 +00:00
Eelco Dolstra
d445da7a7b * Extended the `inherit' syntax to optionally select attributes from
other attribute sets, rather than the current scope.  E.g.,
  
    {inherit (pkgs) gcc binutils;}

  is equivalent to

    {gcc = pkgs.gcc; binutils = pkgs.binutils;}

  I am not so happy about the syntax.
2004-02-04 17:23:26 +00:00
Eelco Dolstra
9d25466b34 * An attribute set update operator (//). E.g.,
{x=1; y=2; z=3;} // {y=4;}  =>  {x=1; y=4; z=3;}
2004-02-04 16:49:51 +00:00
Eelco Dolstra
9b44480612 * Use a map to lookup primops.
* Various performance improvements in the evaluator.
* Do not link against unused (and missing!) libraries (-lsglr, etc.).
2004-02-04 16:03:29 +00:00
Eelco Dolstra
c4f7ae4aa5 * Verify that all variables in a Nix expression are defined. 2004-02-03 14:45:34 +00:00
Eelco Dolstra
1c9c0a5a46 * Added syntactic sugar to the construction of attribute sets to
`inherit' variables from the surrounding lexical scope.

  E.g.,

    {stdenv, libfoo}: derivation {
      builder = ./bla;
      inherit stdenv libfoo;
      xyzzy = 1;
    }

  is equivalent to

    {stdenv, libfoo}: derivation {
      builder = ./bla;
      stdenv = stdenv;
      libfoo = libfoo;
      xyzzy = 1;
    }

  Note that for mutually recursive attribute set definitions (`rec
  {...}'), this also works, that is, `rec {inherit x;}' is equivalent
  to `let {fresh = x; body = rec {x = fresh;};}', *not*
  `rec {x = x}'.
2004-02-02 21:39:33 +00:00
Eelco Dolstra
d9f30fe7c7 * Sort `nix-env -q' output by derivation name.
* `--version' flag for all commands.
* Manual updates.
2004-02-02 10:51:54 +00:00
Eelco Dolstra
47c003cb59 * Doh! 2004-01-30 17:14:08 +00:00
Eelco Dolstra
619f20775d * Parser numbers again.
* Include missing files in distributions.
2004-01-30 17:06:03 +00:00
Eelco Dolstra
c625718513 * Detect flex and bison; updated the manual. 2004-01-30 16:32:14 +00:00
Eelco Dolstra
c5baaafae6 * Replaced the SDF parser by a substantially faster Bison/Flex
parser (roughly 80x faster).

  The absolutely latest version of Bison (1.875c) is required for
  reentrant GLR support, as well as a recent version of Flex (say,
  2.5.31).  Note that most Unix distributions ship with the
  prehistoric Flex 2.5.4, which doesn't support reentrancy.
2004-01-30 15:21:42 +00:00
Eelco Dolstra
abd1878b26 * Optimised the SDF grammar. 2004-01-29 14:24:53 +00:00
Eelco Dolstra
840551ebdb * Extra bit S' in --query --status' output: show whether there are
any substitutes for the derivation.
2004-01-21 16:41:17 +00:00
Eelco Dolstra
1109ea0680 * Fixed a subtle uninitialised variable bug in ATermMaps copied from
ATermMaps.  Found thanks to Valgrind!
2004-01-21 14:49:32 +00:00
Eelco Dolstra
47f19b6293 * Absolutise the specified path in --import' and --profile'. 2004-01-20 20:36:58 +00:00
Eelco Dolstra
291030b900 * Remove debug message. 2004-01-15 20:58:44 +00:00
Eelco Dolstra
447089a5f6 * Catch SIGINT to terminate cleanly when the user tries to interrupt
Nix.  This is to prevent Berkeley DB from becoming wedged.

  Unfortunately it is not possible to throw C++ exceptions from a
  signal handler.  In fact, you can't do much of anything except
  change variables of type `volatile sig_atomic_t'.  So we set an
  interrupt flag in the signal handler and check it at various
  strategic locations in the code (by calling checkInterrupt()).
  Since this is unlikely to cover all cases (e.g., (semi-)infinite
  loops), sometimes SIGTERM may now be required to kill Nix.
2004-01-15 20:23:55 +00:00
Eelco Dolstra
08719c6c97 * Obsolete. 2004-01-15 20:13:54 +00:00
Eelco Dolstra
55e11bc0d3 * In nix-env --query --status', determine the I' bit by looking at
the output path of a derivation, not the path of its store
  expression.  This ensures that changes that affect the path of the
  store expression but not the output path, do not affect the
  `installed' state of a derivation.
2004-01-15 14:43:00 +00:00
Eelco Dolstra
ff9af107d3 * Option `-B' to always show the output of builders, regardless of
verbosity level.
2004-01-13 16:35:43 +00:00
Eelco Dolstra
3495d153b3 * Periodically checkpoint the log. 2004-01-13 13:37:25 +00:00
Eelco Dolstra
698e880c9f * Tricky: make sure that the accessor count is not reset to 0 if
recovery fails.
2004-01-13 12:36:43 +00:00
Eelco Dolstra
23fbc72f5d * Print error messages, not debug messages. 2004-01-13 11:53:12 +00:00
Eelco Dolstra
4c4fe7a114 * Changed the extension for store expressions from ".nix" to ".store"
(following the Usenix paper).
2004-01-12 10:44:48 +00:00
Eelco Dolstra
46a71c857c * Option --force-realise' in nix-store --query'. 2004-01-09 14:18:28 +00:00
Eelco Dolstra
7959354379 * Upgraded to Berkeley DB 4.2.52. The main advantage of 4.2 is that
it automatically removes log files when they are no longer needed.

  *** IMPORTANT ***

  If you have an existing Nix installation, you must checkpoint the
  Nix database to prevent recent transactions from being undone.  Do
  the following:

  - optional: make a backup of $prefix/var/nix/db.

  - run `db_checkpoint' from Berkeley DB 4.1:
  
    $ db_checkpoint -h $prefix/var/nix/db -1

  - optional (?): run `db_recover' from Berkeley DB 4.1:

    $ db_recover -h $prefix/var/nix/db

  - remove $prefix/var/nix/db/log* and $prefix/var/nix/db/__db*
2004-01-07 15:53:14 +00:00
Eelco Dolstra
4a373a3e9a * Implemented Eelco V.'s `nix-env -I' command to specify the default
path of the Nix expression to be used with the import, upgrade, and
  query commands.  For instance,

  $ nix-env -I ~/nixpkgs/pkgs/system/i686-linux.nix

  $ nix-env --query --available   [aka -qa]
  sylpheed-0.9.7
  bison-1.875
  pango-1.2.5
  subversion-0.35.1
  ...

  $ nix-env -i sylpheed

  $ nix-env -u subversion

  There can be only one default at a time.

* If the path to a Nix expression is a symlink, follow the symlink
  prior to resolving relative path references in the expression.
2004-01-05 16:26:43 +00:00
Eelco Dolstra
f83c5e3e5f * Implemented Eelco V.'s `-p' command to switch profiles. It switches
the symlink ~/.nix-userenv to the given argument (which defaults to
  .../links/current).  /etc/profile.d/nix-profile creates this symlink
  if it doesn't exist yet.  Example use:

  $ nix-env -l my_profile -i foo.nix subversion quake
  $ nix-env -p my_profile

  I don't like the term "profile".  Let's deprecate it :-)
2004-01-05 11:18:59 +00:00
Eelco Dolstra
94175e978a * RPM spec file.
* Respect DESTDIR variable.
2003-12-30 20:09:00 +00:00
Eelco Dolstra
392b7e0f8e * Fixed a bug in the upgrade operation. 2003-12-23 22:13:36 +00:00
Eelco Dolstra
833f2fc92d * GCC 2.95 compatibility. 2003-12-22 16:40:46 +00:00
Eelco Dolstra
cf0287c09e * Upgrade operation in `nix-env'. For instance, you can say
nix-env -u foo.nix strategoxt

  to replace the installed `strategoxt' derivation with the one from `foo.nix', if 
  the latter has a higher version number.  This is a no-op if `strategoxt' is not 
  installed.  Wildcards are also accepted, so

    nix-env -u foo.nix '*'

  will replace any installed derivation with newer versions from `foo.nix', if 
  available.

  The notion of "version number" is somewhat ad hoc, but should be useful in most 
  cases, as evidenced by the following unit tests for the version comparator:

    TEST("1.0", "2.3", -1);
    TEST("2.1", "2.3", -1);
    TEST("2.3", "2.3", 0);
    TEST("2.5", "2.3", 1);
    TEST("3.1", "2.3", 1);
    TEST("2.3.1", "2.3", 1);
    TEST("2.3.1", "2.3a", 1);
    TEST("2.3pre1", "2.3", -1);
    TEST("2.3pre3", "2.3pre12", -1);
    TEST("2.3a", "2.3c", -1);
    TEST("2.3pre1", "2.3c", -1);
    TEST("2.3pre1", "2.3q", -1);

  (-1 = less, 0 = equal, 1 = greater)

* A new verbosity level `lvlInfo', between `lvlError' and `lvlTalkative'.  This is 
  the default for `nix-env', so without any `-v' flags users should get useful 
  output, e.g.,

$ nix-env -u foo.nix strategoxt
upgrading `strategoxt-0.9.2' to `strategoxt-0.9.3'
2003-12-22 16:04:00 +00:00
Eelco Dolstra
f3c9783846 * Version numbers can be omitted in install/uninstall. E.g.,
nix-env -i foo.nix subversion

  The version number part of a derivation name is defined as everything following the 
  first dash not followed by a letter.
2003-12-21 23:58:56 +00:00
Eelco Dolstra
a81b621202 * -u' -> -e'.
* `--link' / `-l' flag to specify the switch symlink to use (by default, 
  /nix/var/nix/links/current).
2003-12-21 22:34:41 +00:00
Eelco Dolstra
528f1d1867 * Bug fix: parallel builds of the same derivation failed due to lock file removal. 2003-12-21 17:09:16 +00:00
Eelco Dolstra
cff6fd22eb * Allow successors that don't exist but have a substitute.
* Integrity: check in successor / substitute registration whether
  the target path exists or has a substitute.
2003-12-05 11:05:19 +00:00
Eelco Dolstra
0d3a1a8582 * Add missing files to `make dist'. 2003-12-02 12:37:37 +00:00
Eelco Dolstra
0c804c6775 * Regression fix: query flags (e.g., "-qsf") were broken. 2003-12-02 10:21:40 +00:00
Eelco Dolstra
078e20885e * Help text for all (non-script) programs, so no more:
$ nix-instantiate --help
error: unknown flag `--help`
Try `nix-instantiate --help' for more information.

:-)
2003-12-01 15:55:05 +00:00
Eelco Dolstra
83ffd4f282 * Fix `make check'. 2003-12-01 14:40:24 +00:00
Eelco Dolstra
5d2b424804 * Use a system name that does not include the OS manufacturer (i.e.,
"i686-linux" instead of "i686-suse-linux").
2003-12-01 14:36:50 +00:00
Eelco Dolstra
ba73f94b3b * Another fix. 2003-11-25 13:03:48 +00:00
Eelco Dolstra
66c115ef5f * More `make dist' fixes. 2003-11-25 13:01:21 +00:00
Eelco Dolstra
c3ee8c9166 * `make dist' fix. 2003-11-25 12:35:52 +00:00
Eelco Dolstra
6e8c19714a * Allow integer bindings in derivations. 2003-11-25 12:05:48 +00:00
Eelco Dolstra
b857267893 * Allow the top-level expression to be a derivation.
* Hack: `nix-env -i *' installs all available derivations.
2003-11-24 11:01:19 +00:00
Eelco Dolstra
c9cb1fa21f * Bug fix in path invalidation.
* More consistency checks.
2003-11-24 09:24:52 +00:00
Eelco Dolstra
af7e6fe22e * Don't use a hard-coded path. 2003-11-22 21:12:36 +00:00
Eelco Dolstra
9486dda115 * Fix nix-push. 2003-11-22 20:39:51 +00:00
Eelco Dolstra
ab0bc4999a * Maintain integrity of the substitute and successor mappings when
deleting a path in the store.
* Allow absolute paths in Nix expressions.
* Get nix-prefetch-url to work again.
* Various other fixes.
2003-11-22 18:45:56 +00:00
Eelco Dolstra
40d9eb14df * Fix the garbage collector. 2003-11-22 15:58:34 +00:00
Eelco Dolstra
7a02d95418 * Remove lock files after building. 2003-11-21 16:05:19 +00:00
Eelco Dolstra
06208d1d86 * Uninstallation. 2003-11-21 14:23:18 +00:00
Eelco Dolstra
2e9042bd1e * Uninstall command (doesn't work yet). 2003-11-20 13:48:48 +00:00
Eelco Dolstra
e0b5a492f5 * Installation: add the previously installed packages. Switch to the new
configuration.
* Status queries.
2003-11-19 21:32:03 +00:00
Eelco Dolstra
9898746ef3 * nix-env: a tool to manage user environments.
* Replace all directory reading code by a generic readDirectory()
  function.
2003-11-19 17:27:16 +00:00
Eelco Dolstra
fd7ac09f10 * Refactoring (step 2). 2003-11-19 12:03:01 +00:00
Eelco Dolstra
ac68840e79 * Refactoring: put the Nix expression evaluator in its own library so
that it can be used by multiple programs.
2003-11-19 11:35:41 +00:00
Eelco Dolstra
2be8b5917a * Use `sdftable -s' to get warnings about the grammar.
* Several bug fixes in the grammar.
* Allow one-line comments (#... and //...) to end in EOF.
2003-11-19 10:04:03 +00:00
Eelco Dolstra
dfc9c64ead * "Fix expression" -> "Nix expression".
* More refactoring.
2003-11-18 12:06:07 +00:00
Eelco Dolstra
b1117ef29d * nix -> nix-store, fix -> nix-instantiate. 2003-11-18 11:38:25 +00:00
Eelco Dolstra
ce92d1bf14 * "Nix expression" -> "store expression".
* More refactoring.
2003-11-18 11:22:29 +00:00
Eelco Dolstra
9f0f020929 * libnix -> libstore. 2003-11-18 10:55:27 +00:00
Eelco Dolstra
8798fae304 * Source tree refactoring. 2003-11-18 10:47:59 +00:00
Eelco Dolstra
45610ae675 * An forward non-random access input iterator class for ATermLists. 2003-11-16 18:31:29 +00:00
Eelco Dolstra
3e5a019a07 * Some utility functions for working with ATerms. 2003-11-16 17:46:31 +00:00
Eelco Dolstra
06ae269c7c * Do not filter when parsing. This is much faster.
* Add some rejections and lexical restrictions to the grammar to make
  this work.
2003-11-10 11:00:38 +00:00
Eelco Dolstra
15801c88fa * Turned the msg() and debug() functions into macros, since they
turned out to be a huge performance bottleneck (the text to printed
  would always be evaluated, even when it was above the verbosity
  level).  This reduces fix-ng execution time by over 50%.

  gprof(1) is very useful. :-)
2003-11-09 10:35:45 +00:00
Eelco Dolstra
90e26d392c * Allow null in derivation bindings. 2003-11-06 15:24:31 +00:00
Eelco Dolstra
cfaea07444 * `null' is a nullary primop. 2003-11-06 14:41:49 +00:00
Eelco Dolstra
569e7940f8 * Allow `+' in path names. 2003-11-06 14:41:29 +00:00
Eelco Dolstra
fa18f1f184 * Assertions.
* Logical operators (!, &&, ||, ->).
2003-11-05 16:27:40 +00:00
Eelco Dolstra
e17e95a828 * Print a shared textual ATerm if the term if very large. Due to
substitutions, Fix terms are very large when printed as trees (in 
  memory, they are quite compact due to sharing).
2003-11-05 16:20:57 +00:00
Eelco Dolstra
80bb477cc4 * Default function arguments. 2003-11-05 15:34:12 +00:00
Eelco Dolstra
0690c1c9c0 * Work around problems with the ATerm library.
The ATerm library doesn't search the heap for pointers to ATerms
  when garbage collecting.  As a result, C++ containers such as
  `map<ATerm, ATerm>' will cause pointer to be hidden from the garbage
  collector, causing crashes.  Instead, we now use ATermTables.
2003-11-03 20:30:40 +00:00
Eelco Dolstra
ff31324278 * Ignore options passed to the aterm library. 2003-11-03 18:21:53 +00:00
Eelco Dolstra
e2655aa332 * Shorter list syntax ([a b c] instead of [a, b, c]). 2003-11-03 11:59:35 +00:00
Eelco Dolstra
ad0976f8d5 * Grammar changes. Attributes in attribute sets are now delimited with
semicolons instead of comma's.  Final semicolon in the set is optional.
2003-11-03 10:21:30 +00:00
Eelco Dolstra
40986312bb * Boolean constants. 2003-11-02 17:36:15 +00:00
Eelco Dolstra
adf9a45469 * Primops: baseNameOf, toString. 2003-11-02 16:31:35 +00:00
Eelco Dolstra
c8268ca991 * Fast builds. 2003-11-01 23:29:02 +00:00
Eelco Dolstra
7de1b2a698 * Print the exit code of the builder. 2003-11-01 21:11:52 +00:00
Eelco Dolstra
1610444671 * Conditions, string equality. 2003-11-01 19:15:08 +00:00
Eelco Dolstra
1b4184ccbb * Let syntax. 2003-11-01 19:10:41 +00:00
Eelco Dolstra
a2a9bacd82 * Filter the substitution list when descending into a recursive
attribute set.
2003-11-01 19:10:19 +00:00
Eelco Dolstra
9210d4d530 * Working evaluator.
* Mutually recursive attribute sets.
* Print evaluator efficiency statistics.
2003-10-31 17:09:31 +00:00
Eelco Dolstra
f1c1a3c97f * Allow empty attribute (argument) sets. 2003-10-31 12:21:01 +00:00
Eelco Dolstra
7db08cc924 * Use SGparseString() instead of SGparseFile() because the latter is
buggy.  It fails to clear an internal variable (SG_textIndex)
  between invocations, so it can be called only once during a program
  execution.
2003-10-31 11:22:56 +00:00
Eelco Dolstra
403cb9327f * Factor out evaluation into a separate file. 2003-10-30 16:48:26 +00:00
Eelco Dolstra
9f8f39aa3c * Clean up the imploded parse tree. Quotes around strings are
removed, paths are absolutised relative to the path containing the
  expression we just parsed, and integer literals are converted to
  actual integers.
2003-10-30 16:18:40 +00:00
Eelco Dolstra
e537844f4e * Bottomup rewrite function. 2003-10-30 16:11:24 +00:00
Eelco Dolstra
442b09ea33 * Don't use a search path. 2003-10-30 16:10:56 +00:00
Eelco Dolstra
933b3f677d * Attribute selection operator. 2003-10-30 16:10:20 +00:00
Eelco Dolstra
b95a3dc45b * Basic grammar and parser for the Fix language. We use libsglr and
friends to do the parsing.  The parse table is embedded in the Fix
  executable using bin2c, which converts an arbitrary file into a C
  character array.
2003-10-29 16:05:03 +00:00
Eelco Dolstra
4d728f6a36 * Forked new version of Fix. 2003-10-29 15:05:18 +00:00
Eelco Dolstra
92eea8fc4e * Fix a race condition in addTextToStore(). 2003-10-23 10:51:55 +00:00
Eelco Dolstra
c4e7d324b8 * Use writeFull(). 2003-10-22 13:29:40 +00:00
Eelco Dolstra
9d95aafe8c * Ad hoc per-package logging. When Nix performs a derivation, it now
writes stdout/stderr of the builder to ${prefix}/var/log/nix/x,
  where x is the file name of the derivation expression, e.g.,

    /nix/var/log/nix/54256391624be04fcb426048ae3ea0a4-d-pan-0.14.2.nix

  Note that consecutive builds of the same expression overwrite,
  rather than append to, existing log files.
2003-10-22 11:04:57 +00:00
Eelco Dolstra
143427f90b * Dead code removal. 2003-10-22 10:53:46 +00:00
Eelco Dolstra
4a8948b7a6 * Some wrapper classes to ensure that file descriptors / directory
handles are closed when they go out of scope.
2003-10-22 10:48:22 +00:00
Eelco Dolstra
c62433751d * Finished refactoring the tree. 2003-10-20 10:05:01 +00:00
Eelco Dolstra
53e376d836 * Refactored the source tree. 2003-10-20 09:20:11 +00:00
Eelco Dolstra
0791282b2f * Substitutes and nix-pull now work again.
* Fixed a segfault caused by the buffering of stderr.
* Fix now allows the specification of the full output path.  This
  should be used with great care, since it by-passes the normal hash
  generation.
* Incremented the version number to 0.4 (prerelease).
2003-10-16 16:29:57 +00:00
Eelco Dolstra
c78bf11524 * Enable buffering of stderr in C++. 2003-10-16 11:55:37 +00:00
Eelco Dolstra
f7c7aad135 * Upgraded to Berkeley DB 4.1.25 and do not synchronously flush the
log on commit.  This means that there is a small change that some
  transactions may be rolled back in case of a system crash, but this
  should not be a problem (it merely might cause some expression
  realisations to be rolled back), and it vastly improves performance.

* Upgraded to ATerm 2.0.5 (which also includes Armijn's 64-bit
  patches).
2003-10-16 08:52:44 +00:00
Eelco Dolstra
181aa3dc41 * Don't sort the result of `--query --list'. 2003-10-16 08:06:19 +00:00
Eelco Dolstra
ebff82222c * Refactoring: move all database manipulation into store.cc.
* Removed `--query --generators'.
2003-10-15 12:42:39 +00:00
Eelco Dolstra
c190f051ac * Automatically recover the database in case of a crash. 2003-10-14 15:33:00 +00:00
Eelco Dolstra
1d61e473c8 * New query `nix --query --predecessors' to print the predecessors of
a Nix expression.
2003-10-10 15:25:21 +00:00
Eelco Dolstra
0abe185688 * `nix --verify': check and repair reverse mapping for successors. 2003-10-10 15:14:29 +00:00
Eelco Dolstra
d3d5e77810 * Reverse mappings for the successor and substitute mappings. 2003-10-10 14:46:28 +00:00
Eelco Dolstra
1eb4da156c * Performance improvement: don't register already registered terms,
thus greatly reducing the number of db transactions.
2003-10-10 13:22:29 +00:00
Eelco Dolstra
6baa2c4420 * Get rid of identifiers since they are redundant now. This greatly
simplifies stuff.

* The format of Nix expressions and the database schema changed
  because of this, so it's best to delete old Nix installations.
2003-10-08 15:06:59 +00:00
Eelco Dolstra
b9f4942bd2 * string -> Path. 2003-10-07 14:37:41 +00:00
Eelco Dolstra
5d4171f7fb * Synchronise terminology with the ICSE paper (e.g., slice -> closure,
fstate -> Nix expression).
* Fix src/test.cc.
2003-10-07 12:27:49 +00:00
Eelco Dolstra
e78f753aa8 * Include the right files in a distribution. 2003-10-02 12:22:19 +00:00
Eelco Dolstra
4193d62e08 * Nix now respects $TMPDIR for the creation of temporary build directories.
* Retry creation of a temporary directory (with a different name) in the 
  case of EEXIST.
2003-10-02 11:55:38 +00:00
Eelco Dolstra
1c7d6bf5fc * Removed references to char_traits so that boost/format also works on
GCC 2.95.
2003-09-11 10:23:55 +00:00
Eelco Dolstra
d930a9bc5a * Added some missing #includes. 2003-09-11 08:31:29 +00:00
Eelco Dolstra
803a924b77 * Make nicer dot graphs. Also show the inner structure of slices. 2003-09-03 14:49:58 +00:00
Eelco Dolstra
c0bbed0959 * Factored out dot graph generation into a separate file. 2003-09-03 11:20:18 +00:00
Eelco Dolstra
0d2bc68681 * Do not show the output of the builder unless the verbosity is at
least at debug level (-vvv).  The output is still appended to the 
  build log in /nix/var/log/nix.
2003-08-29 13:12:30 +00:00
Eelco Dolstra
b018517314 * Do not try to remove write permission from symlinks, since chmod()
follows symlinks.  (Note that the permissions on symlinks are
  ignored anyway.)
2003-08-28 10:51:14 +00:00
Eelco Dolstra
31be53cd0a * Fix the atrocious (exponential? factorial?) time complexity in
`nix --query --requisites'.
2003-08-25 14:56:11 +00:00
Eelco Dolstra
a88144215c * Remove write permission from output paths after they have been built.
* Point $HOME to a non-existing path when building to prevent certain tools (such as 
  wget) from falling back on /etc/passwd to locate the home directory (which we 
  don't want them to look at since it's not declared as an input).
2003-08-22 20:12:44 +00:00
Eelco Dolstra
956801fcc2 * Use maps and sets in the FState data type. This ensures normalisation of
slices and derivations w.r.t. order of paths, slice elements, etc.
2003-08-20 14:11:40 +00:00
Eelco Dolstra
624c48260f * Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,

    Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])

  This was wrong, since ids represent contents, not locations.  Therefore we
  now have:

    Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])

* Fix a bug in the computation of slice closures that could cause slice
  elements to be duplicated.
2003-08-20 12:39:56 +00:00
Eelco Dolstra
ed0db2e0d8 * Fixed a serious bug in the computation of slices. Sometimes the slices
would not be properly closed under the path reference relation.
2003-08-20 11:30:45 +00:00
Eelco Dolstra
1472cc4825 * Pipe /dev/null into stdin. 2003-08-19 13:07:38 +00:00
Eelco Dolstra
2de8504791 * Delete the temporary directories of failed builds by default, and an
option `--keep-failed' to override this behaviour.
2003-08-19 09:04:47 +00:00
Eelco Dolstra
31e4aa6439 * Allow lists in package bindings, e.g.,
("srcs", [Relative("foo/bar.c"), Relative("foo/baz.h")])

  The result is an environment variable that contains the path names of the
  inputs separated by spaces (so this is not safe for values containing
  spaces).
2003-08-18 16:32:55 +00:00
Eelco Dolstra
ebbb6ce578 * Most shells initialise PATH to some default (/bin:/usr/bin:...)
when PATH is not set.  We don't want this, so fill it in with
  some dummy value.
2003-08-18 14:54:54 +00:00
Eelco Dolstra
96c7b98bf0 * Argument support in Fix. Arguments can be passed through the
builder using the `args' binding:

  ("args", ["bla", True, IncludeFix("aterm/aterm.fix")])

  Note that packages can also be declared as inputs by specifying them
  in the argument list.
2003-08-15 13:01:45 +00:00