Commit graph

6465 commits

Author SHA1 Message Date
Eelco Dolstra 692b562342 * `nix --delete' command. 2003-06-23 14:40:49 +00:00
Eelco Dolstra c0cbaef4be * `nix --restore' command. 2003-06-23 14:08:34 +00:00
Eelco Dolstra 5f5cab0ac7 * A function to restore from a Nix archive.
* addValue() can now import any dumpable FS object.
2003-06-23 13:27:59 +00:00
Eelco Dolstra 85effedca3 * Flags to indicate how values are specified on the command line
(--hash, --file, --name).
2003-06-20 14:11:31 +00:00
Eelco Dolstra 5079ccb455 * Move most of Nix into a library (libnix.a).
* Run `test' on `make check'.
2003-06-20 10:53:04 +00:00
Eelco Dolstra 1849aa2a72 * Refactoring: move dump function into archive.cc. 2003-06-20 10:40:25 +00:00
Eelco Dolstra 38e12df631 * `nix --dump' command. 2003-06-18 14:34:43 +00:00
Eelco Dolstra aeaffec785 * Dump symlinks. 2003-06-18 14:34:03 +00:00
Eelco Dolstra 94cf1f86bb * Lambdas, applications, substitutions. 2003-06-18 12:36:12 +00:00
Eelco Dolstra fab7b128b9 * Automake sucks. 2003-06-18 08:07:28 +00:00
Eelco Dolstra 34fcf5fa0c * Started integrating the new evaluation model into Nix.
* Cleaned up command-line syntax.
2003-06-17 21:12:58 +00:00
Eelco Dolstra 7a96da3627 * Test for expression dereferencing. 2003-06-17 15:47:25 +00:00
Eelco Dolstra 6656993f83 * Derefencing of hashed expressions. 2003-06-17 15:45:43 +00:00
Eelco Dolstra a7ab242fb4 * Simplify the evaluator. 2003-06-17 13:37:44 +00:00
Eelco Dolstra c739e20585 * Argument processing. 2003-06-16 21:01:18 +00:00
Eelco Dolstra 727beb798a * Canonicalization: when hashing directories, sort the directory
entries by name.
2003-06-16 16:16:09 +00:00
Eelco Dolstra 2f04e7102e * Path hashing. 2003-06-16 15:59:23 +00:00
Eelco Dolstra a09e66da5a * Description of path hashing algorithm. 2003-06-16 14:19:32 +00:00
Eelco Dolstra 822794001c * Started implementing the new evaluation model.
* Lots of refactorings.
* Unit tests.
2003-06-16 13:33:38 +00:00
Eelco Dolstra b9f09b3268 * AST for Nix expressions. 2003-06-16 07:03:40 +00:00
Eelco Dolstra 21fe717ce2 * Refactoring: hash class. 2003-06-15 13:41:32 +00:00
Eelco Dolstra f66055fa1e * Set umask to 0022 on startup. 2003-05-30 20:53:36 +00:00
Eelco Dolstra 5908663f42 * Send log output to stderr. 2003-05-30 17:01:21 +00:00
Eelco Dolstra d1f5fd7216 * Log the output of builders to $prefix/var/log/nix. 2003-05-30 15:21:52 +00:00
Eelco Dolstra 64582f54be * Open the database read-only when enumerating tables. 2003-05-30 15:18:30 +00:00
Eelco Dolstra 4d21cda0cd * Fix for big-endian platforms: check for endianness in MD5 computations.
This is done at runtime, which is inefficient, but I can't be bothered
  to write an Autoconf test right now.
2003-05-27 09:55:47 +00:00
Eelco Dolstra 9efad76595 * FreeBSD / ISO C++ compatibility fixes. 2003-05-26 15:09:10 +00:00
Eelco Dolstra d8bdf5b06e * Removed some debug code that prevented packages from building. 2003-05-26 14:19:25 +00:00
Eelco Dolstra 8b930a0c94 * Some refactoring. 2003-05-26 13:45:00 +00:00
Eelco Dolstra f8d91f20e6 * Nix can now fetch prebuilts (and other files) from the network, iff
a mapping from the hash to a url has been registered through `nix
  regurl'.

* Bug fix in nix: don't pollute stdout when running tar, it made
  nix-switch barf.

* Bug fix in nix-push-prebuilts: don't create a subdirectory on the
  target when rsync'ing.
