lix/src
aszlig 525b38eee8
Fix unspecified behaviour in readStorePathCAMap
When deploying a Hydra instance with current Nix master, most builds
would not run because of errors like this:

  queue monitor: error: --- Error --- hydra-queue-runner
  error: --- UsageError --- nix-daemon
  not a content address because it is not in the form '<prefix>:<rest>': /nix/store/...-somedrv

The last error message is from parseContentAddress, which expects a
colon-separated string, however what we got here is a store path.

Looking at the worker protocol, the following message sent to the Nix
daemon caused the error above:

  0x1E -> wopQuerySubstitutablePathInfos
  0x01 -> Number of paths
  0x16 -> Length of string
  "/nix/store/...-somedrv"
  0x00 -> Length of string
  ""

Looking at writeStorePathCAMap, the store path is indeed the first field
that's transmitted. However, readStorePathCAMap expects it to be the
*second* field *on my machine*, since expression evaluation order is a
classic form of unspecified behaviour[1] in C++.

This has been introduced in https://github.com/NixOS/nix/pull/3689,
specifically in commit 66a62b3189.

[1]: https://en.wikipedia.org/wiki/Unspecified_behavior#Order_of_evaluation_of_subexpressions

Signed-off-by: aszlig <aszlig@nix.build>
2020-09-13 02:40:51 +02:00
..
build-remote Make system-features a store setting 2020-08-12 18:13:00 +00:00
cpptoml Revert the enum struct change 2020-06-18 22:11:26 +00:00
libexpr EvalCache: Fix caching of strings 2020-09-02 14:16:44 +02:00
libfetchers addPermRoot(): Remove indirect flag 2020-09-03 11:29:34 +02:00
libmain Change option descriptions to Markdown 2020-08-19 14:21:27 +02:00
libstore Fix unspecified behaviour in readStorePathCAMap 2020-09-13 02:40:51 +02:00
libutil Merge remote-tracking branch 'origin/master' into markdown 2020-08-31 14:24:26 +02:00
nix addPermRoot(): Remove indirect flag 2020-09-03 11:29:34 +02:00
nix-build Add nix-shell support for preserving PS1 2020-09-04 20:05:43 -07:00
nix-channel Merge branch 'master' into errors-phase-2 2020-05-11 14:35:30 -06:00
nix-collect-garbage unsigned long long -> uint64_t 2020-07-30 13:34:04 +02:00
nix-copy-closure Revert the enum struct change 2020-06-18 22:11:26 +00:00
nix-daemon Separate auth and logic for the daemon 2020-08-12 15:22:33 +00:00
nix-env createGeneration(): Take a StorePath 2020-09-03 11:06:56 +02:00
nix-instantiate addPermRoot(): Remove indirect flag 2020-09-03 11:29:34 +02:00
nix-prefetch-url Merge branch 'hash-always-has-type' into better-ca-parse-errors 2020-07-13 03:02:09 +00:00
nix-store addPermRoot(): Remove indirect flag 2020-09-03 11:29:34 +02:00
resolve-system-dependencies StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00