Age | Commit message (Collapse) | Author |
|
libstore/openStore: fix stores with IPv6 addresses
|
|
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.
|
|
Hide the sqlite statements declarations for the local store
|
|
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.
|
|
Re-query for the derivation outputs in the post-build-hook
|
|
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.
|
|
Check for rosetta 2 support before installing x86_64-darwin Nix
|
|
Always default to cache.nixos.org even when different nix store dir
|
|
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.
|
|
Canonicalize binary caches with ‘/’ when one is missing
|
|
Fix compatibility with newer AWS SDKs
|
|
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.
|
|
|
|
Tested against AWS SDK 1.8.99. Fixes #3201.
|
|
Make `make install` less noisy
|
|
Remove the printing and useless output of a couple of commands when running `make install`
|
|
Include static "nix" binary in Hydra build products
|
|
This allows users to get Nix from Hydra via a stable url like
https://hydra.nixos.org/build/132078238/download/1/nix
|
|
This makes it consistent with 'nix hash <path|file>'.
|
|
Group 'nix' subcommands
|
|
|
|
|
|
This only differs from 'nix store dump-path' in that the path doesn't
need to be a store path.
|
|
|
|
|
|
|
|
|
|
|
|
From the 'nix' UX review.
|
|
We're not producing source tarballs anymore so this has been
bitrotting.
|
|
|
|
"Description" section
Thus we can return the examples section (and any other sections) from
doc() and don't need examples() anymore.
|
|
Properly test the early cutoff for CA derivations
|
|
Separate manpages for 'nix' subcommands
|
|
Build things with a different seed each time to make sure that it works
despite the different drvs
|
|
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
|
|
Update config.guess & config.sub for proper arm64 macOS detection
|
|
This fixes results for arm64 macOS so config.guess now reports:
aarch64-apple-darwin20.1.0
instead of
arm-apple-darwin20.1.0
|
|
gnu-config standardized on aarch64 for machine name so host_cpu part
of $system will always be aarch64. That means system will be
aarch64-darwin too.
uname however could report either “aarch64” (if gnu coreutils) or
“arm64” (if apple’s uname). We should support both for compatiblity
here.
|
|
|
|
fix tokens documentation
|
|
|
|
|
|
This is useful for generating the nix manpages, but it may have other
applications (like generating configuration files without a Nix store).
|
|
|
|
|
|
Remove `unknown pragma` gcc warning
|
|
|
|
|
|
This gets rid of some pointless casts.
|