Eelco Dolstra
561440bd6d
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-11-16 15:07:22 +01:00
Yorick van Pelt
34ea0e2e7b
tarfile: set directory mode to at least 0500, don't extract fflags
...
We don't need SGID, or any ACL's. We also want to keep every dir +rx.
2022-11-01 16:01:38 +01:00
Eelco Dolstra
a653e98f55
Encode virtual paths as /nix/store/virtual000<N>
...
This makes lib.isStorePath in nixpkgs return true for source trees and
fixes some cases where /__nix_virtual__ showed up in the NixOS manual.
2022-10-27 15:57:56 +02:00
Eelco Dolstra
511590976c
Fix handling of relative paths
...
In particular, 'path:..' got turned into 'path:.' because isRelative()
returned a CanonPath, which cannot represent '..'.
Reported by @erikarvstedt.
2022-10-10 18:56:19 +02:00
Eelco Dolstra
5c8d67d553
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-10-10 14:51:22 +02:00
Eelco Dolstra
241dd5481e
warnOnce(): Fix boost exception when the message contains a format character
2022-09-30 15:21:43 +02:00
Eelco Dolstra
c3c0682842
Don't show "from call site" when we don't know the call site
...
This gets rid of stack trace entries like
… from call site
at «stdin»:0: (source not available)
2022-09-28 17:01:16 +02:00
Eelco Dolstra
28b62dd3e0
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-09-28 14:13:44 +02:00
squalus
223f8dace0
archive: check close errors when extracting nars
2022-09-22 12:50:32 -07:00
squalus
1b595026e1
Improve durability of schema version file writes
...
- call close explicitly in writeFile to prevent the close exception
from being ignored
- fsync after writing schema file to flush data to disk
- fsync schema file parent to flush metadata to disk
https://github.com/NixOS/nix/issues/7064
2022-09-19 20:13:30 -07:00
Eelco Dolstra
d365cced4f
Trim option descriptions
...
This removes unintended blank lines in Markdown when the description
is a multiline string literal.
2022-09-13 16:58:32 +02:00
Eelco Dolstra
034340aa9f
Fix potential duplicate activity IDs in forked child processes
2022-08-26 13:14:04 +02:00
Eelco Dolstra
def7b251d0
readLittleEndian(): Fix 64-bit integer truncation
...
Fixes #6939 .
2022-08-26 13:10:42 +02:00
Eelco Dolstra
13c0db4d06
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-25 17:41:12 +02:00
Eelco Dolstra
bb411e4ae1
Fix progress bar flicker with -L
...
This was caused by -L calling setLogFormat() again, which caused the
creation of a new progress bar without destroying the old one. So we
had two progress bars clobbering each other.
We should change 'logger' to be a smart pointer, but I'll do that in a
future PR.
Fixes #6931 .
2022-08-24 22:36:40 +02:00
Eelco Dolstra
91aea1572e
Fix macOS build, where le32toh is not available
2022-08-22 14:09:52 +02:00
Naïm Favier
8188b1d0ab
json: write null on abnormal placeholder destruction
...
Avoids leaving dangling attributes like
{
"foo":
}
in case of exceptions.
2022-08-19 01:00:10 +02:00
Eelco Dolstra
53e7b7e8ac
Remove warnLargeDump()
...
This message was unhelpful (#1184 ) and probably misleading since
memory is O(1) in most cases now.
2022-08-17 11:32:01 +02:00
Eelco Dolstra
2d76ef0b7b
Remove warnLargeDump()
...
This message was unhelpful (#1184 ) and probably misleading since
memory is O(1) in most cases now.
2022-08-12 12:28:02 +02:00
Eelco Dolstra
dd1dac0f78
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-10 12:38:31 +02:00
Théophane Hufschmitt
5192bb093a
Merge remote-tracking branch 'upstream/master' into fix-mv-in-different-filesystems
2022-08-08 15:42:56 +02:00
Théophane Hufschmitt
f4a8426098
Remove the explicit c++fs linkage on darwin
...
Doesn't seem needed on a recent-enough clang anymore (and even seems to
break stuff)
2022-08-08 14:34:22 +02:00
Dave Nicponski
cb6794a0d9
Do not spam logs if the owned-homedir check results in a noop
2022-08-07 10:13:11 -04:00
Eelco Dolstra
15f37eeb5a
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-04 13:34:38 +02:00
Eelco Dolstra
ccbd906c86
Fix NIX_COUNT_CALLS=1
...
Also, make the JSON writer support std::string_view.
Fixes #6857 .
2022-08-03 17:46:51 +02:00
Théophane Hufschmitt
1ba5b3e001
Make moveFile more atomic
...
Rather than directly copying the source to its dest, copy it first to a
temporary location, and eventually move that temporary.
That way, the move is at least atomic from the point-of-view of the destination
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
90f9680733
Only use renameFile where needed
...
In most places the fallback to copying isn’t needed and can actually be
bad, so we’d rather not transparently fallback
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
d71d9e9fbf
moveFile -> renameFile
...
`move` tends to have this `mv` connotation of “I will copy it for you if
needs be”
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
a4f0fd633c
Link against c++fs on darwin
...
Required by the old clang version
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c5db1821a9
Re-implement the recursive directory copy
...
The recursive copy from the stl doesn’t exactly do what we need because
1. It doesn’t delete things as we go
2. It doesn’t keep the mtime, which change the nars
So re-implement it ourselves. A bit dull, but that way we have what we want
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
6f89fb6008
rename: Fallback to a copy if the filesystems mismatch
...
In `nix::rename`, if the call to `rename` fails with `EXDEV` (failure
because the source and the destination are in a different filesystems)
switch to copying and removing the source.
To avoid having to re-implement the copy manually, I switched the
function to use the c++17 `filesystem` library (which has a `copy`
function that should do what we want).
Fix #6262
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c2de0a232c
Create a wrapper around stdlib’s rename
...
Directly takes some c++ strings, and gently throws an exception on error
(rather than having to inline this logic everywhere)
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
8119390abc
Move some fs-related functions to their own file
...
Unclutter `util.cc` a bit
2022-08-03 10:27:25 +02:00
Eelco Dolstra
022390af5a
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-07-22 15:27:40 +02:00
Théophane Hufschmitt
2805439335
Merge pull request #6814 from amjoseph-nixpkgs/pr/sandbox-error-messages
...
local-derivation-goal.cc: improve error messages when sandboxing fails
2022-07-22 13:27:52 +02:00
Alex Wied
722de8ddcc
libstore/globals.cc: Move cgroup detection to libutil
2022-07-19 16:25:53 -04:00
Adam Joseph
a9e75eca00
error.hh: add additional constructor with explicit errno argument
2022-07-19 03:49:33 -07:00
Eelco Dolstra
934f317250
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-07-13 12:50:03 +02:00
Théophane Hufschmitt
f071eb3702
Merge pull request #6693 from ncfavier/complete-flake-inputs
...
Improve shell completion of flake inputs
2022-07-12 09:12:00 +02:00
Naïm Favier
711b2e1f48
Fix flake input completion for InstallablesCommands
...
Defers completion of flake inputs until the whole command line is parsed
so that we know what flakes we need to complete the inputs of.
Previously, `nix build flake --update-input <Tab>` always behaved like
`nix build . --update-input <Tab>`.
2022-07-11 15:13:51 +02:00
Eelco Dolstra
a18b3c665a
Store a ref to InputAccessor in SourcePath
2022-07-06 17:25:15 +02:00
Eelco Dolstra
72dffd6c6c
Connect AbstractPos with Pos
2022-07-05 20:45:29 +02:00
Eelco Dolstra
9e9170a92e
Introduce AbstractPos
2022-07-05 20:45:29 +02:00
Théophane Hufschmitt
4c8210095e
Merge pull request #6233 from flox/nix-repl-flakes
...
Nix repl flakes
2022-06-29 17:59:22 +02:00
Eelco Dolstra
03002203b7
Fix static build
2022-06-23 18:00:10 +02:00
Eelco Dolstra
f959ce3e03
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-06-23 17:24:44 +02:00
Eelco Dolstra
1e55ee2961
getSelfExe(): Support macOS
2022-06-23 01:32:46 +02:00
Eelco Dolstra
d3176ce076
Fix build-remote in nix-static
...
'build-remote' is now executed via /proc/self/exe so it always works.
2022-06-23 01:32:46 +02:00
Eelco Dolstra
f6cf644e5f
Style
2022-06-22 15:35:52 +02:00
Dave Nicponski
ca2be509b9
Verify $HOME is owned by current user in getHome(), if it exists.
...
Useful because a default `sudo` on darwin doesn't clear `$HOME`, so things like `sudo nix-channel --list`
will surprisingly return the USER'S channels, rather than `root`'s.
Other counterintuitive outcomes can be seen in this PR description:
https://github.com/NixOS/nix/pull/6622
2022-06-17 17:42:08 -04:00