about summary refs log tree commit diff
path: root/src/libstore
AgeCommit message (Collapse)AuthorFilesLines
2014-05-15 Remove tabEelco Dolstra1-2/+2
2014-05-15 Shortcut store files before lstatWout Mertens2-9/+37
readdir() already returns the inode numbers, so we don't need to call lstat to know if a file was already linked or not.
2014-05-14 Use the inodes given by readdir directlyWout Mertens2-21/+25
2014-05-13 Preload linked hashes to speed up lookupsWout Mertens2-10/+41
By preloading all inodes in the /nix/store/.links directory, we can quickly determine of a hardlinked file was already linked to the hashed links. This is tolerant of removing the .links directory, it will simply recalculate all hashes in the store.
2014-05-10 Shortcut already-hardlinked fileswmertens1-1/+10
If an inode in the Nix store has more than 1 link, it probably means that it was linked into .links/ by us. If so, skip. There's a possibility that something else hardlinked the file, so it would be nice to be able to override this. Also, by looking at the number of hardlinks for each of the files in .links/, you can get deduplication numbers and space savings.
2014-05-02 Set up directories and permissions for multi-user install automaticallyEelco Dolstra1-1/+28
This automatically creates /nix/var/nix/profiles/per-user and sets the permissions/ownership on /nix/store to 1775 and root:nixbld.
2014-05-02 Set build-max-jobs to the number of available cores by defaultEelco Dolstra1-0/+5
More zero configuration.
2014-05-02 When running as root, use build users by defaultEelco Dolstra1-0/+1
This removes the need to have a nix.conf, and prevents people from accidentally running Nix builds as root.
2014-04-08 If a .drv cannot be parsed, show its pathEelco Dolstra4-8/+18
Otherwise you just get ‘expected string `Derive(['’ which isn't very helpful.
2014-04-03 Fix compile errors on IllumosDanny Wilson2-0/+5
2014-04-03 Make sure /dev/pts/ptmx is world-writableLudovic Courtès1-0/+4
While running Python 3’s test suite, we noticed that on some systems /dev/pts/ptmx is created with permissions 0 (that’s the case with my Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating 3.10-3 reported not having this problem.) There’s still the problem that people without CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc), but I don’t see how we could work around it.
2014-03-30 boost::shared_ptr -> std::shared_ptrEelco Dolstra4-31/+34
2014-03-29 Fix potential segfault in waitForInput()Eelco Dolstra1-3/+5
Since the addition of build-max-log-size, a call to handleChildOutput() can result in cancellation of a goal. This invalidated the "j" iterator in the waitForInput() loop, even though it was still used afterwards. Likewise for the maxSilentTime handling. Probably fixes #231. At least it gets rid of the valgrind warnings.
2014-03-29 restoreSIGPIPE(): Fill in sa_maskEelco Dolstra1-0/+1
Issue #231.
2014-03-21 Make /dev/kvm optionalLudovic Courtès1-1/+4
The daemon now creates /dev deterministically (thanks!). However, it expects /dev/kvm to be present. The patch below restricts that requirement (1) to Linux-based systems, and (2) to systems where /dev/kvm already exists. I’m not sure about the way to handle (2). We could special-case /dev/kvm and create it (instead of bind-mounting it) in the chroot, so it’s always available; however, it wouldn’t help much since most likely, if /dev/kvm missing, then KVM support is missing.
2014-02-27 Set up a private /dev/pts in the chrootEelco Dolstra2-2/+14
2014-02-27 Set up a minimal /dev in chrootsEelco Dolstra4-13/+28
Not bind-mounting the /dev from the host also solves the problem with /dev/shm being a symlink to something not in the chroot.
2014-02-27 Fix deadlock in SubstitutionGoalEelco Dolstra1-0/+1
We were relying on SubstitutionGoal's destructor releasing the lock, but if a goal is a top-level goal, the destructor won't run in a timely manner since its reference count won't drop to zero. So release it explicitly. Fixes #178.
2014-02-26 Only start download-via-ssh if it's enabledEelco Dolstra1-12/+14
2014-02-26 Add use-ssh-substituter setting.Shea Levy2-0/+5
It defaults to false and can be overridden by RemoteStore. Untested currently, just quickly put this together
2014-02-18 Slight simplificationEelco Dolstra1-17/+10
2014-02-18 Add a flag ‘--check’ to verify build determinismEelco Dolstra5-49/+86
The flag ‘--check’ to ‘nix-store -r’ or ‘nix-build’ will cause Nix to redo the build of a derivation whose output paths are already valid. If the new output differs from the original output, an error is printed. This makes it easier to test if a build is deterministic. (Obviously this cannot catch all sources of non-determinism, but it catches the most common one, namely the current time.) For example: $ nix-build '<nixpkgs>' -A patchelf ... $ nix-build '<nixpkgs>' -A patchelf --check error: derivation `/nix/store/1ipvxsdnbhl1rw6siz6x92s7sc8nwkkb-patchelf-0.6' may not be deterministic: hash mismatch in output `/nix/store/4pc1dmw5xkwmc6q3gdc9i5nbjl4dkjpp-patchelf-0.6.drv' The --check build fails if not all outputs are valid. Thus the first call to nix-build is necessary to ensure that all outputs are valid. The current outputs are left untouched: the new outputs are either put in a chroot or diverted to a different location in the store using hash rewriting.
2014-02-17 Make --repair work on DarwinEelco Dolstra1-3/+3
Mac OS X doesn't allow renaming a read-only directory. http://hydra.nixos.org/build/9113895
2014-02-17 RefactoringEelco Dolstra1-29/+36
2014-02-17 When using a build hook, only copy missing pathsEelco Dolstra1-9/+6
2014-02-17 Move some code aroundEelco Dolstra1-92/+82
In particular, do replacing of valid paths during repair later. This prevents us from replacing a valid path after the build fails.
2014-02-17 Heuristically detect if a build may have failed due to a full diskEelco Dolstra2-5/+28
This will allow Hydra to detect that a build should not be marked as "permanently failed", allowing it to be retried later.
2014-02-14 Minor style fixesEelco Dolstra2-2/+2
2014-02-10 Move StoreApi::serve into opServeShea Levy2-38/+0
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-10 Pass in params by const refShea Levy2-2/+2
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 Add download-via-ssh substituterShea Levy2-0/+26
This substituter connects to a remote host, runs nix-store --serve there, and then forwards substituter commands on to the remote host and sends their results to the calling program. The ssh-substituter-hosts option can be specified as a list of hosts to try. This is an initial implementation and, while it works, it has some limitations: * Only the first host is used * There is no caching of query results (all queries are sent to the remote machine) * There is no informative output (such as progress bars) * Some failure modes may cause unhelpful error messages * There is no concept of trusted-ssh-substituter-hosts Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Flush out after every loopShea Levy2-2/+3
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Use dump instead of exportShea Levy2-3/+4
Also remove signing support Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Don't fail if asked for info about non-valid pathShea Levy1-0/+2
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 nix-store --serve: Don't loop foreverShea Levy1-26/+25
nix-store --export takes a tmproot, which can only release by exiting. Substituters don't currently work in a way that could take advantage of the looping, anyway. Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-08 Add the nix-store --serve commandShea Levy2-0/+35
This is essentially the substituter API operating on the local store, which will be used by the ssh substituter. It runs in a loop rather than just taking one command so that in the future nix will be able to keep one connection open for multiple instances of the substituter. Signed-off-by: Shea Levy <shea@shealevy.com>
2014-02-03 Fix assertion failure in ‘nix-store --load-db’Eelco Dolstra1-1/+12
Namely: nix-store: derivations.cc:242: nix::Hash nix::hashDerivationModulo(nix::StoreAPI&, nix::Derivation): Assertion `store.isValidPath(i->first)' failed. This happened because of the derivation output correctness check being applied before the references of a derivation are valid.
2014-02-01 Give a friendly error message if the DB directory is not writableEelco Dolstra1-2/+6
Previously we would say "error: setting synchronous mode: unable to open database file" which isn't very helpful.
2014-02-01 Fix "make dist"Eelco Dolstra1-1/+3
2014-02-01 Remove AutomakefilesEelco Dolstra1-33/+0
2014-02-01 Update Makefile variable namesEelco Dolstra1-1/+1
2014-01-30 Rename Makefile -> local.mkEelco Dolstra1-0/+0
2014-01-21 Fix some clang warningsEelco Dolstra2-6/+1
2014-01-21 Merge branch 'master' into makeEelco Dolstra2-2/+7
Conflicts: src/libexpr/eval.cc
2014-01-09 Generate schema.sql.hhEelco Dolstra1-0/+5
2014-01-09 Update MakefilesEelco Dolstra1-3/+1
2014-01-08 Fix checking of NAR hashesEelco Dolstra1-0/+1
*headdesk* *headdesk* *headdesk* So since commit 22144afa8d9f8968da351618a1347072a93bd8aa, Nix hasn't actually checked whether the content of a downloaded NAR matches the hash specified in the manifest / NAR info file. Urghhh...
2014-01-06 wordingDomen Kožar1-1/+1
2013-12-10 Garbage collector: Release locks on temporary root filesEelco Dolstra1-0/+1
This allows processes waiting for such locks to proceed during the trash deletion phase of the garbage collector.
2013-12-05 Print a trace message if a build fails due to the platform being unknownEelco Dolstra1-1/+4