Commit Graph

7161 Commits

Author SHA1 Message Date
Domen Kožar
0828ace09b
Merge pull request #4389 from hercules-ci/backport-issue-3964-substitution-loop
Backport issue 3964 substitution loop
2020-12-25 15:59:31 +00:00
Robert Hensing
8388e2ea48 Revert "Tests for #3964"
This reverts commit e90530e491.

It appears that this backported test relies on new functionality.

The error is:

    + nix copy --to file:///build/nix-test/binary-cache /build/nix-test/store/dckdy2xp7sn8qvyx8axxjq7clnxddri1-multi-output
    warning: you don't have Internet access; disabling some network-dependent features
    error: uploading to 'file:///build/nix-test/binary-cache/nar/0hpfhrig9h6fvbjmiwsb7zkaxr19vr2w048y4xb3nrs36bagf92n.nar.xz' is not supported
2020-12-22 11:57:31 +01:00
Robert Hensing
e90530e491 Tests for #3964
(cherry picked from commit ea8d32020e)
2020-12-22 11:50:57 +01:00
Robert Hensing
c29fffeaaa DerivationGoal: only retry if output closure incomplete is only problem
(cherry picked from commit bd9eb5c743)
2020-12-22 11:46:22 +01:00
Eelco Dolstra
8803753666
Merge pull request #4374 from NixOS/2.3-absolute-url-in-binary-caches
Allow HTTP binary cache to request absolute uris
2020-12-16 14:42:25 +01:00
Domen Kožar
6de15f722d
Allow HTTP binary cache to request absolute uris 2020-12-16 14:13:15 +01:00
Eelco Dolstra
359c07b9fd
Merge pull request #4368 from piegamesde/backport-json-unicode-escape
Backport json unicode escaping to 2.3
2020-12-16 12:48:14 +01:00
Nikola Knezevic
0f35904915 Add support for \u escape in fromJSON
As fromTOML supports \u and \U escapes, bring fromJSON on par. As JSON defaults
to UTF-8 encoding (every JSON parser must support UTF-8), this change parses the
`\u hex hex hex hex` sequence (\u followed by 4 hexadecimal digits) into an
UTF-8 representation.

Add a test to verify correct parsing, using all escape sequences from json.org.
2020-12-15 18:49:32 +01:00
Nikola Knezevic
b595df5423 Remove redundant check in parseJSONString 2020-12-15 18:48:49 +01:00
Eelco Dolstra
62f01d7ed3
Bump version 2020-12-04 12:23:09 +01:00
Matthew Bauer
f82490c561
Update config.guess 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

