aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-07-11Allow $NIX_BUILD_HOOK to be relative to Nix libexec directoryEelco Dolstra
2014-07-10Fix broken Pid constructorEelco Dolstra
2014-07-10Replace message "importing path <...>" with "exporting path <...>"Eelco Dolstra
This causes nix-copy-closure to show what it's doing before rather than after.
2014-07-10Fix use of sysreadEelco Dolstra
2014-07-10nix-copy-closure -s: Do substitutions via ‘nix-store --serve’Eelco Dolstra
This means we no longer need an SSH master connection, since we only execute a single command on the remote host.
2014-07-10nix-copy-closure: Fix --dry-runEelco Dolstra
2014-07-10Remove tabsEelco Dolstra
2014-07-10Refactoring: Move all fork handling into a higher-order functionEelco Dolstra
C++11 lambdas ftw.
2014-07-10nix-copy-closure: Restore compression and the progress viewerEelco Dolstra
2014-07-10Remove maybeVforkEelco Dolstra
2014-07-10nix-copy-closure: Fix race conditionEelco Dolstra
There is a long-standing race condition when copying a closure to a remote machine, particularly affecting build-remote.pl: the client first asks the remote machine which paths it already has, then copies over the missing paths. If the garbage collector kicks in on the remote machine between the first and second step, the already-present paths may be deleted. The missing paths may then refer to deleted paths, causing nix-copy-closure to fail. The client now performs both steps using a single remote Nix call (using ‘nix-store --serve’), locking all paths in the closure while querying. I changed the --serve protocol a bit (getting rid of QueryCommand), so this breaks the SSH substituter from older versions. But it was marked experimental anyway. Fixes #141.
2014-07-10Fix security hole in ‘nix-store --serve’Eelco Dolstra
Since it didn't check that the path received from the client is a store path, the client could dump any path in the file system.
2014-07-10Add a test for the SSH substituterEelco Dolstra
2014-07-09Fix compilation error on some versions of GCCEelco Dolstra
src/libexpr/primops.cc:42:8: error: looser throw specifier for 'virtual nix::InvalidPathError::~InvalidPathError()' src/libexpr/nixexpr.hh:12:1: error: overriding 'virtual nix::EvalError::~EvalError() noexcept (true)' http://hydra.nixos.org/build/12385750
2014-07-08Don't build on Ubuntu 10.10Eelco Dolstra
Its C++ compiler is too old. http://hydra.nixos.org/build/12385722
2014-07-04Add builtin function ‘fromJSON’Eelco Dolstra
Fixes #294.
2014-07-03Manual: html -> xhtmlEelco Dolstra
2014-06-27Style fixEelco Dolstra
2014-06-27Add `--json` argument to `nix-instantiate`Paul Colomiets
2014-06-27allow-arbitrary-code-during-evaluation -> ↵Eelco Dolstra
allow-unsafe-native-code-during-evaluation
2014-06-27Merge branch 'shlevy-import-native'Eelco Dolstra
2014-06-24Only add the importNative primop if the ↵Shea Levy
allow-arbitrary-code-during-evaluation option is true (default false)
2014-06-17Add importNative primopShea Levy
This can be used to import a dynamic shared object and return an arbitrary value, including new primops. This can be used both to test new primops without having to recompile nix every time, and to build specialized primops that probably don't belong upstream (e.g. a function that calls out to gpg to decrypt a nixops secret as-needed). The imported function should initialize the Value & as needed. A single import can define multiple values by creating an attrset or list, of course. An example initialization function might look like: extern "C" void initialize(nix::EvalState & state, nix::Value & v) { v.type = nix::tPrimOp; v.primOp = NEW nix::PrimOp(myFun, 1, state.symbols.create("myFun")); } Then `builtins.importNative ./example.so "initialize"` will evaluate to the primop defined in the myFun function.
2014-06-12Don't use member initialisersEelco Dolstra
They're a little bit too recent (only supported since GCC 4.7). http://hydra.nixos.org/build/11851475
2014-06-12Fix bogus warnings about dumping large pathsEelco Dolstra
Also, yay for C++11 non-static initialisers.
2014-06-12Drop ImportError and FindErrorEelco Dolstra
We're not catching these anywhere.
2014-06-12findFile: Realise the context of the path attributesShea Levy
2014-06-12Share code between scopedImport and importShea Levy
In addition to reducing duplication, this fixes both import from derivation and import of derivation for scopedImport
2014-06-12Add autoloads, make code more concise & idiomaticSteve Purcell
- Use define-derived-mode to declare nix-mode - Use autoloads to ensure nix-mode is usable (and enabled) without needing `require` - Use set + make-local-variable instead of longer 2-step equivalent
2014-06-10== operator: Ignore string contextEelco Dolstra
There really is no case I can think of where taking the context into account is useful. Mostly it's just very inconvenient.
2014-06-10Report daemon OOM betterEelco Dolstra
When copying a large path causes the daemon to run out of memory, you now get: error: Nix daemon out of memory instead of: error: writing to file: Broken pipe
2014-06-10Print a warning when loading a large path into memoryEelco Dolstra
I.e. if you have a derivation with src = ./huge-directory; you'll get a warning that this is not a good idea.
2014-06-02nix-env -qa --json: Generate valid JSON even if there are invalid meta attrsEelco Dolstra
2014-05-29Fix testEelco Dolstra
2014-05-29Sort nixPath attributesEelco Dolstra
2014-05-26Use std::unordered_setEelco Dolstra
2014-05-26nix-build: --add-root also takes 1 parameterAristid Breitkreuz
2014-05-26dev-shell is a bash script, not shSönke Hahn
'type -p' does not work in e.g. dash
2014-05-26Rephrase @ operator descriptionAdam Szkoda
2014-05-26Remove ExprBuiltinEelco Dolstra
It's slower than ExprVar since it doesn't compute a static displacement. Since we're not using the throw primop in the implementation of <...> anymore, it's also not really needed.
2014-05-26Make the Nix search path declarativeEelco Dolstra
Nix search path lookups like <nixpkgs> are now desugared to ‘findFile nixPath <nixpkgs>’, where ‘findFile’ is a new primop. Thus you can override the search path simply by saying let nixPath = [ { prefix = "nixpkgs"; path = "/my-nixpkgs"; } ]; in ... <nixpkgs> ... In conjunction with ‘scopedImport’ (commit c273c15cb13bb86420dda1e5341a4e19517532b5), the Nix search path can be propagated across imports, e.g. let overrides = { nixPath = [ ... ] ++ builtins.nixPath; import = fn: scopedImport overrides fn; scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; builtins = builtins // overrides; }; in scopedImport overrides ./nixos
2014-05-26Ensure that -I flags get included in nixPathEelco Dolstra
Also fixes #261.
2014-05-26Add constant ‘nixPath’Eelco Dolstra
It contains the Nix expression search path as a list of { prefix, path } sets, e.g. [ { path = "/nix/var/nix/profiles/per-user/root/channels/nixos"; prefix = ""; } { path = "/etc/nixos/configuration.nix"; prefix = "nixos-config"; } { path = "/home/eelco/Dev/nix/inst/share/nix/corepkgs"; prefix = "nix"; } ]
2014-05-26Add primop ‘scopedImport’Eelco Dolstra
‘scopedImport’ works like ‘import’, except that it takes a set of attributes to be added to the lexical scope of the expression, essentially extending or overriding the builtin variables. For instance, the expression scopedImport { x = 1; } ./foo.nix where foo.nix contains ‘x’, will evaluate to 1. This has a few applications: * It allows getting rid of function argument specifications in package expressions. For instance, a package expression like: { stdenv, fetchurl, libfoo }: stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } can now we written as just stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } and imported in all-packages.nix as: bar = scopedImport pkgs ./bar.nix; So whereas we once had dependencies listed in three places (buildInputs, the function, and the call site), they now only need to appear in one place. * It allows overriding builtin functions. For instance, to trace all calls to ‘map’: let overrides = { map = f: xs: builtins.trace "map called!" (map f xs); # Ensure that our override gets propagated by calls to # import/scopedImport. import = fn: scopedImport overrides fn; scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; # Also update ‘builtins’. builtins = builtins // overrides; }; in scopedImport overrides ./bla.nix * Similarly, it allows extending the set of builtin functions. For instance, during Nixpkgs/NixOS evaluation, the Nixpkgs library functions could be added to the default scope. There is a downside: calls to scopedImport are not memoized, unlike import. So importing a file multiple times leads to multiple parsings / evaluations. It would be possible to construct the AST only once, but that would require careful handling of variables/environments.
2014-05-26Shut up some signedness warningsEelco Dolstra
2014-05-23Ugly hack to allow --argstr values starting with a dashEelco Dolstra
Fixes #265.
2014-05-22Disable parallel.sh testEelco Dolstra
It breaks randomly: http://hydra.nixos.org/build/11152871
2014-05-21nix-store -l: Fetch build logs from the InternetEelco Dolstra
If a build log is not available locally, then ‘nix-store -l’ will now try to download it from the servers listed in the ‘log-servers’ option in nix.conf. For instance, if you have: log-servers = http://hydra.nixos.org/log then it will try to get logs from http://hydra.nixos.org/log/<base name of the store path>. So you can do things like: $ nix-store -l $(which xterm) and get a log even if xterm wasn't built locally.
2014-05-15Provide a more useful error message when a dynamic attr lookup failsShea Levy
2014-05-15lvlInfo -> lvlTalkativeEelco Dolstra