aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
AgeCommit message (Collapse)Author
2020-04-15Merge pull request #3458 from zimbatm/nix-user-conf-dirEelco Dolstra
NIX_USER_CONF_FILES
2020-04-14add NIX_USER_CONF_FILESzimbatm
Motivation: maintain project-level configuration files. Document the whole situation a bit better so that it corresponds to the implementation, and add NIX_USER_CONF_FILES that allows overriding which user files Nix will load during startup.
2020-04-10Fix nix-build --check -K in sandbox w/o rootBruce Toll
Temporarily add user-write permission to build directory so that it can be moved out of the sandbox to the store with a .check suffix. This is necessary because the build directory has already had its permissions set read-only, but write permission is required to update the directory's parent link to move it out of the sandbox. Updated the related --check "derivation may not be deterministic" messages to consistently use the real store paths. Added test for non-root sandbox nix-build --check -K to demonstrate issue and help prevent regressions.
2020-04-10Merge pull request #2689 from tollb/fix/delete_tmp_dir_when_build_check_okDomen Kožar
Delete temporary directory on successful build
2020-04-09Delete temporary directory on successful buildBruce Toll
With --check and the --keep-failed (-K) flag, the temporary directory was being retained regardless of whether the build was successful and reproducible. This removes the temporary directory, as expected, on a reproducible check build. Added tests to verify that temporary build directories are not retained unnecessarily, particularly when using --check with --keep-failed.
2020-04-09gc.cc: Ignore hidden files in temprootsPhilipp Middendorf
2020-04-08datatransfer.{cc,hh} -> filetransfer.{cc,hh}Nikola Knezevic
2020-04-08DataTransfer -> FileTransferNikola Knezevic
2020-04-08Add upload methodNikola Knezevic
2020-04-08actDownload -> actDataTransferNikola Knezevic
2020-04-08DownloadError -> DataTransferErrorNikola Knezevic
2020-04-08DownloadItem -> TransferItemNikola Knezevic
2020-04-08{get,make,new}Downloader -> DataTransferNikola Knezevic
2020-04-08enqueueDownload -> enqueueDataTransferNikola Knezevic
2020-04-08DownloadResult -> DataTransferResultNikola Knezevic
2020-04-08DownloadSettings -> DataTransferSettingsNikola Knezevic
2020-04-08Rename src/lib/download.* to src/lib/datatransfer.*Nikola Knezevic
2020-04-08DownloadRequest -> DataTransferRequestNikola Knezevic
2020-04-08build.cc: improve message if home directory existsDomen Kožar
2020-04-08Downloader: Only write data to the sink on a 200 responseEelco Dolstra
Hopefully fixes #3278.
2020-04-07CleanupEelco Dolstra
2020-04-07Backport libfetchers from the flakes branchEelco Dolstra
This provides a pluggable mechanism for defining new fetchers. It adds a builtin function 'fetchTree' that generalizes existing fetchers like 'fetchGit', 'fetchMercurial' and 'fetchTarball'. 'fetchTree' takes a set of attributes, e.g. fetchTree { type = "git"; url = "https://example.org/repo.git"; ref = "some-branch"; rev = "abcdef..."; } The existing fetchers are just wrappers around this. Note that the input attributes to fetchTree are the same as flake input specifications and flake lock file entries. All fetchers share a common cache stored in ~/.cache/nix/fetcher-cache-v1.sqlite. This replaces the ad hoc caching mechanisms in fetchGit and download.cc (e.g. ~/.cache/nix/{tarballs,git-revs*}). This also adds support for Git worktrees (c169ea59049f861aaba429f48b828d0820b74d1d).
2020-04-05Don't retry on "unsupported protocol" errorCole Helbling
When encountering an unsupported protocol, there's no need to retry. Chances are, it won't suddenly be supported between retry attempts; error instead. Otherwise, you see something like the following: $ nix-env -i -f git://git@github.com/foo/bar warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 335 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 604 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 1340 ms warning: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1); retrying in 2685 ms With this change, you now see: $ nix-env -i -f git://git@github.com/foo/bar error: unable to download 'git://git@github.com/foo/bar': Unsupported protocol (1)
2020-03-31fix placeholder not substituted in passAsFilemlatus
2020-03-30Remove global -I flagsEelco Dolstra
(cherry picked from commit 2c692a3b144523bca68dd6de618124ba6c9bb332)
2020-03-24Misc changes from the flakes branchEelco Dolstra
2020-03-24nix path-info --json: Print hash in SRI formatEelco Dolstra
(cherry picked from commit 442e665d6d3fcbdee7dece2f62a597142f8784b1)
2020-03-24buildenv: Eliminate global variables, other cleanupEelco Dolstra
(cherry picked from commit b82f75464d1e5ae9a00d8004e5dd7b1ca05059e4)
2020-03-24Add function for quoting stringsEelco Dolstra
(cherry picked from commit 7dcf5b011a0942ecf953f2b607c4c8d0e9e652c7)
2020-03-24Use std::string_viewEelco Dolstra
(cherry picked from commit 6529490cc10018d5191e50c482ac1180b96b1a3c)
2020-03-23Merge pull request #3429 from LnL7/darwin-sandboxEelco Dolstra
darwin sandbox
2020-03-20sandbox: fix /bin/sh on catalinaDaiderd Jordan
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it can't be used anymore without also opening up the sandbox to allow bash. Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).
2020-03-20sandbox: allow pty devicesDaiderd Jordan
Nix now runs builds with a pseudo-terminal to enable colored build output.
2020-03-20libstore: relax default sandbox-paths on darwinDaiderd Jordan
2020-03-20libstore: disable resolve-system-dependencies hookDaiderd Jordan
This is used to determine the dependency tree of impure libraries so nix knows what paths to open in the sandbox. With the less restrictive defaults it isn't needed anymore.
2020-03-13Fix ca-references feature checkEelco Dolstra
Fixes #3406.
2020-03-12pathInfoCache: Respect disk cache TTLs #3398Robert Hensing
2020-03-04nix-build: Fix !<output> handlingEelco Dolstra
This was broken by 22a754c091f765061f59bef5ce091268493bb138. https://hydra.nixos.org/eval/1573669
2020-03-04Optimise Derivation::unparse()Eelco Dolstra
In nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux this reduces time spent in unparse() from 9.15% to 4.31%. The main culprit was appending characters one at a time to the destination string. Even though the string has enough capacity, push_back() still needs to check this on every call.
2020-02-28Fix GC failures on bad store path namesEelco Dolstra
It failed on names like '/nix/store/9ip48nkc9rfy0a4yaw98lp6gipqlib1a-'.
2020-02-19Merge pull request #3353 from tbsmoest/priv_tobias_pr_set_deathsig-1.4Eelco Dolstra
Fix PR_SET_PDEATHSIG results in Broken pipe (#2395)
2020-02-18LocalStore::checkDerivationOutputs(): Improve error messageEelco Dolstra
2020-02-14Fix PR_SET_PDEATHSIG results in Broken pipe (#2395)Tobias Möst
The ssh client is lazily started by the first worker thread, that requires a ssh connection. To avoid the ssh client to be killed, when the worker process is stopped, do not set PR_SET_PDEATHSIG.
2020-02-13Prevent uninitialized StorePath creationEelco Dolstra
2020-02-07Fix segfault in gcc on i686-linuxEelco Dolstra
src/libstore/ssh-store.cc: In constructor 'nix::SSHStore::SSHStore(const string&, const Params&)': src/libstore/ssh-store.cc:31:21: internal compiler error: Segmentation fault compress) ^ Please submit a full bug report, with preprocessed source if appropriate. https://hydra.nixos.org/build/111545609
2020-02-04Merge pull request #3344 from LnL7/ssh-ng-remote-paramsEelco Dolstra
ssh-store: add remote-store and remote-program query params
2020-02-03ssh-store: add remote-store and remote-program query paramsDaiderd Jordan
Brings the functionality of ssh-ng:// in sync with the legacy ssh:// implementation. Specifying the remote store uri enables various useful things. eg. $ nix copy --to ssh-ng://cache?remote-store=file://mnt/cache --all
2020-01-29Merge pull request #3335 from domenkozar/retry-429Eelco Dolstra
retry on HTTP status code 429
2020-01-29retry on HTTP status code 429Domen Kožar
2020-01-23structured-attrs: chown .attrs.* files to builderRobin Gloster
Otherwise `chmod .`'ing the build directory doesn't work anymore, which is done in nixpkgs if sourceRoot is set to '.'.