(cherry picked from commit 94f359525e)
2020-12-04 12:22:31 +01:00
Eelco Dolstra
8d65ec5457
Merge pull request #4312 from lukegb/bug4295
When moving paths out of sandbox, ensure we have write permission
2020-12-04 12:22:06 +01:00
Luke Granger-Brown
2239953894 When moving paths out of sandbox, ensure we have write permission.
If we're a single-user installation of Nix, then we won't have root
superpowers to just ignore the permission bits. This means that we'll
need permission on the directory (if it's a directory) that we're moving
in order to move it with rename, because it must update the ".."
directory entry.

Fixes #4295.

This is already working in master, thanks to
e913a2989f (and followup cleanups).
2020-12-04 04:33:33 +00:00
Travis A. Everett
6456941993
enable Darwin.arm64 to install x86_64 binary
Throwing @thefloweringash under the bus if this doesn't work, but it
sounds like Apple Silicon devices can use the x86_64 binary for now.

Fixes #4058

(cherry picked from commit 4864df6d6b)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-11-20 10:51:51 +01:00
Eelco Dolstra
c67264d218
Bump version 2020-10-29 14:45:37 +01:00
Eelco Dolstra
7f1de4d5ed
Merge pull request #3405 from hercules-ci/issue-3398-path-info-cache-ttls-backport-2.3
pathInfoCache: Respect disk cache TTLs #3398 (2.3 backport)
2020-10-29 12:44:16 +01:00
Marwan Aljubeh
a39798b64c
Fix the nix-daemon Mac OS SSL CA cert
Mac OS multi-user installations are currently broken because all requests
made by nix-daemon to the binary cache fail with:

```
unable to download ... Problem with the SSL CA cert (path? access rights?) (77).
```

This change ensures that the nix-daemon knows where to find the SSL CA cert file.

Fixes #2899 and #3261.

(cherry picked from commit b7c02232b2)
2020-10-21 12:19:53 +02:00
Travis A. Everett
51a4a5e1cf
adapt to apfs.util flag diff in catalina/big sur
Fixes #3957. Just runs both forms to minimize moving parts.

(cherry picked from commit fe807904e5)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-10-20 12:21:45 +02:00
Travis A. Everett
613297a528
replace xpath with xmllint --xpath; simplify
As mentioned in previous commit, Big Sur changes the syntax for the
xpath command slightly.

In the process of testing out replacements for these, I noticed a few
small simplification wins.

(cherry picked from commit e736f8f6e4)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-10-20 12:21:45 +02:00
Travis A. Everett
72b8673e06
fix xpath and conditional bugs; xpath -> xmllint
- xpath -> xmllint: xpath's cli interface changed in Big Sur
  rather than add conditional logic for picking the correct
  syntax for xpath, I'm changing to xmllint --xpath, which
  appears to be consistent across versions I've tested...

- /plist/dict/key[text()='Writable']/following-sibling::true[1]
  doesn't do quite what's expected. It was written to try to
  select a <true /> node paired with the Writable key, but it
  will also select the *next* <true /> node that appears even
  if it was paired with another key.

- I think there's also a logic bug in the conditionals here.
  I'm not sure anyone ever actuall saw it, thanks to the xpath
  bug, though. With the xpath fix, this conditional passes if /nix
  does not exist, / IS writable, and the version is Catalina+.

  I think it meant to test for /nix does not exist, / is NOT
  writable, and the version is Catalina+. I reworked this lightly
  to make it a little clearer at the code level.

(cherry picked from commit 1f02b65c59)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-10-20 12:21:44 +02:00
Travis A. Everett
14c7e77bc4
update macOS version handling for Big Sur
Keeping this commit narrow for reviewability, but some of these
conditionals will change in subsequent commits in this PR.

Fixes #3852.

(cherry picked from commit 9c3dc9d7ca)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-10-20 12:21:41 +02:00
Eelco Dolstra
00a52f61f4
Installer: Set a known umask
Fixes #1560, #2377.

(cherry picked from commit 924712eef1)
2020-10-12 16:57:26 +02:00
Eelco Dolstra
f09b375837
Prevent a deadlock when user namespace setup fails
Observed on Centos 7 when user namespaces are disabled:
DerivationGoal::startBuilder() throws an exception, ~DerivationGoal()
waits for the child process to exit, but the child process hangs
forever in drainFD(userNamespaceSync.readSide.get()) in
DerivationGoal::runChild(). Not sure why the SIGKILL doesn't get
through.

Issue #4092.

(cherry picked from commit d761485010)
2020-10-07 09:10:24 +02:00
Eelco Dolstra
682694e03a
Merge pull request #3984 from hercules-ci/backport-darwin-tmp-dir-3488
never use /var/folders for TMPDIR on darwin (2.3 backport)
2020-09-02 15:46:25 +02:00
Daiderd Jordan
f6ff68479e never use /var/folders for TMPDIR on darwin
This doesn't just cause problems for nix-store --serve but also results
in certain build failures. Builds that use unix domain sockets in their
tests often fail because the /var/folders prefix already consumes more
than half of the maximum length of socket paths.

    struct sockaddr_un {
       sa_family_t sun_family;               /* AF_UNIX */
       char        sun_path[108];            /* Pathname */
    };

(cherry picked from commit 4d9db420ff)
2020-09-02 15:41:43 +02:00
Eelco Dolstra
40d031d57c
Merge pull request #3926 from nh2/2.3-issue-3906-gc-build-errors-backport
repl.cc: Check for HAVE_BOEHMGC
2020-08-13 10:59:35 +02:00
Eelco Dolstra
d5c7efae38 repl.cc: Check for HAVE_BOEHMGC
Fixes #3906.

(cherry picked from commit 59067f0f58)
2020-08-13 04:34:36 +02:00
Eelco Dolstra
8b04d28a5b
createUnixDomainSocket(): Fix off-by-one error in copying the socket path
Reported by Kane York.

(cherry picked from commit 2292814049)
2020-07-24 20:50:05 +02:00
Eelco Dolstra
c728d375de
Bump version 2020-07-08 21:03:03 +02:00
Eelco Dolstra
975efd530c
Merge pull request #3790 from basvandijk/2.3-gc-fix
Cherry-pick "Use fragment size for autoGC capacity calculation" on 2.3
2020-07-08 20:50:48 +02:00
Samir Talwar
d5ecb8d3cd
Instruct the user to follow redirects when installing Nix.
Nix installation now requires following redirects using `curl -L`. This
is currently represented on the [Nix download page][] but not in the
manual. This change updates the manual to reflect this.

Using `curl` without the `-L` flag results in an empty body, making
installation a no-op.

[Nix download page]: https://nixos.org/download.html

(cherry picked from commit 9069759767)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-07-08 14:21:13 +02:00
Jörg Thalheim
4281bc6227
docs/installer: add correct curl flags
also see https://nixos.org/download.html

(cherry picked from commit 3685f4eec6)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-07-08 14:20:54 +02:00
Jude Taylor
15876ec4a0 nix auto-gc: use fragment size
(cherry picked from commit e2fc575c61)
2020-07-07 15:40:24 +02:00
Eelco Dolstra
8397c94081
Bump version 2020-06-30 17:53:34 +02:00
Eelco Dolstra
3933cf56af
NAR parser: Fix missing name field check
Discovered by @Kloenk.

(cherry picked from commit 2b834d48aa)
2020-06-30 17:53:17 +02:00
Eelco Dolstra
96310a4d7d
nix repl: Scan NixRepl for GC roots
Fixes #3175.

(cherry picked from commit b244e65cdb)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-06-18 10:31:40 +02:00
John Ericson
d2008f2fff
unbreak build without pch
(cherry picked from commit d64ab5131c)
2020-06-02 23:09:19 +02:00
Eelco Dolstra
734488a00f
Merge pull request #3646 from NixOS/2.3-wsl
Disable use-sqlite-wal under WSL
2020-06-01 19:49:20 +02:00
Brian McKenna
35f5da530a
Disable use-sqlite-wal under WSL
Before:

    $ nix-channel --update
    unpacking channels...
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)

