aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2012-05-30"nix-store -l": support compressed logsEelco Dolstra
2012-05-29Reserve some disk space for the garbage collectorEelco Dolstra
We can't open a SQLite database if the disk is full. Since this prevents the garbage collector from running when it's most needed, we reserve some dummy space that we can free just before doing a garbage collection. This actually revives some old code from the Berkeley DB days. Fixes #27.
2012-05-29Add option ‘build-keep-log’ to enable/disable writing of build logsEelco Dolstra
Fixes #26.
2012-04-30* Add an option ‘build-use-substitutes’, which can be set to ‘false’Eelco Dolstra
to disable use of substitutes; i.e., force building from source. Fixes Nix/221.
2012-04-30Handle EPERM when creating a hard link for the chrootEelco Dolstra
There is a race condition when doing parallel builds with chroots and the immutable bit enabled. One process may call makeImmutable() before the other has called link(), in which case link() will fail with EPERM. We could retry or wrap the operation in a lock, but since this condition is rare and I'm lazy, we just use the existing copy fallback. Fixes #9.
2012-04-23Merge pull request #2 from viric/masterEelco Dolstra
Again, adding the sync option
2012-04-17nix-instantiate: default to "default.nix" if no arguments are givenEelco Dolstra
2012-04-17Added utility command ‘nix-instantiate --find-file’ to look up a file in ↵Eelco Dolstra
Nix's search path
2012-04-16Fix obscure race condition in GC root creationEelco Dolstra
This should fix rare Hydra errors of the form: error: symlinking `/nix/var/nix/gcroots/per-user/hydra/hydra-roots/7sfhs5fdmjxm8sqgcpd0pgcsmz1kq0l0-nixos-iso-0.1pre33785-33795' to `/nix/store/7sfhs5fdmjxm8sqgcpd0pgcsmz1kq0l0-nixos-iso-0.1pre33785-33795': File exists
2012-04-15Set a few more close-on-exec flagsEelco Dolstra
2012-04-15Close almost all file descriptors in the builderEelco Dolstra
This regression was accidentally introduced in 35355fc1fcffbe859395e360c0a6a1463f137d63.
2012-04-14Remove unnecessary "system" argumentEelco Dolstra
2012-04-13Use Bison 2.5Eelco Dolstra
2012-04-05On Linux, pretend we're building on Linux 2.6Eelco Dolstra
Setting the UNAME26 personality causes "uname" to return "2.6.x", regardless of the kernel version. This improves determinism in a few misbehaved packages.
2012-04-04Include --keep-going in --helpEelco Dolstra
2012-03-26Mac OS X fixEelco Dolstra
2012-03-26Delete non-directory valid paths right awayEelco Dolstra
It's unlikely that rename() is faster than unlink() on a regular file or symlink, so don't bother.
2012-03-26Make the garbage collector more concurrentEelco Dolstra
Make the garbage collector more concurrent by deleting valid paths outside the region where we're holding the global GC lock. This should greatly reduce the time during which new builds are blocked, since the deletion accounts for the vast majority of the time spent in the GC. To ensure that this is safe, the valid paths are invalidated and renamed to some arbitrary path while we're holding the lock. This ensures that we when we finally delete the path, it's not a (newly) valid or locked path.
2012-03-26Remove the --max-links GC optionEelco Dolstra
We don't need this anymore now that current filesystems support more than 32,000 files in a directory.
2012-03-22Fixing the default of sync-before-registeringLluís Batlle i Rossell
Setting 'false' as default, as suggested by Eelco. I also added a comment about the setting in the code.
2012-03-22Adding a nix option to sync before registering a path, for non-ext*Lluís Batlle i Rossell
filesystems.
2012-03-20nix-store --clear-failed-paths: Clear derivation outputsEelco Dolstra
If the argument to ‘nix-store --clear-failed-paths’ is a derivation, then clear the failed state of its outputs.
2012-03-18Drop the externals directoryEelco Dolstra
Nix now requires SQLite and bzip2 to be pre-installed. SQLite is detected using pkg-config. We required DBD::SQLite anyway, so depending on SQLite is not a big problem. The --with-bzip2, --with-openssl and --with-sqlite flags are gone.
2012-03-13Ensure that Perl processes delete their entry in the temproots directoryEelco Dolstra
By moving the destructor object to libstore.so, it's also run when download-using-manifests and nix-prefetch-url exit. This prevents them from cluttering /nix/var/nix/temproots with stale files.
2012-03-05Fix compilation on FreeBSDEelco Dolstra
http://hydra.nixos.org/build/2213576 Not sure why compilation doesn't fail on other platforms...
2012-03-05Set the close-on-exec flag on file descriptorsEelco Dolstra
2012-03-05Don't leak a file descriptor in commonChildInit()Eelco Dolstra
2012-03-05nix-worker: put the pid of the caller in argv[1]Eelco Dolstra
This is useful for debugging.
2012-03-05Restore progress indication during nix-copy-closureEelco Dolstra
2012-03-01Remove dependency on sqlite3_table_column_metadataEelco Dolstra
Not all SQLite builds have the function sqlite3_table_column_metadata. We were only using it in a schema upgrade check for compatibility with databases that were probably never seen in the wild. So remove it.
2012-03-01Fix an uninitialised variableEelco Dolstra
The variable ‘useChroot’ was not initialised properly. This caused random failures if using the build hook. Seen on Mac OS X 10.7 with Clang. Thanks to KolibriFX for finding this :-)
2012-02-18Fix chroots buildsEelco Dolstra
Chroots are initialised by hard-linking inputs from the Nix store to the chroot. This doesn't work if the input has its immutable bit set, because it's forbidden to create hard links to immutable files. So temporarily clear the immutable bit when creating and destroying the chroot. Note that making regular files in the Nix store immutable isn't very reliable, since the bit can easily become cleared: for instance, if we run the garbage collector after running ‘nix-store --optimise’. So maybe we should only make directories immutable.
2012-02-15On Linux, make the Nix store really read-only by using the immutable bitEelco Dolstra
I was bitten one time too many by Python modifying the Nix store by creating *.pyc files when run as root. On Linux, we can prevent this by setting the immutable bit on files and directories (as in ‘chattr +i’). This isn't supported by all filesystems, so it's not an error if setting the bit fails. The immutable bit is cleared by the garbage collector before deleting a path. The only tricky aspect is in optimiseStore(), since it's forbidden to create hard links to an immutable file. Thus optimiseStore() temporarily clears the immutable bit before creating the link.
2012-02-15Fix a broken guard around utime()Eelco Dolstra
Because of an outdated check for a timestamp of 0, we were calling utime() even when it wasn't necessary.
2012-02-15Don't use deletePath() to delete a single fileEelco Dolstra
2012-02-09Fix error messageEelco Dolstra
This fixes the error message error: file `' was not found in the Nix search path (add it using $NIX_PATH or -I)
2012-02-09Use data() instead of c_str() where appropriateEelco Dolstra
2012-02-04* Inline some functions and get rid of the indirection throughEelco Dolstra
EvalState::eval(). This gives a 12% speedup on ‘nix-instantiate /etc/nixos/nixos/ -A system --readonly-mode’ (from 1.01s to 0.89s).
2012-02-04* Print elapsed evaluation time.Eelco Dolstra
2012-01-26* Fix importing a derivation. This gave a segfault.Eelco Dolstra
2012-01-19* Allow comparisons between derivations by comparing the outPathEelco Dolstra
attributes.
2012-01-19* Add some debug output to print the derivation name once it's known.Eelco Dolstra
This makes it easier to pinpoint the source of a crash.
2012-01-17* Added a command ‘nix-store --print-env $drvpath’ that prints out theEelco Dolstra
environment of the given derivation in a format that can be sourced by the shell, e.g. $ eval "$(nix-store --print-env $(nix-instantiate /etc/nixos/nixpkgs -A pkg))" $ NIX_BUILD_TOP=/tmp $ source $stdenv/setup This is especially useful to reproduce the environment used to build a package outside of its builder for development purposes. TODO: add a nix-build option to do the above and fetch the dependencies of the derivation as well.
2012-01-07* Don't create thunks for simple constants (integers, strings, paths)Eelco Dolstra
and allocate them only once. * Move Value and related functions into value.hh.
2012-01-04* Remove dead code.Eelco Dolstra
2012-01-04* Don't use dynamic_cast, it's very slow. "nix-instantiateEelco Dolstra
/etc/nixos/nixos -A system" spent about 10% of its time in dynamic_cast.
2012-01-03* Drop the inefficient "Path" suffix in output attribute names.Eelco Dolstra
2012-01-03* Move the implementation of the ‘derivation’ primop into a separateEelco Dolstra
file.
2012-01-03* Sync with the trunk.Eelco Dolstra
2012-01-03* Refactoring: Get rid of a few subdirectories in corepkgs/, and someEelco Dolstra
other simplifications. * Use <nix/...> to locate the corepkgs. This allows them to be overriden through $NIX_PATH. * Use bash's pipefail option in the NAR builder so that we don't need to create a temporary file.