Commit graph

11806 commits

Author SHA1 Message Date
Maximilian Bosch
cd92ea5885
libstore/derivation-goal: avoid double-parsing of JSON messages
To avoid that JSON messages are parsed twice in case of
remote builds with `ssh-ng://`, I split up the original
`handleJSONLogMessage` into three parts:

* `parseJSONMessage(const std::string&)` checks if it's a message in the
  form of `@nix {...}` and tries to parse it (and prints an error if the
  parsing fails).
* `handleJSONLogMessage(nlohmann::json&, ...)` reads the fields from the
  message and passes them to the logger.
* `handleJSONLogMessage(const std::string&, ...)` behaves as before, but
  uses the two functions mentioned above as implementation.

In case of `ssh-ng://`-logs the first two methods are invoked manually.
2022-02-28 17:27:52 +01:00
Maximilian Bosch
7a04839ea5
ssh-ng: also store build logs to make them accessible by nix log
Right now when building a derivation remotely via

    $ nix build -j0 -f . hello -L --builders 'ssh://builder'

it's possible later to read through the entire build-log by running
`nix log -f . hello`. This isn't possible however when using `ssh-ng`
rather than `ssh`.

The reason for that is that there are two different ways to transfer
logs in Nix through e.g. an SSH tunnel (that are used by `ssh`/`ssh-ng`
respectively):

* `ssh://` receives its logs from the fd pointing to `builderOut`. This
  is directly passed to the "log-sink" (and to the logger on each `\n`),
  hence `nix log` works here.
* `ssh-ng://` however expects JSON-like messages (i.e. `@nix {log data
  in here}`) and passes it directly to the logger without doing anything
  with the `logSink`. However it's certainly possible to extract
  log-lines from this format as these have their own message-type in the
  JSON payload (i.e. `resBuildLogLine`).

  This is basically what I changed in this patch: if the code-path for
  `builderOut` is not reached and a `logSink` is initialized, the
  message was successfully processed by the JSON logger (i.e. it's in
  the expected format) and the line is of the expected type (i.e.
  `resBuildLogLine`), the line will be written to the log-sink as well.

Closes #5079
2022-02-28 17:27:52 +01:00
regnat
b8f8aef9d3 tests: Fix the start of the daemon
- Make sure that it starts even without the `nix-command` xp feature
- Fail if it doesn’t manage to start

This fixes a 30s wait for every test in `init.sh` as the daemon couldn’t
start, but the code was just waiting 30s and continuing as if everything
was all right.
2022-02-28 17:00:31 +01:00
Eelco Dolstra
b592359c56
Merge pull request #6178 from edolstra/fix-darwin
Fix Darwin build
2022-02-28 16:13:00 +01:00
Eelco Dolstra
b91500a14e Fix clang warning 2022-02-28 15:48:26 +01:00
Eelco Dolstra
a949673a5b Fix Darwin build
Fixes #6169
2022-02-28 15:48:26 +01:00
Théophane Hufschmitt
c2720797d5
Merge pull request #6072 from Ma27/fix-nix-why-depends-non-precise
nix/why-depends: fix output when not using `--precise`
2022-02-28 11:46:50 +01:00
Domen Kožar
e85d565b5a
Merge pull request #6123 from abathur/fix_6122
install-darwin: fix mount permission edge-case
2022-02-28 08:45:22 +00:00
toonn
947d4761b3
doc: Add removal of darwin-store LaunchDaemon
The uninstall instructions used to accidentally remove the nix-darwin
LaunchDaemon, this was dropped. However, the original intent was to
remove the Store volume mounting LaunchDaemon.
2022-02-26 14:16:35 +01:00
Eelco Dolstra
df552ff53e Remove std::string alias (for real this time)
Also use std::string_view in a few more places.
2022-02-25 16:13:02 +01:00
Eelco Dolstra
14b38d0887 xml-writer: Remove std aliases 2022-02-25 16:13:02 +01:00
Théophane Hufschmitt
fd4b693ca2
Merge pull request #6164 from kamadorueda/issue-5859
refactor: remove verbose-build from docs
2022-02-25 15:29:59 +01:00
Kevin Amado
b312d4d096
refactor: remove verbose-build from docs
- From what I see it is an implementation detail
  but is no longer configurable from the settings
2022-02-25 09:16:42 -05:00
toonn
2df23e2b3e
doc: Drop nix-darwin service from macOS uninstall 2022-02-25 10:50:01 +01:00
toonn
064cad7e9f
doc: Add macOS uninstall note about /nix
Clarify that `/nix` being present after the uninstall is normal and it
will only disappear after a reboot.

