about summary refs log tree commit diff
path: root/src/libstore
AgeCommit message (Collapse)AuthorFilesLines
2017-05-04 Linux sandbox: Use /build instead of /tmp as $TMPDIREelco Dolstra1-5/+15
There is a security issue when a build accidentally stores its $TMPDIR in some critical place, such as an RPATH. If TMPDIR=/tmp/nix-build-..., then any user on the system can recreate that directory and inject libraries into the RPATH of programs executed by other users. Since /build probably doesn't exist (or isn't world-writable), this mitigates the issue.
2017-05-02 LocalStoreAccessor: Fix handling of diverted storesEelco Dolstra1-3/+4
2017-05-02 Replace $NIX_REMOTE_SYSTEMS with an option "builder-files"Eelco Dolstra4-14/+34
Also, to unify with hydra-queue-runner, allow it to be a list of files.
2017-05-02 build-remote: Fix fallback to other machines when connecting failsEelco Dolstra4-1/+18
Opening an SSHStore or LegacySSHStore does not actually establish a connection, so the try/catch block here did nothing. Added a Store::connect() method to test whether a connection can be established.
2017-05-02 Add an option for specifying remote buildersEelco Dolstra4-2/+24
This is useful for one-off situations where you want to specify a builder on the command line instead of having to mess with nix.machines. E.g. $ nix-build -A hello --argstr system x86_64-darwin \ --option builders 'root@macstadium1 x86_64-darwin' will perform the specified build on "macstadium1". It also removes the need for a separate nix.machines file since you can specify builders in nix.conf directly. (In fact nix.machines is yet another hack that predates the general nix.conf configuration file, IIRC.) Note: this option is supported by the daemon for trusted users. The fact that this allows trusted users to specify paths to SSH keys to which they don't normally have access is maybe a bit too much trust...
2017-05-02 Factor out machines.conf parsingEelco Dolstra2-0/+100
This allows hydra-queue-runner to use it.
2017-05-02 build-hook: If there are no machines defined, quit permanentlyEelco Dolstra1-2/+9
2017-05-02 build-remote: Ugly hackery to get build logs to workEelco Dolstra3-2/+10
The build hook mechanism expects build log output to go to file descriptor 4, so do that.
2017-05-01 build-remote: Don't require signaturesEelco Dolstra4-13/+17
This restores the old behaviour.
2017-05-01 Support arbitrary store URIs in nix.machinesEelco Dolstra3-13/+22
For backwards compatibility, if the URI is just a hostname, ssh:// (i.e. LegacySSHStore) is prepended automatically. Also, all fields except the URI are now optional. For example, this is a valid nix.machines file: local?root=/tmp/nix This is useful for testing the remote build machinery since you don't have to mess around with ssh.
2017-05-01 Implement LegacySSHStore::buildDerivation()Eelco Dolstra1-5/+32
This makes LegacySSHStore usable by build-remote and hydra-queue-runner.
2017-05-01 Chomp log output from the build hookEelco Dolstra1-1/+1
2017-05-01 Remove $NIX_BUILD_HOOK and $NIX_CURRENT_LOADEelco Dolstra2-8/+7
This is to simplify remote build configuration. These environment variables predate nix.conf. The build hook now has a sensible default (namely build-remote). The current load is kept in the Nix state directory now.
2017-05-01 build-remote: Don't copy the .drv closureEelco Dolstra1-14/+3
Since build-remote uses buildDerivation() now, we don't need to copy the .drv file anymore. This greatly reduces the set of input paths copied to the remote side (e.g. from 392 to 51 store paths for GNU hello on x86_64-darwin).
2017-05-01 Pass verbosity level to build hookEelco Dolstra1-3/+4
2017-05-01 Reduce severity of EMLINK warningsEelco Dolstra1-2/+1
Fixes #1357.
2017-05-01 Add a dummy Store::buildPaths() methodEelco Dolstra5-38/+36
This default implementation of buildPaths() does nothing if all requested paths are already valid, and throws an "unsupported operation" error otherwise. This fixes a regression introduced by c30330df6f67c81986dfb124631bc756c8e58c0d in binary cache and legacy SSH stores.
2017-04-28 Fix brainfartEelco Dolstra1-1/+1
2017-04-26 Add Store nesting to fix import-from-derivation within filterSourceShea Levy1-0/+2
2017-04-24 Remove debug statementEelco Dolstra1-1/+0
2017-04-20 Detect lsofEelco Dolstra2-4/+10
Also, don't use lsof on Linux since it's not needed. Fixes #1328.
2017-04-20 Improve nix show-config --jsonEelco Dolstra1-0/+5
In particular, show descriptions. This could be used for manpage generation etc.
2017-04-20 Setting: Remove "Tag" template argumentEelco Dolstra2-23/+38
2017-04-20 Read per-user settings from ~/.config/nix/nix.confEelco Dolstra3-11/+7
2017-04-20 binary-caches-parallel-connections -> http-connectionsEelco Dolstra1-2/+3
2017-04-20 Reimplement trusted-substituters (aka trusted-binary-caches)Eelco Dolstra1-0/+4
2017-04-19 Reimplement connect-timeoutEelco Dolstra2-0/+5
Fixes #1339.
2017-04-14 Shut up some warningsEelco Dolstra2-8/+8
2017-04-14 DohEelco Dolstra1-1/+1
2017-04-13 Convert Settings to the new config systemEelco Dolstra8-458/+205
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Merge branch 'rework-options' of https://github.com/copumpkin/nixEelco Dolstra8-88/+217
2017-04-13 Add a Config class to simplify adding configuration settingsEelco Dolstra13-40/+69
The typical use is to inherit Config and add Setting<T> members: class MyClass : private Config { Setting<int> foo{this, 123, "foo", "the number of foos to use"}; Setting<std::string> bar{this, "blabla", "bar", "the name of the bar"}; MyClass() : Config(readConfigFile("/etc/my-app.conf")) { std::cout << foo << "\n"; // will print 123 unless overriden } }; Currently, this is used by Store and its subclasses for store parameters. You now get a warning if you specify a non-existant store parameter in a store URI.
2017-04-10 Merge pull request #1316 from copumpkin/nix-retries-defaultEelco Dolstra1-1/+1
Default to 5 download retries
2017-04-10 Add CURLE_WRITE_ERROR as a transient error conditionDan Peebles1-0/+5
We've observed it failing downloads in the wild and retrying the same URL a few moments later seemed to fix it.
2017-04-10 Default to 5 download retriesDan Peebles1-1/+1
This should help certain downloaders that don't request anything special for the number of retries, like nix-channel.
2017-04-10 Minor cleanupEelco Dolstra3-15/+5
Also, possible fix for #1310 on 32-bit systems.
2017-04-10 Allow "auto" as a store URIEelco Dolstra1-1/+1
Using the empty string is likely to be ambiguous in some contexts.
2017-04-06 Retry downloads on transient SSL errors tooDan Peebles1-0/+2
2017-04-06 Implement RemoteStore::queryMissing()Eelco Dolstra4-3/+33
This provides a significant speedup, e.g. 64 s -> 12 s for nix-build --dry-run -I nixpkgs=channel:nixos-16.03 '<nixpkgs/nixos/tests/misc.nix>' -A test on a cold local and CloudFront cache. The alternative is to use lots of concurrent daemon connections but that seems wasteful.
2017-04-06 Add a method to allow hydra-queue-runner to flush the path info cacheEelco Dolstra1-5/+7
2017-04-06 nix-daemon: Disable path info cacheEelco Dolstra2-1/+7
This is useless because the client also caches path info, and can cause problems for long-running clients like hydra-queue-runner (i.e. it may return cached info about paths that have been garbage-collected).
2017-04-04 Allow default sandbox paths to be overridenEelco Dolstra1-1/+1
E.g. you can now redirect /etc/resolv.conf to a different file.
2017-04-04 Make /var/run/nscd/socket optionalEelco Dolstra1-1/+2
Not every distribution uses nscd.
2017-03-31 Sandbox: Fix /dev/ptmx on recent kernelsEelco Dolstra1-8/+1
This fixes "No such file or directory" when opening /dev/ptmx (e.g. http://hydra.nixos.org/build/51094249). The reason appears to be some changes to /dev/ptmx / /dev/pts handling between Linux 4.4 and 4.9. See https://patchwork.kernel.org/patch/7832531/. The fix is to go back to mounting a proper /dev/pts instance inside the sandbox. Happily, this now works inside user namespaces, even for unprivileged users. So NIX_REMOTE=local?root=/tmp/nix nix-build \ '<nixpkgs/nixos/tests/misc.nix>' -A test works for non-root users. The downside is that the fix breaks sandbox builds on older kernels (probably pre-4.6), since mounting a devpts fails inside user namespaces for some reason I've never been able to figure out. Builds on those systems will fail with error: while setting up the build environment: mounting /dev/pts: Invalid argument Ah well.
2017-03-31 Merge branch 'builtins.exec'Shea Levy2-4/+4
2017-03-31 Retry curl error 16Eelco Dolstra1-0/+1
2017-03-30 Add exec primop behind allow-unsafe-native-code-during-evaluation.Shea Levy2-4/+4
Execute a given program with the (optional) given arguments as the user running the evaluation, parsing stdout as an expression to be evaluated. There are many use cases for nix that would benefit from being able to run arbitrary code during evaluation, including but not limited to: * Automatic git fetching to get a sha256 from a git revision * git rev-parse HEAD * Automatic extraction of information from build specifications from other tools, particularly language-specific package managers like cabal or npm * Secrets decryption (e.g. with nixops) * Private repository fetching Ideally, we would add this functionality in a more principled way to nix, but in the mean time 'builtins.exec' can be used to get these tasks done. The primop is only available when the 'allow-unsafe-native-code-during-evaluation' nix option is true. That flag also enables the 'importNative' primop, which is strictly more powerful but less convenient (since it requires compiling a plugin against the running version of nix).
2017-03-28 Ignore broken "Deriver: unknown-deriver" fields in .narinfoEelco Dolstra1-3/+5
These were generated by a legacy tool.
2017-03-21 LocalFSStore::getBuildLog(): Handle corrupted logsEelco Dolstra1-2/+7
2017-03-21 Only use cache.nixos.org when the store is /nix/storeEelco Dolstra1-1/+5
This is consistent with the behaviour of the old download-from-binary-cache substituter.