aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-08-02Add a unary integer negation operatorEelco Dolstra
This allows saying "-1" instead of "builtins.sub 0 1".
2013-08-02Overload the ‘+’ operator to support integer additionEelco Dolstra
2013-07-31nix-shell: Don't disable Automake dependency trackingEelco Dolstra
Nixpkgs' stdenv disables dependency tracking by default. That makes sense for one-time builds, but in an interactive environment we expect repeated "make" invocations to do the right thing.
2013-07-31Test the delayed with a bit moreEelco Dolstra
2013-07-31Make Env smallerEelco Dolstra
Commit 20866a7031ca823055a221653b77986faa167329 added a ‘withAttrs’ field to Env, which is annoying because it makes every Env structure bigger and we allocate millions of them. E.g. NixOS evaluation took 18 MiB more. So this commit squeezes ‘withAttrs’ into values[0]. Probably should use a union...
2013-07-31Don't use NULLEelco Dolstra
2013-07-31Avoid thunks when a fromWith var can be looked up without evaluationShea Levy
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-31Delay evaulation of `with` attrs until a variable lookup needs themShea Levy
Evaluation of attribute sets is strict in the attribute names, which means immediate evaluation of `with` attribute sets rules out some potentially interesting use cases (e.g. where the attribute names of one set depend in some way on another but we want to bring those names into scope for some values in the second set). The major example of this is overridable self-referential package sets (e.g. all-packages.nix). With immediate `with` evaluation, the only options for such sets are to either make them non-recursive and explicitly use the name of the overridden set in non-overridden one every time you want to reference another package, or make the set recursive and use the `__overrides` hack. As shown in the test case that comes with this commit, though, delayed `with` evaluation allows a nicer third alternative. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-30Detect stack overflowsEelco Dolstra
Previously, if the Nix evaluator gets a stack overflow due to a deep or infinite recursion in the Nix expression, the user gets an unhelpful message ("Segmentation fault") that doesn't indicate that the problem is in the user's code rather than Nix itself. Now it prints: error: stack overflow (possible infinite recursion) This only works on x86_64-linux and i686-linux. Fixes #35.
2013-07-30killUser: Don't let the child kill itself on AppleShea Levy
The kill(2) in Apple's libc follows POSIX semantics, which means that kill(-1, SIGKILL) will kill the calling process too. Since nix has no way to distinguish between the process successfully killing everything and the process being killed by a rogue builder in that case, it can't safely conclude that killUser was successful. Luckily, the actual kill syscall takes a parameter that determines whether POSIX semantics are followed, so we can call that syscall directly and avoid the issue on Apple. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-23buildenv: remove special treatment of python filesFlorian Friesdorf
buildPythonPackage does not leave easy_install.pth and site.py anymore. A python package that leaves these files is broken. An exception to this is setuptoolsSite which packages setuptools' site.py. To include it into a buildenv, this patch is even needed, not just cosmetic.
2013-07-19Add hacking notes plus a script for running nix-shellEelco Dolstra
2013-07-19nix-shell: Set $IN_NIX_SHELLEelco Dolstra
This allows scripts to distinguish between a real build and a Nix shell.
2013-07-19nix-shell: Set some environment variables also set by build.ccEelco Dolstra
Setting $NIX_STORE causes the purity checks in gcc/ld-wrapper to kick in, so that's why we unset $NIX_ENFORCE_PURITY.
2013-07-19Rename ‘nix-build --run-env’ to ‘nix-shell’Eelco Dolstra
2013-07-19nix-build --run-env: Add a ‘--pure’ flagEelco Dolstra
This causes the environment to be (almost) cleared, thus giving a shell that more closely resembled the actual Nix derivation.
2013-07-18Revert "build-remote.pl: Enforce timeouts locally"Eelco Dolstra
This reverts commit 69b8f9980f39c14a59365a188b300a34d625a2cd. The timeout should be enforced remotely. Otherwise, if the garbage collector is running either locally or remotely, if will block the build or closure copying for some time. If the garbage collector takes too long, the build may time out, which is not what we want. Also, on heavily loaded systems, copying large paths to and from the remote machine can take a long time, also potentially resulting in a timeout.
2013-07-15Allow bind-mounting regular files into the chrootShea Levy
mount(2) with MS_BIND allows mounting a regular file on top of a regular file, so there's no reason to only bind directories. This allows finer control over just which files are and aren't included in the chroot without having to build symlink trees or the like. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-12Fix syntax error in unpack-channelEelco Dolstra
2013-07-12Garbage collector: Don't follow symlinks arbitrarilyEelco Dolstra
Only indirect roots (symlinks to symlinks to the Nix store) are now supported.
2013-07-12Add gzip support for channel unpackingGergely Risko
2013-07-12doc: typoDomen Kožar
2013-07-11build-remote.pl: Move "building ..." message to a better placeEelco Dolstra
2013-07-11nix-build --run-env: Always use BashEelco Dolstra
Fixes #113. Fixes #131.
2013-07-11nix-build --run-env: Source $stdenv/setup in the interactive shellEelco Dolstra
This ensures that not just environment variables are set, but also shell functions such as unpackPhase, configurePhase and so on.
2013-07-07Leave `HAVE_HUP_NOTIFICATION' undefined on GNU/Hurd.Ludovic Courtès
2013-07-03Manual: auto-optimise-store is disabled by defaultEelco Dolstra
2013-07-01Add support for uncompressed NARs in binary cachesEelco Dolstra
Issue NixOS/hydra#102.
2013-07-01copy-from-other-stores.pl: Respect $NIX_BIN_DIREelco Dolstra
2013-07-01copy-from-other-stores.pl: Report downloaded size as 0Eelco Dolstra
2013-06-20Don't set $preferLocalBuild and $requiredSystemFeatures in buildersEelco Dolstra
With C++ std::map, doing a comparison like ‘map["foo"] == ...’ has the side-effect of adding a mapping from "foo" to the empty string if "foo" doesn't exist in the map. So we ended up setting some environment variables by accident.
2013-06-20Don't substitute derivations that have preferLocalBuild setEelco Dolstra
In particular this means that "trivial" derivations such as writeText are not substituted, reducing the number of GET requests to the binary cache by about 200 on a typical NixOS configuration.
2013-06-20Increase SQLite's auto-checkpoint intervalEelco Dolstra
Common operations like instantiating a NixOS system config no longer fitted in 8192 pages, leading to more fsyncs. So increase this limit.
2013-06-20Disable the copy-from-other-stores substituterEelco Dolstra
This substituter basically cannot work reliably since we switched to SQLite, since SQLite databases may need write access to open them even just for reading (and in WAL mode they always do).
2013-06-20Don't keep "disabled" substituters runningEelco Dolstra
For instance, it's pointless to keep copy-from-other-stores running if there are no other stores, or download-using-manifests if there are no manifests. This also speeds things up because we don't send queries to those substituters.
2013-06-17Bump versionEelco Dolstra
2013-06-17Update release notes for Nix 1.5.3Eelco Dolstra
2013-06-13Allow hard links between the outputs of a derivationEelco Dolstra
2013-06-13Fix a security bug in hash rewritingEelco Dolstra
Before calling dumpPath(), we have to make sure the files are owned by the build user. Otherwise, the build could contain a hard link to (say) /etc/shadow, which would then be read by the daemon and rewritten as a world-readable file. This only affects systems that don't have hard link restrictions enabled.
2013-06-13Fix assertion failure in canonicalisePathMetaData() after hash rewritingEelco Dolstra
The assertion in canonicalisePathMetaData() failed because the ownership of the path already changed due to the hash rewriting. The solution is not to check the ownership of rewritten paths. Issue #122.
2013-06-13computeFSClosure: Only process the missing/corrupt pathsEelco Dolstra
Issue #122.
2013-06-13TypoEelco Dolstra
2013-06-13In repair mode, update the hash of rebuilt pathsEelco Dolstra
Otherwise subsequent invocations of "--repair" will keep rebuilding the path. This only happens if the path content differs between builds (e.g. due to timestamps).
2013-06-12nix-daemon: Trust options like binary-caches when the client is rootEelco Dolstra
Fixes #127.
2013-06-07download-from-binary-cache.pl: Respect $NIX_CONNECT_TIMEOUTEelco Dolstra
2013-06-07Replace $NIX_DEBUG_SUBST with an option ‘debug-subst’Eelco Dolstra
Thus passing ‘--option debug-subst 1’ allows daemon users to turn on debug info and see what the substituter is doing.
2013-06-07download-from-binary-cache.pl: Show if we're waiting for a URLEelco Dolstra
Previously, if a binary cache is hanging/unreachable/slow, download-from-binary-cache.pl would also hang without any indication to the user. Now, if fetching a URL takes more than 5 seconds, it will print a message to that effect.
2013-06-07Remove obsolete EOF checksEelco Dolstra
2013-06-07Process stderr from substituters while doing have/info queriesEelco Dolstra
2013-06-07Buffer reads from the substituterEelco Dolstra
This greatly reduces the number of system calls.