Commit Graph

1109 Commits

Author SHA1 Message Date
Eelco Dolstra 052cefe1bd * Started hacking on a ATermTable replacement, since ATermTable uses
gigantic amounts of memory --- 65536 bytes per table at least ---
  which makes it unsuitable for representing short-lived substitution
  tables and attribute sets.
2006-05-03 17:29:48 +00:00
Eelco Dolstra d300b4383d * Optimise null-ary term builders. Also declare all term builder
functions as pure, which might improve performance a bit.
2006-05-02 21:58:46 +00:00
Eelco Dolstra 68174bdc7d * Use a linked list of substitutions. This reduces the amount of
copying.
2006-05-02 21:39:02 +00:00
Eelco Dolstra c791e94aee * Removed a bunch of ATreverses. 2006-05-02 17:51:50 +00:00
Eelco Dolstra b52e711910 * Huge reduction in memory use (2/3 or so on large nix-env -qas
operations): share ATermMaps between DrvInfos.
2006-05-02 17:12:03 +00:00
Eelco Dolstra 11ae2d1e7a * Memory reduction: replaced expensive calls to ATmakeApplList by
ATmakeApplArray, and got rid of ATreverse in substitute().
2006-05-02 14:07:28 +00:00
Eelco Dolstra dc719e6ba5 * Some preliminaries towards NIX-45. 2006-05-02 13:39:55 +00:00
Eelco Dolstra ae55e79541 * More tests. 2006-05-02 11:20:55 +00:00
Eelco Dolstra dca43ef795 * Tests for NIX-45. 2006-05-02 11:15:04 +00:00
Eelco Dolstra 7276e194ee * Disallow unescaped $ in string literals. 2006-05-01 15:29:46 +00:00
Eelco Dolstra 0064599a27 * String interpolation. Expressions like
"--with-freetype2-library=" + freetype + "/lib"

  can now be written as

    "--with-freetype2-library=${freetype}/lib"

  An arbitrary expression can be enclosed within ${...}, not just
  identifiers.

* Escaping in string literals: \n, \r, \t interpreted as in C, any
  other character following \ is interpreted as-is.
  
* Newlines are now allowed in string literals.
2006-05-01 14:01:47 +00:00
Eelco Dolstra 6cecad2be0 * Allow string concatenations involving derivations, e.g.,
configureFlags = "--with-freetype2-library="
      + freetype + "/lib";
2006-05-01 09:56:56 +00:00
Eelco Dolstra cce31b739c * svn:ignore 2006-04-29 11:54:45 +00:00
Eelco Dolstra 6fca1b82ae * Change this to LGPL to keep the government happy. 2006-04-25 16:41:06 +00:00
Eelco Dolstra de8f2d061c * Install only the header file and libraries from Berkeley DB. 2006-04-25 11:52:24 +00:00
Eelco Dolstra e18c93169c * Create libexec. 2006-04-25 11:33:27 +00:00
Eelco Dolstra 0748331b70 * Typo. 2006-04-25 10:57:08 +00:00
Eelco Dolstra 03162f8f47 * Unless --with-bzip2 is specified, use a copy of bzip2 in the
externals directory.  This is in particular useful because though
  most systems have bzip2/bunzip2, they don't always have libbz2,
  which we need for bsdiff/bspatch.
