aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-17Rename ValueType -> InternalType, NormalType -> ValueTypeSilvan Mosberger
And Value::type to Value::internalType, such that type() can be used in the next commit to get the new ValueType
2020-12-12Make Value::type privateSilvan Mosberger
This is an implementation detail and shouldn't be used. Use normalType() and the various is<Type> functions instead
2020-12-12Add ValueType checking functions for types that have the same NormalTypeSilvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger
2020-12-12Introduce Value type setters and make use of themSilvan Mosberger
2020-12-12Introduce NormalType for the normal type of a ValueSilvan Mosberger
This will be useful to abstract over the ValueType implementation details Make use of it already to replace the showType(ValueType) function
2020-12-11Merge pull request #4350 from NixOS/ca/fix-build-with-nix-commandEelco Dolstra
Fix the `nix` command with CA derivations
2020-12-11Fix the `nix` command with CA derivationsregnat
Prevents a crash because most `nix` subcommands assumed that derivations know their output path, which isn't the case for CA derivations
2020-12-10nix store make-content-addressable: Show rewritten pathEelco Dolstra
2020-12-10Add lvlNotice log levelEelco Dolstra
This is like syslog's LOG_NOTICE: "normal, but significant, condition".
2020-12-09Merge pull request #4342 from tweag/fix-remote-build-hookEelco Dolstra
fix remote build hook
2020-12-09libstore/openStore: fix stores with IPv6 addressesMaximilian Bosch
In `nixStable` (2.3.7 to be precise) it's possible to connect to stores using an IPv6 address: nix ping-store --store ssh://root@2001:db8::1 This is also useful for `nixops(1)` where you could specify an IPv6 address in `deployment.targetHost`. However, this behavior is broken on `nixUnstable` and fails with the following error: $ nix store ping --store ssh://root@2001:db8::1 don't know how to open Nix store 'ssh://root@2001:db8::1' This happened because `openStore` from `libstore` uses the `parseURL` function from `libfetchers` which expects a valid URL as defined in RFC2732. However, this is unsupported by `ssh(1)`: $ nix store ping --store 'ssh://root@[2001:db8::1]' cannot connect to 'root@[2001:db8::1]' This patch now allows both ways of specifying a store (`root@2001:db8::1`) and also `root@[2001:db8::1]` since the latter one is useful to pass query parameters to the remote store. In order to achieve this, the following changes were made: * The URL regex from `url-parts.hh` now allows an IPv6 address in the form `2001:db8::1` and also `[2001:db8::1]`. * In `libstore`, a new function named `extractConnStr` ensures that a proper URL is passed to e.g. `ssh(1)`: * If a URL looks like either `[2001:db8::1]` or `root@[2001:db8::1]`, the brackets will be removed using a regex. No additional validation is done here as only strings parsed by `parseURL` are expected. * In any other case, the string will be left untouched. * The rules above only apply for `LegacySSHStore` and `SSHStore` (a.k.a `ssh://` and `ssh-ng://`). Unresolved questions: * I'm not really sure whether we want to allow both variants of IPv6 addresses in the URL parser. However it should be noted that both seem to be possible according to RFC2732: > This document incudes an update to the generic syntax for Uniform > Resource Identifiers defined in RFC 2396 [URL]. It defines a syntax > for IPv6 addresses and allows the use of "[" and "]" within a URI > explicitly for this reserved purpose. * Currently, it's not supported to specify a port number behind the hostname, however it seems as this is not really supported by the URL parser. Hence, this is probably out of scope here.
2020-12-09Store the final drv outputs in memory when building remotelyregnat
The `DerivationGoal` has a variable storing the “final” derivation output paths that is used (amongst other things) to fill the environment for the post build hook. However this variable wasn't set when the build-hook is used, causing a crash when both hooks are used together. Fix this by setting this variable (from the informations in the db) after a run of the post build hook.
2020-12-09Revert "Re-query for the derivation outputs in the post-build-hook"regnat
This reverts commit 1b1e0760335832c87516b9103b670b34662d5daf. Using `queryPartialDerivationOutputMap` assumes that the derivation exists locally which isn't the case for remote builders.
2020-12-08Merge pull request #4325 from tweag/hide-local-store-sql-statementsEelco Dolstra
Hide the sqlite statements declarations for the local store
2020-12-08Hide the sqlite statements declarations for the local storeregnat
These have no need to be in the public interface and it causes spurious rebuilds each time one wants to add or remove a new statement.
2020-12-08Re-query for the derivation outputs in the post-build-hookregnat
We can't assume that the runtime state knows about them as they might have been built remotely, in which case we must query the db again to get them.
2020-12-06Always default to cache.nixos.org even when different nix store dirMatthew Bauer
Since 0744f7f, it is now useful to have cache.nixos.org in substituers even if /nix/store is not the Nix Store Dir. This can always be overridden via configuration, though.
2020-12-05Merge pull request #4318 from matthewbauer/add-slash-to-trusted-binary-cacheEelco Dolstra
Canonicalize binary caches with ‘/’ when one is missing
2020-12-04Canonicalize binary caches with ‘/’ when one is missingMatthew Bauer
This checks if there is a trusted substituter with a slash, so trusting https://cache.nixos.org also implies https://cache.nixos.org/ is trusted.
2020-12-04Fix compatibility with newer AWS SDKsStéphan Kochen
Tested against AWS SDK 1.8.99. Fixes #3201.
2020-12-04Split 'nix store add-to-store' into 'add-path' and 'add-file'Eelco Dolstra
This makes it consistent with 'nix hash <path|file>'.
2020-12-03TypoEelco Dolstra
2020-12-03Move most store-related commands to 'nix store'Eelco Dolstra
2020-12-03Add 'nix nar dump-path'Eelco Dolstra
This only differs from 'nix store dump-path' in that the path doesn't need to be a store path.
2020-12-03Add deprecated aliases for renamed commandsEelco Dolstra
2020-12-03Add FIXMEEelco Dolstra
2020-12-03Move NAR-related commands to 'nix nar'Eelco Dolstra
2020-12-03Introduce 'nix store' commandEelco Dolstra
2020-12-03Allow registering subcommands of subcommandsEelco Dolstra
2020-12-03Move 'nix hash-*' and 'nix to-*' to 'nix hash'Eelco Dolstra
From the 'nix' UX review.
2020-12-03Remove 'dist' targetEelco Dolstra
We're not producing source tarballs anymore so this has been bitrotting.
2020-12-03nix add-to-store: Move markdown docs into a separate fileEelco Dolstra
2020-12-03Make doc() return arbitrary Markdown rather than the contents of the ↵Eelco Dolstra
"Description" section Thus we can return the examples section (and any other sections) from doc() and don't need examples() anymore.
2020-12-03Merge pull request #4308 from tweag/properly-test-early-cutoffEelco Dolstra
Properly test the early cutoff for CA derivations
2020-12-03Merge pull request #4304 from NixOS/separate-manpagesEelco Dolstra
Separate manpages for 'nix' subcommands
2020-12-03Don't fail early when -j0 is passedregnat
If the build closure contains some CA derivations, then we can't know ahead-of-time that we won't build anything as early-cutoff might come-in at a laster stage
2020-12-02nix eval: Add option to write a directoryEelco Dolstra
This is useful for generating the nix manpages, but it may have other applications (like generating configuration files without a Nix store).
2020-12-02Add 'nix help'Eelco Dolstra
2020-12-02fix tokens documentationGreg Hale
2020-12-02Remove an `unknown pragma` gcc warningregnat
2020-12-02Add forgotten `override` annotationregnat
2020-12-02read(): Use char * instead of unsigned char *Eelco Dolstra
This gets rid of some pointless casts.
2020-12-02Sink: Use std::string_viewEelco Dolstra
2020-12-02writeFull/writeFile: Use std::string_viewEelco Dolstra
2020-12-01Merge pull request #4284 from tweag/fixed-output-depending-on-caEelco Dolstra
Allow fixed-output derivations to depend on (floating) content-addressed ones
2020-12-01shut up clang warningsregnat
- Fix some class/struct discrepancies - Explicit the overloading of `run` in the `Cmd*` classes - Ignore a warning in the generated lexer
2020-12-01replaceStrings(): Use std::string_viewEelco Dolstra
2020-12-01Macro hygieneEelco Dolstra