2003-05-26 09:44:18 +00:00
Eelco Dolstra 7dd91d3779 * Prebuilt package sharing. We allow transparent binary deployment by
sharing package directories (i.e., the result of building a Nix
  descriptor).

  `nix-pull-prebuilts' obtains a list of all known prebuilts by
  consulting the paths and URLs specified in
  $prefix/etc/nix/prebuilts.conf.  The mappings ($pkghash,
  $prebuilthash) and ($prebuilthash, $location) are registered with
  Nix so that it can use the prebuilt with hash $prebuilthash when
  installing a package with hash $pkghash by downloading and unpacking
  $location.

  `nix-push-prebuilts' creates prebuilts for all packages for which no
  prebuilt is known to exist.  It can then optionally upload these
  to the network through rsync.

  `nix-[pull|push]-prebuilts' just provide a policy.  Nix provides the
  mechanism through the `nix [export|regprebuilt|regurl]' commands.
2003-05-25 22:42:19 +00:00
Eelco Dolstra 0ef4b6d0f8 * Cleaned up the semantics of Fix expressions.
* Conditionals and variables in Fix expressions.  This allows, e.g.,

    Descr(
    [ Bind("pkgId", "subversion-0.21.0")

    , Bind("httpsClient", Bool(True))
    , Bind("httpServer", Bool(True))

    , Bind("ssl", If(Var("httpsClient"), Fix("./openssl-0.9.7b.fix"), ""))

    , Bind("httpd", If(Var("httpServer"), Fix("./httpd-2.0.45.fix"), ""))
    ...
    ])

  which introduces domain feature variables httpsClient and httpServer
  (i.e., whether Subversion is built with https client and webdav
  server support); the values of the variables influences package
  dependencies and the build scripts.

  The next step is to allow that packages can express constraints on
  each other.  E.g., StrategoXT is dependent on an ATerm library with
  the "gcc" variant enabled.  In fact, this may cause several
  Nix instantiations to be created from a single Fix descriptor.  If
  possible, Fix should try to find the least set of instantiations
  that obeys the constraints.
2003-04-25 15:33:50 +00:00
Eelco Dolstra fcc5ae151b * Remove build directory from a package directory after building it. 2003-04-25 15:01:15 +00:00
Eelco Dolstra 24b3d0759e * File removed. 2003-04-24 11:41:50 +00:00
Eelco Dolstra 9713e8577f * getpkg, delpkg, and so on now accept multiple arguments. 2003-04-24 11:41:24 +00:00
Eelco Dolstra e59c3246b9 * Redirect stdout to stderr when executing the build script. 2003-04-23 07:21:57 +00:00
Eelco Dolstra b762f4df7f * In `fix --instantiate', only print out the hashes of the Nix
descriptors generated out of Fix descriptors specified on the
  command line.  This allows us to say:

    nix-switch $(fix -i ./test/fixdescriptors/system.fix)
2003-04-09 12:37:49 +00:00
Eelco Dolstra aa8fda4b54 * We no longer use nix-populate standalone, rather we use it as a
build action for `system' packages (like system.fix) that have
  dependencies on all packages we want to activate.

  So the command sequence to switch to a new activation configuration
  of the system would be:

    $ fix -i .../fixdescriptors/system.fix
    ...
    system.fix -> 89cf4713b37cc66989304abeb9ea189f

    $ nix-switch 89cf4713b37cc66989304abeb9ea189f