2006-04-25 10:45:53 +00:00
Eelco Dolstra ef2d4a2da9 * Print a more useful stack trace when an error occurs deep in the
derivation dependency graph.
2006-03-24 14:02:44 +00:00
Eelco Dolstra b69e469328 * In `nix-env', look for derivations inside attribute sets that have
the `recurseForDerivations' attribute set to `true'.
2006-03-23 16:43:07 +00:00
Eelco Dolstra 49ce8b57dd * Hm. 2006-03-23 16:37:49 +00:00
Eelco Dolstra 20675feeab * Update copyright. 2006-03-15 12:58:22 +00:00
Eelco Dolstra 05bb644890 * Allow the resulting symlink of nix-build to be named, e.g.,
$ nix-build .../i686-linux.nix -A apacheHttpd -o apache
2006-03-14 16:35:01 +00:00
Eelco Dolstra fdea084c36 * Allow `make check' to work in directories that have symlink
components.
2006-03-10 22:27:26 +00:00
Eelco Dolstra 37d1b1cafd * `nix-env -qa --description' shows human-readable descriptions of
packages (provided that they have a `meta.description' attribute).
  E.g.,

  $ ./src/nix-env/nix-env -qa --description gcc
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x
2006-03-10 16:20:42 +00:00
Eelco Dolstra a33fb2d287 * Oops. 2006-03-10 16:14:30 +00:00
Eelco Dolstra 2b3b6c9b34 * In theory, this should reduce the number of ATermMap
re-allocations.
2006-03-10 16:14:13 +00:00
Eelco Dolstra 4ada6db1fc * `nix-env -q' now accepts arguments that allow specific derivations
to be queried, e.g., `nix-env -qa firefox'.  This does require the
  argument '*' to be passed if one wants information about all
  derivations, so the old `nix-env -qa' now is `nix-env -qa "*"'.
2006-03-10 10:24:46 +00:00
Eelco Dolstra 9811815429 * Write messages to stderr, not stdout. 2006-03-10 09:41:28 +00:00
Eelco Dolstra 18c321308d * Ugh, printHash() was very inefficient because it used
ostringstreams.  Around 11% of execution time was spent here (now
  it's 0.5%).
2006-03-09 17:07:25 +00:00
Eelco Dolstra b90c00e63f * Regression: semantics of the result of getDerivation() changed. 2006-03-09 15:10:01 +00:00
Eelco Dolstra 922697c8b2 * Big speedup (factor > 2.5) in all nix-env operations that do actual
instantiation, e.g. "nix-env -i" and "nix-env -qas" (but not
  "nix-env -qa").  It turns out that many redundant calls to
  addToStore(path) were made, which reads and hashes the entire path.
  For instance, the bash bootstrap binary in Nixpkgs would be read and
  hashed many times.  As a result nix-env would spend around 92% of
  its time in the function sha256_block (according to callgrind).
  Some simple memoization fixes this.
2006-03-09 15:09:18 +00:00
Eelco Dolstra 6dca5c9099 * When obtaining derivations from Nix expressions, ignore all
expressions that cause an assertion failure (like `assert system ==
  "i686-linux"').  This allows all-packages.nix in Nixpkgs to be used
  on all platforms, even if some Nix expressions don't work on all
  platforms.

  Not sure if this is a good idea; it's a bit hacky.  In particular,
  due to laziness some derivations might appear in `nix-env -qa' but
  disappear in `nix-env -qas' or `nix-env -i'.

  Commit 5000!
2006-03-08 16:03:58 +00:00
Eelco Dolstra 9088dee9e2 * Some refactoring of the exception handling code so that we can catch
Nix expression assertion failures.
2006-03-08 14:11:19 +00:00
Eelco Dolstra fa72ae1e9c * GCC 4.1 compatibility. 2006-03-06 14:40:10 +00:00
Eelco Dolstra c8bfb11b34 * `nix-env (-i|-u) --dry-run' now shows exactly which missing paths
will be built or substituted.
2006-03-06 11:21:15 +00:00
Eelco Dolstra 7ba1fd2029 * Regularise help text a bit. 2006-03-06 11:04:39 +00:00
Eelco Dolstra 120f00c04f * More online help. 2006-03-03 14:25:07 +00:00
Eelco Dolstra 2d54312f87 * Rewrote nix-build in Perl, since sh is just too limited (turns out
that arrays are a bash extension, so it didn't work on FreeBSD).
  Also fixes NIX-8 (readlink(1) dependency).
2006-03-03 14:15:02 +00:00
Eelco Dolstra 78d84f5631 * Tests for fixed-output derivations (and attribute selection, incidentally). 2006-03-01 18:26:21 +00:00
Eelco Dolstra 2167bf6b72 * Tests to prevent a repeat of the parseHash32 debacle. 2006-03-01 18:11:41 +00:00
Eelco Dolstra 70dee0f8ca * Flags `--to-base32' and `--to-base16' to convert between hex and
base-32 hashes.
2006-03-01 18:05:47 +00:00
Eelco Dolstra e136532800 * Ouch, parseHash32 was completely broken. All digits >= 4 were
parsed as 4.

  For a moment I worried that printHash32 was broken, and that would
  have been really, *really* bad ;-)
2006-03-01 17:59:08 +00:00
Eelco Dolstra 74166f2f44 * db.hh shouldn't depend on the Berkeley DB headers. 2006-03-01 17:44:28 +00:00
Eelco Dolstra 1bdceb421f * Doh! 2006-03-01 16:52:55 +00:00
Eelco Dolstra d822bf32e4 * Close the database before the destructor runs. 2006-03-01 16:36:35 +00:00
Eelco Dolstra fa95f4be3f * More test coverage. 2006-03-01 16:26:13 +00:00
Eelco Dolstra 80b5c71684 * Doh! 2006-03-01 16:03:32 +00:00
Eelco Dolstra e3daee919d * Test `nix-store -q --binding'. 2006-03-01 15:46:22 +00:00
Eelco Dolstra ea9c35d3cc * Test `nix-store --add' and `nix-store -q --hash'. 2006-03-01 15:43:37 +00:00