Co-authored-by: Travis A. Everett <travis.a.everett@gmail.com>
2022-02-25 10:32:45 +01:00
Eelco Dolstra
9d4697453f ExprAttrs::show(): Show attrs in sorted order
Issue #6160.
2022-02-25 09:21:04 +01:00
Eelco Dolstra
59683733f5
Merge pull request #6089 from edolstra/dot-default
Replace defaultBla.$system with bla.$system.default
2022-02-24 21:16:58 +01:00
Eelco Dolstra
cf7f98483a
Merge pull request #6161 from edolstra/locked
libfetchers: Rename immutable -> locked
2022-02-24 19:01:33 +01:00
Eelco Dolstra
8518cebfce libfetchers: Rename immutable -> locked
This is more consistent with flake terminology.
2022-02-24 18:09:00 +01:00
Eelco Dolstra
3317866060
Merge pull request #6150 from GuillaumeDesforges/doc/builtins-function-anchor
Add anchor to builtin functions in HTML documentation
2022-02-24 17:54:48 +01:00
Eelco Dolstra
7ec244aec2
Merge pull request #6159 from NixOS/more-eager-daemon-polling-in-tests
testS: poll more eagerly for the daemon start/stop
2022-02-24 17:54:09 +01:00
Eelco Dolstra
5f88411af0
Merge pull request #6158 from NixOS/reorder-tests
Sort the tests by wall time
2022-02-24 17:53:48 +01:00
regnat
9c470cb969 testS: poll more eagerly for the daemon start/stop
Polling every 1 second means that even the simplest test takes at least
2 seconds. We can reasonably poll 1/10 of that to make things much
  quicker (esp. given that most of the time 0.1s is enough for the
  daemon to be started or stopped)
2022-02-24 15:00:23 +01:00
regnat
42766f8924 Sort the tests by wall time
The tests are scheduled in the order they appear, so running the long
ones first slightly improves the scheduling.

On my machine, this decreases the time of `make install` from 40s to 36s
2022-02-24 14:32:31 +01:00
Guillaume Desforges
cfbf9ee2ce Anchor with prefix 2022-02-24 13:50:50 +01:00
Théophane Hufschmitt
6524eb4b77
Merge pull request #5342 from Misterio77/add-sourcehut
Add support for sourcehut input scheme
2022-02-24 09:09:21 +01:00
Gabriel Fontes
770f3af31d
add sourcehut integration test 2022-02-23 11:58:09 -03:00
Guillaume Desforges
6462ee61c7 Anchor link for builtin functions in HTML doc 2022-02-23 15:07:01 +01:00
Guillaume Desforges
2cc645a91a Add html make target 2022-02-23 15:06:13 +01:00
Eelco Dolstra
3144b373a4
Merge pull request #6147 from NixOS/include-outputs-doc
Precise the doc for `--include-outputs`
2022-02-23 10:22:20 +01:00
Théophane Hufschmitt
54f07b66c8
Precise the doc for --include-outputs
Make it explicit that it only includes the existing outputs and not the ones that haven’t been realised
2022-02-23 09:17:08 +01:00
Travis A. Everett
ba9a8c4b3d install-darwin: track mount permission edge-case fix
Same as 1fd127a068, but applied to a
code path (volume_pass_works -> verify_volume_pass) that the reporting
user didn't hit and wasn't able to trigger manually. I am not certain
but I suspect it will be easier to add prophylactically than to debug
if its absence causes trouble some day.
2022-02-22 12:44:15 -06:00
Max
ee2038b628 Merge branch 'pr/Ma27/6029' 2022-02-22 19:04:36 +01:00
Max
b792e369b9 Merge branch 'pr/ncfavier/6128' 2022-02-22 19:00:48 +01:00
Max
37edecb169 custom README 2022-02-22 18:25:14 +01:00
Max
d8995c2f68 NIXINATE 2022-02-22 18:25:14 +01:00
Max
9e592b8085 patch: cli overrides beta, nix-dram edition 2022-02-22 18:25:14 +01:00
Max
78384699de patch: cli: apply-to-installable, nix-dram edition 2022-02-22 18:25:14 +01:00
Max
a72dd4916f Merge branch 'pr/mopleen/5584' 2022-02-22 18:25:13 +01:00
Max
0dc764c309 Merge branch 'pr/Mewp/5577' 2022-02-22 18:24:40 +01:00
Max
47f5d658a5 patch: nix-dram 2022-02-22 18:24:08 +01:00
Max
244636e599 patch: enable all experimental features (@DavHau) 2022-02-22 18:24:08 +01:00
Max
3fd4fd0d23 patch: nix shell: more environment variables 2022-02-22 18:24:08 +01:00
Max
8f9a499e4d patch: flake: always evaluate thunks in inputs 2022-02-22 18:24:08 +01:00
Max
2ea1d02e50 patch: nix profile list better UI 2022-02-22 18:24:08 +01:00
Max
1d04ea2941 patch: no unknown flake outputs 2022-02-22 18:24:08 +01:00
Max
1c49d1f82d patch: nix-super primop 2022-02-22 18:24:08 +01:00
Max
4c28820dc0 patch: nix-super branding 2022-02-22 18:24:08 +01:00
Max
351e70ea68 Merge branch 'pr/mopleen/5625' 2022-02-22 18:24:08 +01:00
toonn
400d70a3a9
doc: Add detailed uninstall section for macOS
The multi-user installation on macOS, which is now the only option, has
gotten complicated enough that it discourages some users from checking
Nix out for fear of being left with a "dirty" system. Detailed
uninstallation instructions should make this less of an issue.
2022-02-22 16:28:24 +01:00