1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-24 11:19:35 +01:00
Commit graph

6854 commits

Author SHA1 Message Date
Eelco Dolstra
cf2198d7b0 Respect /etc/hosts
https://hydra.nixos.org/build/161439329
(cherry picked from commit e2e5f3a78f)
2021-12-13 21:15:43 +01:00
Eelco Dolstra
86829056fa
Merge pull request #5742 from jtojnar/manual-links-backport
[Backport] Update manual links
2021-12-07 22:05:31 +01:00
Eelco Dolstra
671cd216ff
Merge pull request #5721 from obsidiansystems/fix-5299-backport
Backport #5696 to 2.4
2021-12-07 21:50:44 +01:00
Jan Tojnar
2346eeaa80 Update manual links
Fixes: https://github.com/NixOS/nixos-homepage/issues/762

(cherry picked from commit ae21aab456)
2021-12-07 14:50:12 +01:00
regnat
ee06da923b Make nix-shell work when nixpkgs is content-addressed
Fix #5259
2021-12-06 10:16:35 +01:00
John Ericson
2f92f231de Fix #5299
No matter what, we need to resize the buffer to not have any scratch
space after we do the `read`. In the end of file case, `got` will be 0
from it's initial value.

Before, we forgot to resize in the EOF case with the break. Yes, we know
we didn't recieve any data in that case, but we still have the scatch
space to undo.

Co-Authored-By: Will Fancher <Will.Fancher@Obsidian.Systems>
2021-11-30 17:18:33 -05:00
John Ericson
2f916acf2f Push wopAddToStore old style stream adapters into smaller scopes
This doesn't fix the bug, but makes the code less difficult to read.
Also improve the comments, now that it is clear what part is needed in
each code path.
2021-11-30 17:18:33 -05:00
John Ericson
946098a3e0 Nix daemon stream old wopAddToStore
No more buffering in string.
2021-11-30 17:18:33 -05:00
Arthur Gautier
1fdd536402 preloadNSS: rework the dns query workaround
backport of https://github.com/NixOS/nix/pull/5384 to nix 2.4
2021-11-25 13:04:09 -08:00
Kalle Jepsen
9b258d2f98 Simplify fix by disallowing / in front of @ to match scp style 2021-11-25 14:52:32 +01:00
Kalle Jepsen
23ba64b277 Fix detection of scp-style URIs to support non-standard SSH ports for git 2021-11-25 14:52:32 +01:00
Matthew Bauer
ceabe106c8 Set new rosetta 2 path in sandbox
see:

https://github.com/NixOS/nix/pull/5388

and

https://github.com/NixOS/nix/pull/5251
(cherry picked from commit 08b1ac3e38)
2021-11-22 14:44:32 -06:00
yvt
a9d122dcd8 Add another path where a Rosetta 2 configuration file is possibly located
(cherry picked from commit a9d9e55551)
2021-11-22 14:44:20 -06:00
Doron Behar
734f46fb46 libstore: Use unix-dotfile vfs if useSQLiteWAL is false
(cherry picked from commit 14fcf17277)
2021-11-05 13:20:34 +01:00
Alexey Novikov
b84c4c0770 Fix error detection in 'base64Decode()'
Fixed a bug in initialization of 'base64DecodeChars' variable.
Currently decoder do not fail on invalid Base64 strings.
Added test-case to verify the fix.

Also have made 'base64DecodeChars' to be computed at compile time.
And added a test case to encode/decode string with non-printable charactes.

(cherry picked from commit 64a3b045c1)
2021-11-01 15:26:42 +01:00
Eelco Dolstra
64484c4da3 Remove redundant 'warning:'
(cherry picked from commit 5a160171d0)
2021-11-01 15:25:37 +01:00
Eelco Dolstra
ff695dd150 nix repl: Don't write to std::cout directly
Writing to std::cout doesn't play nice with ProgressBar.

