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*
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.
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 :-)
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'
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. :-)
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.
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.
* 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).
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).
* 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).
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.
("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).
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.
process is already holding a lock on a path, it may acquire the lock
again without blocking or failing). (This might be dangerous, not
sure). Necessary for fast builds to work.
normal form in a single transaction to ensure that if we crash,
either everything is registered or nothing is. This is for
recoverability: unregistered paths in the store can be deleted
arbitrarily, while registered paths can only be deleted by running
the garbage collector.
* Open all database tables (Db objects) at initialisation time, not
every time they are used. This is necessary because tables have to
outlive all transactions that refer to them.
Renamed `fstateRefs' to `fstateRequisites'. The semantics of this
function is that it returns a list of all paths necessary to realise
a given expression. For a derive expression, this is the union of
requisites of the inputs; for a slice expression, it is the path of
each element in the slice. Also included are the paths of the
expressions themselves. Optionally, one can also include the
requisites of successor expressions (to recycle intermediate
results).
* `nix-switch' now distinguishes between an expression and its normal
form. Usually, only the normal form is registered as a root of the
garbage collector. With the `--source-root' flag, it will also
register the original expression as a root.
* `nix-collect-garbage' now has a flag `--keep-successors' which
causes successors not to be included in the list of garbage paths.
* `nix-collect-garbage' now has a flag `--invert' which will print all
paths that should *not* be garbage collected.
up to the given verbosity levels. These currently are:
lvlError = 0,
lvlNormal = 5,
lvlDebug = 10,
lvlDebugMore = 15
although only lvlError and lvlDebug are actually used right now.
substituting for (obvious, really).
* For greater efficiency, nix-pull/unnar will place the output in a
path that is probably the same as what is actually needed, thus
preventing a path copy.
* Even if a output id is given in a Fix package expression, ensure
that the resulting Nix derive expression has a different id. This
is because Nix expressions that are semantically equivalent (i.e.,
build the same result) might be different w.r.t. efficiency or
divergence. It is absolutely vital for the substitute mechanism
that such expressions are not used interchangeably.
value; this potentially dangerous feature enables better
sharing for those paths for which the content is known in
advance (e.g., because a content hash is given).
* Fast builds: if we can expand all output paths of a derive
expression, we don't have to build.
* A function to find all Nix expressions whose output ids are
completely contained in some set. Useful for uploading relevant Nix
expressions to a shared cache.
number of bytes, e.g., in case of a signal like SIGSTOP.
This caused `nix --dump' to fail sometimes.
Note that this bug went unnoticed because the call to `nix
--dump' is in a pipeline, and the shell ignores non-zero
exit codes from all but the last element in the pipeline.
Is there any way to check the result of the initial elements
in the pipeline? (In other words, is it at all possible to
write reliable shell scripts?)
input path is referenced in an output paths, we also have to
add all ids referenced by that input path.
* Better debug assertions to catch these sorts of errors.
This is not entirely trivial since this introduces the possibility
of mutual recursion.
* Made normal forms self-contained.
* Use unique ids, not content hashes, for content referencing.
Unifying substitutes and successors isn't very feasible for now,
since substitutes are only used when no path with a certain is
known. Therefore, a normal form of some expression stored as a
substitute would not be used unless the expression itself was
missing.
hash for which no local expansion is available, Nix can execute a
`substitute' which should produce a path with such a hash.
This is policy-free since Nix does not in any way specify how the
substitute should work, i.e., it's an arbitrary (unnormalised)
fstate expression. For example, `nix-pull' registers substitutes
that fetch Nix archives from the network (through `wget') and unpack
them, but any other method is possible as well. This is an
improvement over the old Nix sharing scheme, which had a policy
(fetching through `wget') built in.
The sharing scheme doesn't work completely yet because successors
from fstate rewriting have to be registered on the receiving side.
Probably the whole successor stuff can be folded up into the
substitute mechanism; this would be a nice simplification.
archives (using the package in corepkgs/nar).
* queryPathByHash -> expandHash, and it takes an argument specifying
the target path (which may be empty).
* Install the core Fix packages in $prefix/share/fix. TODO: bootstrap
Nix and install Nix as a Fix package.
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.
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.
* 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.
descriptors generated out of Fix descriptors specified on the
command line. This allows us to say:
nix-switch $(fix -i ./test/fixdescriptors/system.fix)
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.
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.
* 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.
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.
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/.
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.