* A nix-profile.sh script that can be included in .bashrc.
2003-04-09 12:26:48 +00:00
Eelco Dolstra f56b7312b2 * Descriptor importing in Fix. 2003-04-08 15:36:54 +00:00
Eelco Dolstra cc6eafb3d0 * FreeBSD / gcc 2.95 compatibility fixes.
* A script to generate prebuilt registration scripts.
2003-04-08 14:05:15 +00:00
Eelco Dolstra 0d2b24cdd1 * `Fix' is a high-level descriptor instantiator for Nix. It replaces
nix-instantiate.
2003-04-08 12:00:51 +00:00
Eelco Dolstra 814b256da4 * Better installation: make directories, create database.
* Fixed the register script.
2003-04-06 22:19:26 +00:00
Eelco Dolstra 136c00e881 * Autoconf / Automake configuration and building. 2003-04-04 16:14:56 +00:00
Eelco Dolstra ab723e341a * Minor refactoring: use iterators to process arguments. 2003-04-04 12:02:40 +00:00
Eelco Dolstra c68dca5dac * Script to register pre-built packages. 2003-04-02 15:34:44 +00:00
Eelco Dolstra 5bc26fb73f * Importing and exporting of pre-built packages. 2003-04-02 15:34:05 +00:00
Eelco Dolstra 383f9bb0f1 * Use ATerms for Nix descriptors. 2003-04-01 14:00:47 +00:00
Eelco Dolstra 31f177ef0a * Check for collissions. 2003-03-28 16:27:23 +00:00
Eelco Dolstra 278ea4097e * Don't fork in `nix run'. 2003-03-28 10:33:34 +00:00
Eelco Dolstra f915f77349 * Allow arguments to be passed to programs in `nix run'. 2003-03-28 09:53:22 +00:00
Eelco Dolstra 0f40a560ca * Added a script nix-activate which builds a list of "activated"
packages (i.e., the packages that should appear in the user's $PATH,
  and so on).  Based on this list, the script nix-populate creates a
  hierarchy of symlinks to the relevant files in those packages (e.g.,
  for pkg/bin and pkg/lib).  

  A nice property of nix-populate is that on each run it creates a
  *new* tree, rather than updating the old one.  It then atomically
  switches over to the new tree.  This allows atomic upgrades or
  rollbacks on the set of activated packages.
2003-03-25 16:36:25 +00:00
Eelco Dolstra 3f1a1457e9 * Integrate hash into instantiated descriptor file names.
* Use MD5::Digest.
2003-03-25 11:39:51 +00:00
Eelco Dolstra 73c53935d0 * For efficiency: md5 integrated into nix.
* Command `nix ensure' which is like `nix getpkg' except that if the
  has refers to a run action it will just ensure that the imports are
  there.
* Command `nix closure' to print out the closure of the set of
  descriptors under the import relation, starting at a set of roots.
  This can be used for garbage collection (e.g., given a list of
  `activated' packages, we can delete all packages not reachable from
  those).
* Command `nix graph' to print out a Dot graph of the dependency
  graph.
* `nix-addroot' adds a root for the (unimplemented) garbage collector.
2003-03-24 17:49:56 +00:00
Eelco Dolstra 2dc84e5569 * Descriptors now have a "system" field specifying the platform that
the build or run action should be perfomed on.  This ensures that
  descriptors have different hashes on different platforms.
2003-03-24 12:49:40 +00:00
Eelco Dolstra 9d2f128252 * Refactoring. 2003-03-24 11:50:20 +00:00
Eelco Dolstra 20d165c344 * A command to run programs in Nix packages, that is, to execute a run
action.  Run actions are described by uniquely hashed descriptors,
  just like build actions.  Therefore run actions can have
  dependencies, but these need not be the same as the build time
  dependencies (e.g., at runtime we can link against a different
  version of a dynamic library).  Example:

    nix run 31d6bf4c171282367065e0deecd7c579

  will run the Pan 0.13.91 newsreader with gtkspell support.
2003-03-23 23:24:09 +00:00
Eelco Dolstra 800d8e950f * Added a command to list installed packages. 2003-03-21 15:58:40 +00:00
Eelco Dolstra 2e59698b78 * Added a command to verify the consistency of the database. 2003-03-21 15:53:35 +00:00
Eelco Dolstra e582ee67cd * Fetch sources from the network. 2003-03-21 14:10:06 +00:00
Eelco Dolstra cadc3852e4 * nix-instantiate now instantiantes the closure of the set of
descriptor templates under the import relation.  I.e., we can now
  say:

    nix-instantiate outdir foo.nix

  which will create descriptors for foo.nix and all imported packages
  in outdir/.
2003-03-20 22:23:48 +00:00
Eelco Dolstra f7a98e081d * Various updates. 2003-03-20 16:53:00 +00:00
Eelco Dolstra b3594e9eaf * A script to instantiate package descriptors from templates. 2003-03-20 16:52:30 +00:00
Eelco Dolstra 8999f923ea * Improved Nix. Resources (package descriptors and other source
files) are now referenced using their cryptographic hashes.  

  This ensures that if two package descriptors have the same contents,
  then they describe the same package.  This property is not as
  trivial as it sounds: generally import relations cause this property
  not to hold w.r.t. temporality.  But since imports also use hashes
  to reference other packages, equality follows by induction.
2003-03-14 16:43:14 +00:00
Eelco Dolstra 18ebf518de * Converted to C++. 2003-03-13 16:28:32 +00:00
Eelco Dolstra 75d788b0f2 * Initial version of nix. 2003-03-13 14:24:49 +00:00