aboutsummaryrefslogtreecommitdiff
path: root/src/libmain
AgeCommit message (Collapse)Author
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
2021-01-08Remove mkFlag integer specialisationEelco Dolstra
2021-01-06Make sodium a required dependencyEelco Dolstra
2021-01-06Move sodium_init() callEelco Dolstra
2020-11-26Ask for confirmation before allowing flake Nix configuration settingsEelco Dolstra
2020-10-29Fix assertion failure in tab completion for --optionEelco Dolstra
2020-10-28Capitalize JSON for consistencyMatthew Kenigsberg
2020-10-09Add a description in the completion outputsregnat
Make nix output completions in the form `completion\tdescription`. This can't be used by bash (afaik), but other shells like zsh or fish can display it along the completion choices
2020-10-06Factor out common showBytes()Eelco Dolstra
2020-09-26libmain/progress-bar: don't trim whitespace on the leftMaximilian Bosch
When running `nix build -L` it can be fairly hard to read the output if the build program intentionally renders whitespace on the left. A typical example is `g++` displaying compilation errors. With this patch, the whitespace on the left is retained to make the log more readable: ``` foo> no configure script, doing nothing foo> building foo> foobar.cc: In function 'int main()': foo> foobar.cc:5:5: error: 'wrong_func' was not declared in this scope foo> 5 | wrong_func(1); foo> | ^~~~~~~~~~ error: --- Error ------------------------------------------------------------------------------------- nix error: --- Error --- nix-daemon builder for '/nix/store/i1q76cw6cyh91raaqg5p5isd1l2x6rx2-foo-1.0.drv' failed with exit code 1 ```
2020-08-19Change option descriptions to MarkdownEelco Dolstra
2020-08-17Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-08-10Always reset ANSI colors in progress-bar lineMaximilian Bosch
When having a message like `waiting for a machine to build X` and building with `nix build -L`, the log-prefix is always colored yellow[1] on a small terminal-width as everything (including the ANSI color-reset) is stripped away. To work around that problem, this patch explicitly adds an `ANSI_NORMAL` to the end of the line. [1] https://imgur.com/a/FjtJOk3
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-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-02move showTrace to new loggerSettingsBen Burdette
2020-06-30comments and cleanupBen Burdette
2020-06-29showTrace flag in loggersBen Burdette
2020-06-29Fix bash completionEelco Dolstra
2020-06-26Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra