aboutsummaryrefslogtreecommitdiff
path: root/src/libmain
AgeCommit message (Collapse)Author
2022-12-24libstore: Make sure that initNix has been calledRobert Hensing
Prevent bugs like https://github.com/cachix/cachix/pull/477
2022-12-12Merge pull request #7421 from edolstra/lazy-trees-trivial-changesEelco Dolstra
Trivial changes from the lazy-trees branch
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-12-07Remove repeat and enforce-determinism optionsLinus Heckemann
These only functioned if a very narrow combination of conditions held: - The result path does not yet exist (--check did not result in repeated builds), AND - The result path is not available from any configured substituters, AND - No remote builders that can build the path are available. If any of these do not hold, a derivation would be built 0 or 1 times regardless of the repeat option. Thus, remove it to avoid confusion.
2022-10-28Move savedArgv into libmainJean-François Roche
`savedArgv` is not accessible by plugins when defined in main binary. Moving it into one of the nix lib fix the problem.
2022-10-22Build with C++20Graham Bennett
2022-10-14Merge pull request #7168 from NixOS/rosetta-testEelco Dolstra
Improve Rosetta detection
2022-10-14libmain: Make the entire stack overflow handler pluggableRobert Hensing
2022-10-14libmain: Add extraStackOverflowHandlerRobert Hensing
2022-10-13Fix clang warningsEelco Dolstra
2022-10-12Move some options into a misc categoryEelco Dolstra
This unclutters the per-command options a bit by moving out some global options.
2022-09-13RunPager: Stop the progress barEelco Dolstra
In particular, the progress bar was interfering with 'less' rendering in '--help' (e.g. run 'nix --help' and hit '/' to search).
2022-09-06Remove some signalsMatthew Bauer
2022-09-03Add more signalsMatthew Bauer
2022-09-03Disable SA_RESTART for some signals on macOSMatthew Bauer
Disables the SA_RESTART behavior on macOS which causes: > Restarting of pending calls is requested by setting the SA_RESTART bit > in sa_flags. The affected system calls include read(2), write(2), > sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications > channel or a slow device (such as a terminal, but not a regular file) > and during a wait(2) or ioctl(2). From: https://man.openbsd.org/sigaction#SA_RESTART This being set on macOS caused a bug where read() calls to the daemon socket were blocking after a SIGINT was received. As a result, checkInterrupt was never reached even though the signal was received by the signal handler thread. On Linux, SA_RESTART is disabled by default. This probably effects other BSDs but I don’t have the ability to test it there right now.
2022-08-24Fix progress bar flicker with -LEelco Dolstra
This was caused by -L calling setLogFormat() again, which caused the creation of a new progress bar without destroying the old one. So we had two progress bars clobbering each other. We should change 'logger' to be a smart pointer, but I'll do that in a future PR. Fixes #6931.
2022-08-17ProgressBar: Delay before showing a new activityEelco Dolstra
Some activities are numerous but usually very short (e.g. copying a source file to the store) which would cause a lot of flickering. So only show activities that have been running for at least 10 ms.
2022-04-19Avoid `fmt` when constructor already does itJohn Ericson
There is a correctnes issue here, but #3724 will fix that. This is just a cleanup for brevity's sake.
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-12-01Merge pull request #5599 from fzakaria/faridzakaria/fix-progress-bar-leakThéophane Hufschmitt
Fix heap use after free in progress-bar.cc
2021-11-25Merge pull request #5384 from baloo/baloo/dns-timeoutEelco Dolstra
preloadNSS / dns timeout
2021-11-23Fix heap use after free in progress-bar.ccFarid Zakaria
Fix some heap-use-after-free in progress-bar.cc These are somewhat tricky failures here due to temporary variable creation and string_view
2021-11-08Unshare mount namespace in main()Eelco Dolstra
Doing it as a side-effect of calling LocalStore::makeStoreWritable() is very ugly. Also, make sure that stopping the progress bar joins the update thread, otherwise that thread should be unshared as well.
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-09Merge pull request #5224 from baloo/baloo/5089/force-nss_dns-loadEelco Dolstra
preloadNSS: fixup nss_dns load
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-08-30Merge pull request #5175 from Pamplemousse/makeEelco Dolstra
Don't overwrite user provided `lib*_LDFLAGS`
2021-08-25Don't overwrite user provided `lib*_LDFLAGS`Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-13Install pkg-config files in the correct locationPiotr Szubiakowski
Use `$(libdir)` while installing .pc files looks like a more generic solution. For example, it will work for distributions like RHEL or Fedora where .pc files are installed in `/usr/lib64/pkgconfig`.
2021-07-25Fix --no-gc-warningNaïm Favier
Broken by 8e758d402ba1045c7b8273f8cb1d6d8d917ca52b
2021-07-01Respect TERM=dumb more consistentlyYestin L. Harrison
2021-04-07restoreSignals() + restoreAffinity() -> restoreProcessContext()Eelco Dolstra
2021-04-05buildable.{cc,hh} -> derived-path.{cc,hh}John Ericson
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-03-19ProgressBar: Respect verbosity levelEelco Dolstra
This makes its behaviour consistent with SimpleLogger.
2021-02-24Initialize plugins after handling initial command line flagsShea Levy
This is technically a breaking change, since attempting to set plugin files after the first non-flag argument will now throw an error. This is acceptable given the relative lack of stability in a plugin interface and the need to tie the knot somewhere once plugins can actually define new subcommands.
2021-01-27Remove mkFlag()Eelco Dolstra
2021-01-25Group common optionsEelco 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