From 2a4bac5459f42764b39ac70f906f5dd3330a3ac5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Nov 2003 11:24:13 +0000 Subject: [PATCH] * Refactoring. * Convert tabs to spaces. --- doc/manual/Makefile.am | 11 +- doc/manual/book.xml | 32 +- doc/manual/installation.xml | 18 +- doc/manual/introduction.xml | 338 ++++++------- ...ence.xml => nix-instantiate-reference.xml} | 6 +- doc/manual/nix-reference.xml | 444 ------------------ doc/manual/nix-store-reference.xml | 444 ++++++++++++++++++ 7 files changed, 636 insertions(+), 657 deletions(-) rename doc/manual/{fix-reference.xml => nix-instantiate-reference.xml} (86%) delete mode 100644 doc/manual/nix-reference.xml create mode 100644 doc/manual/nix-store-reference.xml diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am index 8b3060ac7..8e2fff208 100644 --- a/doc/manual/Makefile.am +++ b/doc/manual/Makefile.am @@ -3,16 +3,17 @@ ENV = SGML_CATALOG_FILES=$(docbookcatalog) XMLLINT = $(ENV) $(xmllint) $(xmlflags) --catalogs XSLTPROC = $(ENV) $(xsltproc) $(xmlflags) --catalogs -SOURCES = book.xml introduction.xml installation.xml nix-reference.xml \ +SOURCES = book.xml introduction.xml installation.xml \ + nix-store-reference.xml \ troubleshooting.xml bugs.xml book.is-valid: $(SOURCES) $(XMLLINT) --noout --valid book.xml touch $@ -man1_MANS = nix.1 fix.1 +man1_MANS = nix-store.1 nix-instantiate.1 -man nix.1 fix.1: $(SOURCES) book.is-valid +man $(MANS): $(SOURCES) book.is-valid $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl book.xml book.html: $(SOURCES) book.is-valid @@ -24,4 +25,6 @@ install-data-local: book.html $(INSTALL) -d $(datadir)/nix/manual $(INSTALL_DATA) book.html $(datadir)/nix/manual -EXTRA_DIST = $(SOURCES) book.html nix.1 fix.1 book.is-valid +EXTRA_DIST = $(SOURCES) book.html book.is-valid $(MANS) + +DISTCLEANFILES = book.html book.is-valid $(MANS) diff --git a/doc/manual/book.xml b/doc/manual/book.xml index a2035fca7..1dc69d004 100644 --- a/doc/manual/book.xml +++ b/doc/manual/book.xml @@ -5,8 +5,8 @@ [ - - + + ]> @@ -28,34 +28,10 @@ &introduction; &installation; - - A Guided Tour - - - - - - Nix Syntax and Semantics - - - - - - Fix Language Reference - - - - - - Writing Builders - - - - Command Reference - &nix-reference; - &fix-reference; + &nix-store-reference; + &nix-instantiate-reference; &troubleshooting; diff --git a/doc/manual/installation.xml b/doc/manual/installation.xml index bec9ebb21..f9bd0a742 100644 --- a/doc/manual/installation.xml +++ b/doc/manual/installation.xml @@ -20,8 +20,8 @@ Nix can be obtained from its Subversion - repository. For example, the following command will check out + url='http://losser.st-lab.cs.uu.nl:12080/repos/trace/nix/trunk'>Subversion + repository. For example, the following command will check out the latest revision into a directory called nix: @@ -30,11 +30,11 @@ $ svn checkout http://losser.st-lab.cs.uu.nl:12080/repos/trace/nix/trunk nix Likewise, specific releases can be obtained from the tags - directory of the repository. If you don't have Subversion, you + url='http://losser.st-lab.cs.uu.nl:12080/repos/trace/nix/tags'>tags + directory of the repository. If you don't have Subversion, you can download a compressed - tar-file of the latest revision of the repository. + url='http://losser.st-lab.cs.uu.nl:12080/dist/trace/'>compressed + tar-file of the latest revision of the repository. @@ -63,9 +63,9 @@ $ make install - It is advisable not to change the installation - prefix, since doing so will in all likelihood make it impossible to use - derivates built on other systems. + It is advisable not to change the installation + prefix, since doing so will in all likelihood make it impossible to use + derivates built on other systems. diff --git a/doc/manual/introduction.xml b/doc/manual/introduction.xml index 5eea76459..feabeef9c 100644 --- a/doc/manual/introduction.xml +++ b/doc/manual/introduction.xml @@ -15,74 +15,74 @@ Build management - Build management tools are used to perform software - builds, that is, the construction of derived products - (derivates)) such as executable programs from - source code. A commonly used build tool is Make, which is a standard - tool on Unix systems. These tools have to deal with several issues: - + Build management tools are used to perform software + builds, that is, the construction of derived products + (derivates)) such as executable programs from + source code. A commonly used build tool is Make, which is a standard + tool on Unix systems. These tools have to deal with several issues: + - - - Efficiency. Since building large systems - can take a substantial amount of time, it is desirable that build - steps that have been performed in the past are not repeated - unnecessarily, i.e., if a new build differs from a previous build - only with respect to certain sources, then only the build steps - that (directly or indirectly) depend on - those sources should be redone. - - + + + Efficiency. Since building large systems + can take a substantial amount of time, it is desirable that build + steps that have been performed in the past are not repeated + unnecessarily, i.e., if a new build differs from a previous build + only with respect to certain sources, then only the build steps + that (directly or indirectly) depend on + those sources should be redone. + + - - - Correctness is this context means that the - derivates produced by a build are always consistent with the - sources, that is, they are equal to what we would get if we were - to build the derivates from those sources. This requirement is - trivially met when we do a full, unconditional build, but is far - from trivial under the requirement of efficiency, since it is not - easy to determine which derivates are affected by a change to a - source. - - + + + Correctness is this context means that the + derivates produced by a build are always consistent with the + sources, that is, they are equal to what we would get if we were + to build the derivates from those sources. This requirement is + trivially met when we do a full, unconditional build, but is far + from trivial under the requirement of efficiency, since it is not + easy to determine which derivates are affected by a change to a + source. + + - - - Variability is the property that a software - system can be built in a (potentially large) number of variants. - Variation exists both in time---the - evolution of different versions of an artifact---and in - space---the artifact might have - configuration options that lead to variants that differ in the - features they support (for example, a system might be built with - or without debugging information). - + + + Variability is the property that a software + system can be built in a (potentially large) number of variants. + Variation exists both in time---the + evolution of different versions of an artifact---and in + space---the artifact might have + configuration options that lead to variants that differ in the + features they support (for example, a system might be built with + or without debugging information). + - - Build managers historically have had good support for variation - in time (rebuilding the system in an intelligent way when sources - change is one of the primary reasons to use a build manager), but - not always for variation in space. For example, - make will not automatically ensure that - variant builds are properly isolated from each other (they will - in fact overwrite each other unless special precautions are - taken). - - + + Build managers historically have had good support for variation + in time (rebuilding the system in an intelligent way when sources + change is one of the primary reasons to use a build manager), but + not always for variation in space. For example, + make will not automatically ensure that + variant builds are properly isolated from each other (they will + in fact overwrite each other unless special precautions are + taken). + + - - - High-level system modelling language. The - language in which one describes what and how derivates are to be - produced should have sufficient abstraction facilities to make it - easy to specify the derivation of even very large systems. Also, - the language should be modular to enable - components from possible different sources to be easily combined. - - + + + High-level system modelling language. The + language in which one describes what and how derivates are to be + produced should have sufficient abstraction facilities to make it + easy to specify the derivation of even very large systems. Also, + the language should be modular to enable + components from possible different sources to be easily combined. + + - + @@ -91,33 +91,33 @@ Package management - After software has been built, is must also be - deployed in the intended target environment, e.g., - the user's workstation. Examples include the Red Hat package manager - (RPM), Microsoft's MSI, and so on. Here also we have several issues to - contend with: - - - - The creation of packages from some formal - description of what artifacts should be distributed in the - package. - - - - - The deployment of packages, that is, the - mechanism by which we get them onto the intended target - environment. This can be as simple as copying a file, but - complexity comes from the wide range of possible installation - media (such as a network install), and the scalability of the - process (if a program must be installed on a thousand systems, we - do not want to visit each system and perform some manual steps to - install the program on that system; that is, the complexity for - the system administrator should be constant, not linear). - - - + After software has been built, is must also be + deployed in the intended target environment, e.g., + the user's workstation. Examples include the Red Hat package manager + (RPM), Microsoft's MSI, and so on. Here also we have several issues to + contend with: + + + + The creation of packages from some formal + description of what artifacts should be distributed in the + package. + + + + + The deployment of packages, that is, the + mechanism by which we get them onto the intended target + environment. This can be as simple as copying a file, but + complexity comes from the wide range of possible installation + media (such as a network install), and the scalability of the + process (if a program must be installed on a thousand systems, we + do not want to visit each system and perform some manual steps to + install the program on that system; that is, the complexity for + the system administrator should be constant, not linear). + + + @@ -136,95 +136,95 @@ - - Reliable dependencies. Builds of file system - objects depend on other file system object, such as source files, - tools, and so on. We would like to ensure that a build does not - refer to any objects that have not been declared as inputs for that - build. This is important for several reasons. First, if any of the - inputs change, we need to rebuild the things that depend on them to - maintain consistency between sources and derivates. Second, when we - deploy file system objects (that is, copy them - to a different system), we want to be certain that we copy everything - that we need. - + + Reliable dependencies. Builds of file system + objects depend on other file system object, such as source files, + tools, and so on. We would like to ensure that a build does not + refer to any objects that have not been declared as inputs for that + build. This is important for several reasons. First, if any of the + inputs change, we need to rebuild the things that depend on them to + maintain consistency between sources and derivates. Second, when we + deploy file system objects (that is, copy them + to a different system), we want to be certain that we copy everything + that we need. + - - Nix ensures this by building and storing file system objects in paths - that are infeasible to predict in advance. For example, the - artifacts of a package X might be stored in - /nix/store/d58a0606ed616820de291d594602665d-X, - rather than in, say, /usr/lib. The path - component d58a... is actually a cryptographic - hash of all the inputs (i.e., sources, requisites, and build flags) - used in building X, and as such is very fragile: - any change to the inputs will change the hash. Therefore it is not - sensible to hard-code such a path into the build - scripts of a package Y that uses - X (as does happen with fixed paths - such as /usr/lib). Rather, the build script of - package Y is parameterised with the actual - location of X, which is supplied by the Nix - system. - + + Nix ensures this by building and storing file system objects in paths + that are infeasible to predict in advance. For example, the + artifacts of a package X might be stored in + /nix/store/d58a0606ed616820de291d594602665d-X, + rather than in, say, /usr/lib. The path + component d58a... is actually a cryptographic + hash of all the inputs (i.e., sources, requisites, and build flags) + used in building X, and as such is very fragile: + any change to the inputs will change the hash. Therefore it is not + sensible to hard-code such a path into the build + scripts of a package Y that uses + X (as does happen with fixed paths + such as /usr/lib). Rather, the build script of + package Y is parameterised with the actual + location of X, which is supplied by the Nix + system. + - - Support for variability. - - - - As stated above, the path name of a file system object contain a - cryptographic hash of all inputs involved in building it. A change to - any of the inputs will cause the hash to change--and by extension, - the path name. These inputs include both sources (variation in time) - and configuration options (variation in space). Therefore variants - of the same package don't clash---they can co-exist peacefully within - the same file system. So thanks to Nix's mechanism for reliably - dealing with dependencies, we obtain management of variants for free - (or, to quote Simon Peyton-Jone, it's not free, but it has already - been paid for). - + + Support for variability. + + + + As stated above, the path name of a file system object contain a + cryptographic hash of all inputs involved in building it. A change to + any of the inputs will cause the hash to change--and by extension, + the path name. These inputs include both sources (variation in time) + and configuration options (variation in space). Therefore variants + of the same package don't clash---they can co-exist peacefully within + the same file system. So thanks to Nix's mechanism for reliably + dealing with dependencies, we obtain management of variants for free + (or, to quote Simon Peyton-Jone, it's not free, but it has already + been paid for). + - - Transparent source/binary deployment. - + + Transparent source/binary deployment. + - - Easy configuration duplication. - + + Easy configuration duplication. + - - Automatic storage management. - + + Automatic storage management. + - - Atomic upgrades and rollbacks. - + + Atomic upgrades and rollbacks. + - - Support for many simultaneous configurations. - + + Support for many simultaneous configurations. + - - Portability. Nix is quite portable. Contrary - to build systems like those in, e.g., Vesta and ClearCase [sic?], it - does not rely on operating system extensions. - + + Portability. Nix is quite portable. Contrary + to build systems like those in, e.g., Vesta and ClearCase [sic?], it + does not rely on operating system extensions. + @@ -236,20 +236,20 @@ - - Build management. In principle it is already - possible to do build management using Fix (by writing builders that - perform appropriate build steps), but the Fix language is not yet - powerful enough to make this pleasant. The Maak build manager - should be retargeted to produce Nix expressions, or alternatively, - extend Fix with Maak's semantics and concrete syntax (since Fix needs - a concrete syntax anyway). Another interesting idea is to write a - make implementation that uses Nix as a back-end to - support legacy - build files. - + + Build management. In principle it is already + possible to do build management using Fix (by writing builders that + perform appropriate build steps), but the Fix language is not yet + powerful enough to make this pleasant. The Maak build manager + should be retargeted to produce Nix expressions, or alternatively, + extend Fix with Maak's semantics and concrete syntax (since Fix needs + a concrete syntax anyway). Another interesting idea is to write a + make implementation that uses Nix as a back-end to + support legacy + build files. + diff --git a/doc/manual/fix-reference.xml b/doc/manual/nix-instantiate-reference.xml similarity index 86% rename from doc/manual/fix-reference.xml rename to doc/manual/nix-instantiate-reference.xml index aac1be648..2e2749e43 100644 --- a/doc/manual/fix-reference.xml +++ b/doc/manual/nix-instantiate-reference.xml @@ -1,6 +1,6 @@ - fix + nix-instantiate generate Nix expressions from a high-level description @@ -8,8 +8,8 @@ fix - - + + files diff --git a/doc/manual/nix-reference.xml b/doc/manual/nix-reference.xml deleted file mode 100644 index d9c78ff07..000000000 --- a/doc/manual/nix-reference.xml +++ /dev/null @@ -1,444 +0,0 @@ - - - nix - manipulate or query the Nix store - - - - - nix - - - - - - - - - - - - - operation - options - arguments - - - - - Description - - - The command nix provides access to the Nix store. This - is the (set of) path(s) where Nix expressions and the file system objects - built by them are stored. - - - - nix has many subcommands called - operations. These are individually documented - below. Exactly one operation must always be provided. - - - - - - Common Options - - - In this section the options that are common to all Nix operations are - listed. These options are allowed for every subcommand (although they - may not always have an effect). - - - - - - - - - Indicates that any identifier arguments to the operation are paths - in the store rather than identifiers. - - - - - - - - - Increases the level of verbosity of diagnostic messages printed on - standard error. For each Nix operation, the information printed on - standard output is well-defined and specified below in the - respective sections. Any diagnostic information is printed on - standard error, never on standard output. - - - - This option may be specified repeatedly. Currently, the following - verbosity levels exist: - - - - - 0 - - - Print error messages only. - - - - - 1 - - - Print informational messages. - - - - - 2 - - - Print even more informational messages. - - - - - 3 - - - Print messages that should only be useful for debugging. - - - - - 4 - - - Vomit mode: print vast amounts of debug - information. - - - - - - - - - - - - - Specifies that in case of a build failure, the temporary directory - (usually in /tmp) in which the build takes - place should not be deleted. The path of the build directory is - printed as an informational message. - - - - - - - - - - - - - Operation <option>--install</option> - - - Synopsis - - nix - - - - - ids - - - - - Description - - - The operation realises the Nix expressions - identified by ids in the file system. If - these expressions are derivation expressions, they are first - normalised. That is, their target paths are are built, unless a normal - form is already known. - - - - The identifiers of the normal forms of the given Nix expressions are - printed on standard output. - - - - - - - - - - - Operation <option>--delete</option> - - - Synopsis - - nix - - - - - paths - - - - - Description - - - The operation unconditionally deletes the - paths paths from the Nix store. It is an - error to attempt to delete paths outside of the store. - - - - - This operation should almost never be called directly, since no - attempt is made to verify that no references exist to the paths to - be deleted. Therefore, careless deletion can result in an - inconsistent system. Deletion of paths in the store is done by the - garbage collector (which uses to delete - unreferenced paths). - - - - - - - - - - - - - Operation <option>--query</option> - - - Synopsis - - nix - - - - - - - - - - - - - - - - - - - - - - - args - - - - - Description - - - The operation displays various bits of - information about Nix expressions or paths in the store. The queries - are described in . At most one query - can be specified; the default query is . - - - - - - Queries - - - - - - - - Prints out the target paths of the Nix expressions indicated by - the identifiers args. In the case of - a derivation expression, these are the paths that will be - produced by the builder of the expression. In the case of a - slice expression, these are the root paths (which are generally - the paths that were produced by the builder of the derivation - expression of which the slice is a normal form). - - - - This query has one option: - - - - - - - - - Causes the target paths of the normal - forms of the expressions to be printed, rather - than the target paths of the expressions themselves. - - - - - - - - - - - - - - Prints out the requisite paths of the Nix expressions indicated - by the identifiers args. The - requisite paths of a Nix expression are the paths that need to be - present in the system to be able to realise the expression. That - is, they form the closure of the expression - in the file system (i.e., no path in the set of requisite paths - points to anything outside the set of requisite paths). - - - - The notion of requisite paths is very useful when one wants to - distribute Nix expressions. Since they form a closure, they are - the only paths one needs to distribute to another system to be - able to realise the expression on the other system. - - - - This query is generally used to implement various kinds of - distribution. A source distribution is - obtained by distributing the requisite paths of a derivation - expression. A binary distribution is - obtained by distributing the requisite paths of a slice - expression (i.e., the normal form of a derivation expression; you - can directly specify the identifier of the slice expression, or - use and specify the identifier of a - derivation expression). A cache - distribution is obtained by distributing the - requisite paths of a derivation expression and specifying the - option . This will include - not just the paths of a source and binary distribution, but also - all expressions and paths of subterms of the source. This is - useful if one wants to realise on the target system a Nix - expression that is similar but not quite the same as the one - being distributed, since any common subterms will be reused. - - - - This query has a number of options: - - - - - - - - - Causes the requisite paths of the normal - forms of the expressions to be printed, rather - than the requisite paths of the expressions themselves. - - - - - - - - - Excludes the paths of Nix expressions. This causes the - closure property to be lost, that is, the resulting set of - paths is not enough to ensure realisibility. - - - - - - - - - Also include the requisites of successors (normal forms). - Only the requisites of known - successors are included, i.e., the normal forms of - derivation expressions that have never been normalised will - not be included. - - - - Note that not just the successor of a derivation expression - will be included, but also the successors of all input - expressions of that derivation expression. I.e., all - normal forms of subterms involved in the normalisation of - the top-level term are included. - - - - - - - - - - - - - - For each identifier in args, prints - all expansions of that identifier, that is, all paths whose - current content matches the identifier. - - - - - - - - - Prints a graph of the closure of the expressions identified by - args in the format of the - dot tool of AT&T's GraphViz package. - - - - - - - - - - - - - - - diff --git a/doc/manual/nix-store-reference.xml b/doc/manual/nix-store-reference.xml new file mode 100644 index 000000000..686fe4c15 --- /dev/null +++ b/doc/manual/nix-store-reference.xml @@ -0,0 +1,444 @@ + + + nix-store + manipulate or query the Nix store + + + + + nix-store + + + + + + + + + + + + + operation + options + arguments + + + + + Description + + + The command nix provides access to the Nix store. This + is the (set of) path(s) where Nix expressions and the file system objects + built by them are stored. + + + + nix has many subcommands called + operations. These are individually documented + below. Exactly one operation must always be provided. + + + + + + Common Options + + + In this section the options that are common to all Nix operations are + listed. These options are allowed for every subcommand (although they + may not always have an effect). + + + + + + + + + Indicates that any identifier arguments to the operation are paths + in the store rather than identifiers. + + + + + + + + + Increases the level of verbosity of diagnostic messages printed on + standard error. For each Nix operation, the information printed on + standard output is well-defined and specified below in the + respective sections. Any diagnostic information is printed on + standard error, never on standard output. + + + + This option may be specified repeatedly. Currently, the following + verbosity levels exist: + + + + + 0 + + + Print error messages only. + + + + + 1 + + + Print informational messages. + + + + + 2 + + + Print even more informational messages. + + + + + 3 + + + Print messages that should only be useful for debugging. + + + + + 4 + + + Vomit mode: print vast amounts of debug + information. + + + + + + + + + + + + + Specifies that in case of a build failure, the temporary directory + (usually in /tmp) in which the build takes + place should not be deleted. The path of the build directory is + printed as an informational message. + + + + + + + + + + + + + Operation <option>--install</option> + + + Synopsis + + nix + + + + + ids + + + + + Description + + + The operation realises the Nix expressions + identified by ids in the file system. If + these expressions are derivation expressions, they are first + normalised. That is, their target paths are are built, unless a normal + form is already known. + + + + The identifiers of the normal forms of the given Nix expressions are + printed on standard output. + + + + + + + + + + + Operation <option>--delete</option> + + + Synopsis + + nix + + + + + paths + + + + + Description + + + The operation unconditionally deletes the + paths paths from the Nix store. It is an + error to attempt to delete paths outside of the store. + + + + + This operation should almost never be called directly, since no + attempt is made to verify that no references exist to the paths to + be deleted. Therefore, careless deletion can result in an + inconsistent system. Deletion of paths in the store is done by the + garbage collector (which uses to delete + unreferenced paths). + + + + + + + + + + + + + Operation <option>--query</option> + + + Synopsis + + nix + + + + + + + + + + + + + + + + + + + + + + + args + + + + + Description + + + The operation displays various bits of + information about Nix expressions or paths in the store. The queries + are described in . At most one query + can be specified; the default query is . + + + + + + Queries + + + + + + + + Prints out the target paths of the Nix expressions indicated by + the identifiers args. In the case of + a derivation expression, these are the paths that will be + produced by the builder of the expression. In the case of a + slice expression, these are the root paths (which are generally + the paths that were produced by the builder of the derivation + expression of which the slice is a normal form). + + + + This query has one option: + + + + + + + + + Causes the target paths of the normal + forms of the expressions to be printed, rather + than the target paths of the expressions themselves. + + + + + + + + + + + + + + Prints out the requisite paths of the Nix expressions indicated + by the identifiers args. The + requisite paths of a Nix expression are the paths that need to be + present in the system to be able to realise the expression. That + is, they form the closure of the expression + in the file system (i.e., no path in the set of requisite paths + points to anything outside the set of requisite paths). + + + + The notion of requisite paths is very useful when one wants to + distribute Nix expressions. Since they form a closure, they are + the only paths one needs to distribute to another system to be + able to realise the expression on the other system. + + + + This query is generally used to implement various kinds of + distribution. A source distribution is + obtained by distributing the requisite paths of a derivation + expression. A binary distribution is + obtained by distributing the requisite paths of a slice + expression (i.e., the normal form of a derivation expression; you + can directly specify the identifier of the slice expression, or + use and specify the identifier of a + derivation expression). A cache + distribution is obtained by distributing the + requisite paths of a derivation expression and specifying the + option . This will include + not just the paths of a source and binary distribution, but also + all expressions and paths of subterms of the source. This is + useful if one wants to realise on the target system a Nix + expression that is similar but not quite the same as the one + being distributed, since any common subterms will be reused. + + + + This query has a number of options: + + + + + + + + + Causes the requisite paths of the normal + forms of the expressions to be printed, rather + than the requisite paths of the expressions themselves. + + + + + + + + + Excludes the paths of Nix expressions. This causes the + closure property to be lost, that is, the resulting set of + paths is not enough to ensure realisibility. + + + + + + + + + Also include the requisites of successors (normal forms). + Only the requisites of known + successors are included, i.e., the normal forms of + derivation expressions that have never been normalised will + not be included. + + + + Note that not just the successor of a derivation expression + will be included, but also the successors of all input + expressions of that derivation expression. I.e., all + normal forms of subterms involved in the normalisation of + the top-level term are included. + + + + + + + + + + + + + + For each identifier in args, prints + all expansions of that identifier, that is, all paths whose + current content matches the identifier. + + + + + + + + + Prints a graph of the closure of the expressions identified by + args in the format of the + dot tool of AT&T's GraphViz package. + + + + + + + + + + + + + + +