After:

    $ inst/bin/nix-channel --update
    unpacking channels...
    created 1 symlinks in user environment

I've seen complaints that "sandbox" caused problems under WSL but I'm
having no problems. I think recent changes could have fixed the issue.

(cherry picked from commit d25923263e)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-06-01 17:15:33 +02:00
Eelco Dolstra
a729883bf1
Bump version 2020-05-28 12:29:21 +02:00
Daiderd Jordan
a836abc5bd
installer: don't require xz on darwin
On macOS the system tar has builtin support for lzma while xz isn't
available as a separate binary.  There's no builtin package manager
there available either so having to install lzma (without nix) would be
rather painful.

(cherry picked from commit 4e6d7cb55a)
2020-05-28 12:29:03 +02:00
Eelco Dolstra
2fad345ae1
Bump version 2020-05-27 12:28:10 +02:00
Eelco Dolstra
9f4281d9ba
Remove the 'release' job
Unless the 'tested' job in the Nixpkgs/NixOS jobsets, this job isn't
actually used for anything (e.g. we don't update a channel based on
whether 'release' succeeds).

(cherry picked from commit 5392884eb1)
2020-05-27 12:27:24 +02:00
Eelco Dolstra
44d0897ac8 Merge pull request #3628 from domenkozar/2.3-installer-fixes
2.3 installer fixes
2020-05-27 11:02:23 +02:00
Domen Kožar
e15dc6783a
installer: fix unused variable
(cherry picked from commit 3d3c219d91)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 16:23:25 +02:00
Domen Kožar
f117c54318
Fix installer script bugs
- --no-channel-add didn't have effect on multi-user installation
- some new flags didn't work at all
- document all installer flags

(cherry picked from commit 1a5ac894e9)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 15:51:40 +02:00
Daiderd Jordan
07e29830c5
sandbox: fix /bin/sh on catalina
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it
can't be used anymore without also opening up the sandbox to allow bash.

    Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).

(cherry picked from commit 2e9bc1245c)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:19 +02:00
Daiderd Jordan
27e7153771
sandbox: allow pty devices
Nix now runs builds with a pseudo-terminal to enable colored build
output.

(cherry picked from commit f6c122aaeb)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:15 +02:00
Daiderd Jordan
f953a51d43
libstore: relax default sandbox-paths on darwin
(cherry picked from commit 7f2df903d9)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:11 +02:00
Daiderd Jordan
ec9bfa7afd
libstore: disable resolve-system-dependencies hook
This is used to determine the dependency tree of impure libraries so nix
knows what paths to open in the sandbox.  With the less restrictive
defaults it isn't needed anymore.

(cherry picked from commit afb78ebd34)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:04 +02:00