aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/shared.cc
AgeCommit message (Collapse)Author
2022-03-03Factor out a `GcStore` interfaceJohn Ericson
Starts progress on #5729. The idea is that we should not have these default methods throwing "unimplemented". This is a small step in that direction. I kept `addTempRoot` because it is a no-op, rather than failure. Also, as a practical matter, it is called all over the place, while doing other tasks, so the downcasting would be annoying. Maybe in the future I could move the "real" `addTempRoot` to `GcStore`, and the existing usecases use a `tryAddTempRoot` wrapper to downcast or do nothing, but I wasn't sure whether that was a good idea so with a bias to less churn I didn't do it yet.
2022-03-02Remove stray debug lineEelco Dolstra
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2021-12-13Respect /etc/hostsEelco Dolstra
https://hydra.nixos.org/build/161439329
2021-12-06RunPager: restore stdout upon pager exitAlexander Bantyev
Before this change, stdout was closed after the pager exits. This is fine for non-interactive commands where we want to exit right after the pager exits anyways, but for interactive things (e.g. nix repl) this breaks the output after we quit the pager. Keep the initial stdout fd as part of RunPager, and restore it in RunPager::~RunPager using dup2.
2021-10-16preloadNSS: document the preload mechanismArthur Gautier
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-15fixup macos buildArthur Gautier
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-15preloadNSS: warn if unable to open nss backendArthur Gautier
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-15preloadNSS: detect glibcArthur Gautier
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-15preloadNSS: Drop the dns query workaroundArthur Gautier
We can actually just load nss ourselves and call in nss to configure it and we don't need to run a dummy query entirely to have nss load nss_dns as a side-effect. Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-09-08preloadNSS: load NSS before threads are startedArthur Gautier
preloadNSS is not thread-safe, this commit moves it before we start the first thread. Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-07-25Fix --no-gc-warningNaïm Favier
Broken by 8e758d402ba1045c7b8273f8cb1d6d8d917ca52b
2021-04-07restoreSignals() + restoreAffinity() -> restoreProcessContext()Eelco Dolstra
2021-04-05Rename BuildableJohn Ericson
2021-04-05Use `BuildableReq` for `buildPaths` and `ensurePath`John Ericson
This avoids an ambiguity where the `StorePathWithOutputs { drvPath, {} }` could mean "build `brvPath`" or "substitute `drvPath`" depending on context. It also brings the internals closer in line to the new CLI, by generalizing the `Buildable` type is used there and makes that distinction already. In doing so, relegate `StorePathWithOutputs` to being a type just for backwards compatibility (CLI and RPC).
2021-01-27Remove mkFlag()Eelco Dolstra
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2021-01-08Support binary unit prefixes in command line argumentsEelco Dolstra
2021-01-08string2Int(): Return std::optionalEelco Dolstra
2021-01-08Remove mkFlag integer specialisationEelco Dolstra
2021-01-06Make sodium a required dependencyEelco Dolstra
2021-01-06Move sodium_init() callEelco Dolstra
2020-10-06Factor out common showBytes()Eelco Dolstra
2020-07-31Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-07-30unsigned long long -> uint64_tEelco Dolstra
2020-07-24printVersion(): Show system typesEelco Dolstra
2020-07-02move showTrace to new loggerSettingsBen Burdette
2020-06-30comments and cleanupBen Burdette
2020-06-29showTrace flag in loggersBen Burdette
2020-06-25showTrace flag for ErrorInfo; showTrace test.Ben Burdette
2020-06-24re-enable --show-trace checkBen Burdette
2020-06-19addErrorTraceBen Burdette
2020-06-17Mention number of derivations to be build/fetched in outputJoe Hermaszewski
Also correct grammar for the case of a single derivation.
2020-06-15Include only the base name of the program in error messagesEelco Dolstra
2020-06-11Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
2020-06-08Unify the printing of the logs between bar-with-logs and rawregnat
Make the printing of the build logs systematically go through the logger, and replicate the behavior of `no-build-output` by having two different loggers (one that prints the build logs and one that doesn't)
2020-05-11Merge branch 'master' into errors-phase-2Ben Burdette
2020-05-04Flag: Use designated initializersEelco Dolstra
2020-05-04separate msgs instead of appending to what()Ben Burdette
2020-05-03convert some printError calls to logErrorBen Burdette
2020-04-24all things error to error.hhBen Burdette
2020-04-21remove 'format' from Error constructor callsBen Burdette
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-12never use /var/folders for TMPDIR on darwinDaiderd Jordan
This doesn't just cause problems for nix-store --serve but also results in certain build failures. Builds that use unix domain sockets in their tests often fail because the /var/folders prefix already consumes more than half of the maximum length of socket paths. struct sockaddr_un { sa_family_t sun_family; /* AF_UNIX */ char sun_path[108]; /* Pathname */ };
2019-12-10Make the Store API more type-safeEelco Dolstra
Most functions now take a StorePath argument rather than a Path (which is just an alias for std::string). The StorePath constructor ensures that the path is syntactically correct (i.e. it looks like <store-dir>/<base32-hash>-<name>). Similarly, functions like buildPaths() now take a StorePathWithOutputs, rather than abusing Path by adding a '!<outputs>' suffix. Note that the StorePath type is implemented in Rust. This involves some hackery to allow Rust values to be used directly in C++, via a helper type whose destructor calls the Rust type's drop() function. The main issue is the dynamic nature of C++ move semantics: after we have moved a Rust value, we should not call the drop function on the original value. So when we move a value, we set the original value to bitwise zero, and the destructor only calls drop() if the value is not bitwise zero. This should be sufficient for most types. Also lots of minor cleanups to the C++ API to make it more modern (e.g. using std::optional and std::string_view in some places).
2019-11-26Fix macOS buildEelco Dolstra
https://hydra.nixos.org/build/107457009
2019-09-04Disable OpenSSL lock callback on OpenSSL >= 1.1.1Eelco Dolstra
2019-08-28Merge pull request #2921 from matthewbauer/handle-sigwinchEelco Dolstra
Handle SIGWINCH in main thread
2019-06-15nix: Support -j flagEelco Dolstra