about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-09-28 Move structured attrs handling into a separate classEelco Dolstra5-116/+145
This is primarily because Derivation::{can,will}BuildLocally() depends on attributes like preferLocalBuild and requiredSystemFeatures, but it can't handle them properly because it doesn't have access to the structured attributes.
2018-09-28 Remove obsolete check on system featuresEelco Dolstra1-1/+0
2018-09-28 Support special attributes in structured attributes derivationsEelco Dolstra1-94/+175
E.g. __noChroot and allowedReferences now work correctly. We also now check that the attribute type is correct. For instance, instead of allowedReferences = "out"; you have to write allowedReferences = [ "out" ]; Fixes #2453.
2018-09-27 S3BinaryCacheStore: Don't create bucketsEelco Dolstra1-28/+0
This meant that making a typo in an s3:// URI would cause a bucket to be created. Also it didn't handle eventual consistency very well. Now it's up to the user to create the bucket.
2018-09-27 Merge pull request #2455 from grahamc/add-interactive-pathEelco Dolstra1-2/+6
nix-shell: add bashInteractive to the start of the PATH, set SHELL
2018-09-27 nix-shell: add bashInteractive to the start of the PATH, set SHELLGraham Christensen1-2/+6
Tools which re-exec `$SHELL` or `$0` or `basename $SHELL` or even just `bash` will otherwise get the non-interactive bash, providing a broken shell for the same reasons described in https://github.com/NixOS/nixpkgs/issues/27493. Extends c94f3d5575d7af5403274d1e9e2f3c9d72989751
2018-09-27 Don't talk about a "current folder build output"Eelco Dolstra1-4/+4
Presumably this refers to ./default.nix but the support for that in 'nix' is tenuous. Also folders are a Mac thing.
2018-09-26 Ensure download thread livenessEelco Dolstra1-19/+26
* Don't wait forever for the client to remove data from the buffer. This does mean that the buffer can grow without bounds (e.g. when downloading is faster than writing to disk), but meh. * Don't hold the state lock while calling the sink. The sink could take any amount of time to process the data (in particular when it's actually a coroutine), so we don't want to block the download thread.
2018-09-26 UntabifyEelco Dolstra1-1/+1
2018-09-26 sinkToSource(): Start the coroutine lazilyEelco Dolstra1-11/+15
In particular this causes copyStorePath() from HttpBinaryCacheStore to only start a download if needed. E.g. if the destination LocalStore goes to sleep waiting for the path lock and another process creates the path, then LocalStore::addToStore() will never read from the source so we don't have to do the download.
2018-09-26 Make NAR header check more robustEelco Dolstra3-4/+5
Changes std::bad_alloc into bad archive: input doesn't look like a Nix archive
2018-09-25 nix-daemon: allow setting builders to "" by any user (untrusted)Will Dietz1-1/+2
(cherry picked from commit a94a2eb1cb1c81e90a7529be5fecac27899a3442)
2018-09-24 Merge pull request #2312 from ↵Eelco Dolstra1-1/+3
dtzWill/fix/matched-names-should-still-print-version search: include version for matches too!
2018-09-17 nix-env: Fix segfault if -f argument is not a directory or a Nix expressionEelco Dolstra1-4/+4
Fixes #2425.
2018-09-17 Fix build failure if parallel xz is not availableEelco Dolstra1-1/+1
2018-09-13 Merge branch 'dirOf-relative' of https://github.com/lheckemann/nixEelco Dolstra2-2/+2
2018-09-10 auto args on replDing Xiang Fei1-2/+3
2018-09-07 If fallback is enabled, temporarily disable substituters after a failureEelco Dolstra4-1/+48
Otherwise, we just keep asking the substituter for other .narinfo files, which can take a very long time due to retries/timeouts.
2018-09-07 Handle queryPathInfo() failure from substituters when fallback is enabledEelco Dolstra2-0/+12
Fixes #1990.
2018-09-05 Convert NIX_COUNT_CALLS to JSON tooEelco Dolstra1-35/+41
2018-09-05 Log stats to stderrEelco Dolstra1-7/+2
We shouldn't pollute stdout.
2018-09-05 Merge branch 'improve-stats' of https://github.com/cleverca22/nixEelco Dolstra1-26/+63
2018-09-05 fetchurl: Respect unpackEelco Dolstra1-2/+3
Fixes #2393.
2018-09-04 Get effective user in Nix commandsMatthew Bauer2-2/+2
‘geteuid’ gives us the user that the command is being run as, including in setuid modes. By using geteuid to determind id, we can avoid the ‘sudo -i’ hack when upgrading Nix. So now, upgrading Nix on macOS is as simple as: $ sudo nix-channel --update $ sudo nix-env -u $ sudo launchctl stop org.nixos.nix-daemon $ sudo launchctl start org.nixos.nix-daemon or $ sudo systemctl restart nix-daemon
2018-09-03 download: fix size reported to progress barWill Dietz1-1/+1
2018-09-02 remove the old text format outputMichael Bishop1-34/+4
2018-09-01 add JSON to NIX_SHOW_STATSMichael Bishop1-24/+90
2018-09-01 improve the stats when profilingMichael Bishop1-7/+8
2018-08-31 nix-build: Print stats even in failing buildsGraham Christensen1-1/+2
2018-08-31 nix-build: print stats on sucessful buildsGraham Christensen1-0/+1
2018-09-01 fetchGit/fetchMercurial: Don't absolutize pathsEelco Dolstra2-4/+0
This is already done by coerceToString(), provided that the argument is a path (e.g. 'fetchGit ./bla'). It fixes the handling of URLs like git@github.com:owner/repo.git. It breaks 'fetchGit "./bla"', but that was never intended to work anyway and is inconsistent with other builtin functions (e.g. 'readFile "./bla"' fails).
2018-09-01 nix path-info: Remove trailing spacesEelco Dolstra1-1/+4
Fixes #2390.
2018-08-31 Really fix the buildEelco Dolstra1-0/+1
2018-08-31 nix path-info: Hopefully fix macOS build failureEelco Dolstra1-2/+2
https://hydra.nixos.org/build/80480356
2018-08-31 Add localhost alias for ::1 to the sandboxEelco Dolstra1-1/+1
2018-08-30 fix `error: unknown serve command 9`Michael Bishop1-1/+1
2018-08-30 nix upgrade-nix: Handle .nix-profile being a link to .../profiles/per-user/...Eelco Dolstra1-12/+22
Also some cosmetic improvements.
2018-08-30 nix upgrade-nix: Improve error message if 'nix' is not in a profileEelco Dolstra1-1/+1
E.g. $ nix upgrade-nix error: directory '/home/eelco/Dev/nix/inst/bin' does not appear to be part of a Nix profile instead of $ nix upgrade-nix error: '/home/eelco/Dev/nix/inst' is not a symlink
2018-08-30 Merge branch 'nix-upgrade-profile' of https://github.com/LnL7/nixEelco Dolstra1-11/+23
2018-08-30 Add simple test for nix upgrade-nixEelco Dolstra1-1/+8
2018-08-30 printSize() fixesEelco Dolstra1-7/+5
Fix a 32-bit overflow that resulted in negative numbers being printed; use fmt() instead of boost::format(); change -H to -h for consistency with 'ls' and 'du'; make the columns narrower (since they can't be bigger than 1024.0).
2018-08-30 Avoid overflow and use boost::formatBenjamin Hipple1-6/+7
If the user has an object greater than 1024 yottabytes, it'll just display it as N yottabytes instead of overflowing. Swaps to use boost::format strings instead of std::setw and std::setprecision.
2018-08-30 Add human readable closure sizes to nix path-infoBenjamin Hipple1-2/+27
Unfortunately, -h is already taken as a short option by --help, so we have to use a different letter or the capitalized version. Resolves #2363
2018-08-30 nix: Remove the -h flagEelco Dolstra1-1/+0
2018-08-29 Merge pull request #2336 from ivan/repl-trailing-spacesEelco Dolstra1-1/+6
repl: don't add trailing spaces to history lines
2018-08-29 libexpr: Use int64_t for NixIntaszlig2-3/+7
Using a 64bit integer on 32bit systems will come with a bit of a performance overhead, but given that Nix doesn't use a lot of integers compared to other types, I think the overhead is negligible also considering that 32bit systems are in decline. The biggest advantage however is that when we use a consistent integer size across all platforms it's less likely that we miss things that we break due to that. One example would be: https://github.com/NixOS/nixpkgs/pull/44233 On Hydra it will evaluate, because the evaluator runs on a 64bit machine, but when evaluating the same on a 32bit machine it will fail, so using 64bit integers should make that consistent. While the change of the type in value.hh is rather easy to do, we have a few more options available for doing the conversion in the lexer: * Via an #ifdef on the architecture and using strtol() or strtoll() accordingly depending on which architecture we are. For the #ifdef we would need another AX_COMPILE_CHECK_SIZEOF in configure.ac. * Using istringstream, which would involve copying the value. * As we're already using boost, lexical_cast might be a good idea. Spoiler: I went for the latter, first of all because lexical_cast does have an overload for const char* and second of all, because it doesn't involve copying around the input string. Also, because istringstream seems to come with a bigger overhead than boost::lexical_cast: https://www.boost.org/doc/libs/release/doc/html/boost_lexical_cast/performance.html The first method (still using strtol/strtoll) also wasn't something I pursued further, because it is also locale-aware which I doubt is what we want, given that the regex for int is [0-9]+. Signed-off-by: aszlig <aszlig@nix.build> Fixes: #2339
2018-08-25 upgrade-nix: resolve profile symlinksDaiderd Jordan1-3/+10
The profile present in PATH is not necessarily the actual profile location. User profiles are generally added as $HOME/.nix-profile in which case the indirect profile link needs to be resolved first. /home/user/.nix-profile -> /nix/var/nix/profiles/per-user/user/profile /nix/var/nix/profiles/per-user/user/profile -> profile-15-link /nix/var/nix/profiles/per-user/user/profile-14-link -> /nix/store/hyi4kkjh3bwi2z3wfljrkfymz9904h62-user-environment /nix/var/nix/profiles/per-user/user/profile-15-link -> /nix/store/6njpl3qvihz46vj911pwx7hfcvwhifl9-user-environment To upgrade nix here we want /nix/var/nix/profiles/per-user/user/profile-16-link instead of /home/user/.nix-profile-1-link. The latter is not a gcroot and would be garbage collected, resulting in a broken profile. Fixes #2175
2018-08-25 upgrade-nix: add --dry-runDaiderd Jordan1-8/+13
2018-08-23 Revert "Fix parser/lexer generation with parallel make"Eelco Dolstra1-6/+2
This reverts commit d277442df53a01343ba7c1df0bbd2a294058dcba. Make sucks.
2018-08-22 Merge pull request #2368 from dezgeg/drop-dead-codeEelco Dolstra1-1/+0
Drop dead code