(cherry picked from commit f6cdae5181)
2021-10-27 17:40:28 +02:00
Eelco Dolstra
0cf2815007 nix repl: Don't build in a child process
Fixes #5356. This is a bit risky due to interrupts, but we have to
deal with those anyway (#5353).

(cherry picked from commit 9ebe02a81e)
2021-10-27 17:40:23 +02:00
Maximilian Bosch
8867e65128 nix repl: properly deal with interruptions
When I stop a download with Ctrl-C in a `nix repl` of a flake, the REPL
refuses to do any other downloads:

    nix-repl> builtins.getFlake "nix-serve"
    [0.0 MiB DL] downloading 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca41 error: download of 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca416e5a9415d4972b0f0' was interrupted
    [0.0 MiB DL]
    nix-repl> builtins.getFlake "nix-serve"
    error: interrupted by the user
    [0.0 MiB DL]

To fix this issue, two changes were necessary:

* Reset the global `_isInterrupted` variable: only because a single
  operation was aborted, it should still be possible to continue the
  session.
* Recreate a `fileTransfer`-instance if the current one was shut down by
  an abort.

(cherry picked from commit 0872659002)
2021-10-27 17:39:35 +02:00
kvtb
20624d9a3b fix build with gcc11
(cherry picked from commit eae29b0385)
2021-10-27 17:36:34 +02:00
Eelco Dolstra
3fdeae0f0a daemon: Accept 'repeat' setting from untrusted users
Fixes #5352.

(cherry picked from commit 6e684d1b87)
2021-10-27 17:34:42 +02:00
Eelco Dolstra
1131d73050 build-remote: Implicitly add the 'builtin' system type to all machines
This makes 'nix-env -i --max-jobs 0' work with remote builders.

(cherry picked from commit 1254e8753c)
2021-10-27 17:34:34 +02:00
Eelco Dolstra
a669798b0b If max-jobs == 0, do preferLocalBuild on remote builders
(cherry picked from commit f2280749b1)
2021-10-27 17:34:26 +02:00
regnat
ccdd12bbfa
(partially) Revert "Don't copy in rethrow"
This reverts some parts of commit
8430a8f086 which was trying to rethrow
some exceptions while we weren’t in the context of a `catch` block,
causing some weird “terminate called without an active exception”
errors.

Fix #5368

(cherry picked from commit 7466048d39)
2021-10-11 12:54:35 +02:00
Sergei Trofimovich
70331bb91d libstore-tests: add libutil dependency (fix static link failure)
In https://github.com/NixOS/nix/pull/5350 we noticed link failures
pkgsStatic.nixUnstable. Adding explicit dependency on libutil fixes
libstore-tests linking.

(cherry picked from commit d7d6fe44d6)
2021-10-08 09:39:01 +02:00
Eelco Dolstra
d39692e6b3 Make builtins.{path,filterSource} work with chroot stores 2021-10-07 14:22:39 +02:00
Eelco Dolstra
c4dcf3cf25 Add a trace to all errors in addPath() 2021-10-07 13:47:15 +02:00
Eelco Dolstra
4806f2f6b0 Allow builtins.{path,filterSource} on paths with a context
We now build the context (so this has the side-effect of making
builtins.{path,filterSource} work on derivations outputs, if IFD is
enabled) and then check that the path has no references (which is what
we really care about).
2021-10-07 13:43:17 +02:00
Eelco Dolstra
66c4b20d8b Typo 2021-10-07 13:34:04 +02:00
Eelco Dolstra
7c50568788 Remove unnecessary call to queryMissing()
Worker::run() already does this.
2021-10-07 13:15:01 +02:00
Eelco Dolstra
972405edf5 Allow access to path copied to the store
Fixes https://github.com/NixOS/nix/pull/5163#issuecomment-931733912.
2021-10-07 12:15:22 +02:00
Eelco Dolstra
cfaad7168e Refactoring: Add allowPath() method 2021-10-07 12:11:00 +02:00
Eelco Dolstra
c9ee634f75
Merge pull request #5341 from andir/libexpr-formals
libexpr: remove matchAttrs boolean from ExprLambda
2021-10-07 11:58:56 +02:00
Eelco Dolstra
53e4794289
Merge pull request #5286 from ilkecan/add-a-warning-to-filterSource
Warn about the usage of filterSource with Nix store paths
2021-10-06 21:02:39 +02:00
ilkecan
a4a6ef4fb2 Add a warning to filterSource
Warn about the usage of `filterSource` with Nix store paths
2021-10-06 19:25:33 +03:00
Eelco Dolstra
0dc8172458 Remove no-op call to realiseContext() 2021-10-06 18:08:37 +02:00
Eelco Dolstra
c497fce011 Merge branch 'flakes_filterSource' of https://github.com/tomberek/nix 2021-10-06 18:08:18 +02:00
Eelco Dolstra
57a8eb4c01 fetchTree(): Parse type attribute first
The 'url' attribute depends on whether type == 'git', so this is needed for

  builtins.fetchTree {url = "git@github.com:NixOS/nix.git"; type = "git";}
2021-10-06 17:39:02 +02:00
Eelco Dolstra
83d86cc1b0 Cleanup 2021-10-06 17:30:10 +02:00
Andreas Rammhold
cae41eebff libexpr: remove matchAttrs boolean from ExprLambda
The boolean is only used to determine if the formals are set to a
non-null pointer in all our cases. We can get rid of that allocation and
instead just compare the pointer value with NULL. Saving up to
sizeof(bool) + platform specific alignment per ExprLambda instace.
Probably not a lot of memory but perhaps a few kilobyte with nixpkgs?

This also gets rid of a potential issue with dereferencing formals based on
the value of the boolean that didn't have to be aligned with the formals
pointer but was in all our cases.
2021-10-06 17:24:06 +02:00
Eelco Dolstra
46753b5e9c Merge branch 'considerate/scp-like-urls' of https://github.com/considerate/nix 2021-10-06 17:19:27 +02:00
Eelco Dolstra
c6718a9d95 Don't reset the logger in a vfork
9c766a40cb broke logging from the
daemon, because commonChildInit is called when starting the build hook
in a vfork, so it ends up resetting the parent's logger. So don't
vfork.

It might be best to get rid of vfork altogether, but that may cause
problems, e.g. when we call an external program like git from the
evaluator.
2021-10-06 13:54:59 +02:00
Eelco Dolstra
08aa7daee0 Remove links to .md files in help output
Fixes #5337.
2021-10-06 13:01:18 +02:00
Eelco Dolstra
fd57e7074f
Merge pull request #5335 from edolstra/socket-paths
Support arbitrary-length socket paths
2021-10-05 17:36:07 +02:00
Eelco Dolstra
b14bc06955 Don't ignore SIGCHLD in createUnixDomainSocket() 2021-10-05 13:23:16 +02:00
Eelco Dolstra
e4a5d64a81 Show failing PID 2021-10-05 13:19:55 +02:00
Eelco Dolstra
b299560872 Typo 2021-10-05 11:24:09 +02:00
Eelco Dolstra
3b7f4c7d9d Add FIXME about ptsname 2021-10-05 11:04:46 +02:00
Eelco Dolstra
43d4d75e22 Connect/bind Unix domain sockets in a child process
In the child process, we can do a chdir() and avoid the problem of the
path not fitting into sockaddr_un.
2021-10-05 10:44:59 +02:00
Eelco Dolstra
77ebbc9f54 Add a test for RefScanSink and clean up the code
Issue #5322.
2021-10-04 14:29:42 +02:00