Age | Commit message (Collapse) | Author |
|
Fixes #5741
|
|
Libarchive documentation mentions that archive_entry_set_pathname
expects us to keep the passed string alive, which we don't.
|
|
Tidy up the logging
|
|
Due to missing <atomic> declaration the build fails as:
src/libutil/util.hh:350:24: error: no match for 'operator||' (operand types are 'std::atomic<bool>' and 'bool')
350 | if (_isInterrupted || (interruptCheck && interruptCheck()))
| ~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| std::atomic<bool> bool
|
|
Use the macros more, so we properly skip work when the log level
excludes. Also log the daemon operation number on the daemon side.
|
|
Fixes #5674.
|
|
|
|
According to XDG Base Directory Specification,
it should fall back to /etc/xdg when the env var is not present.
|
|
This prevents Nix from barfing when run in a container where it
doesn't have the appropriate privileges.
|
|
|
|
|
|
|
|
|
|
|
|
Rather than having them plain strings scattered through the whole
codebase, create an enum containing all the known experimental features.
This means that
- Nix can now `warn` when an unkwown experimental feature is passed
(making it much nicer to spot typos and spot deprecated features)
- It’s now easy to remove a feature altogether (once the feature isn’t
experimental anymore or is dropped) by just removing the field for the
enum and letting the compiler point us to all the now invalid usages
of it.
|
|
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.
|
|
This ensures any started processes can't write to /nix/store (except
during builds). This partially reverts 01d07b1e, which happened because
of #2646.
The problem was only happening after nix downloads anything, causing
me to suspect the download thread. The problem turns out to be:
"A process can't join a new mount namespace if it is sharing
filesystem-related attributes with another process", in this case this
process is the curl thread.
Ideally, we might kill it before spawning the shell process, but it's
inside a static variable in the getFileTransfer() function. So
instead, stop it from sharing FS state using unshare(). A strategy
such as the one from #5057 (single-threaded chroot helper binary) is
also very much on the table.
Fixes #4337.
|
|
|
|
|
|
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
|
|
|
|
The garbage collector no longer blocks other processes from
adding/building store paths or adding GC roots. To prevent the
collector from deleting store paths just added by another process,
processes need to connect to the garbage collector via a Unix domain
socket to register new temporary roots.
|
|
|
|
Based off on @dtzWill's #2276
|
|
9c766a40cbbd3a350a9582d0fd8201e3361a63b2 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.
|
|
|
|
|
|
In the child process, we can do a chdir() and avoid the problem of the
path not fitting into sockaddr_un.
|
|
`size_t` is 32-bit on 32-bit platforms, while the file size can be bigger
|
|
With -vvvv, the ProgressBar was polluting the stderr of the child,
messing up its \2 message to the parent.
|
|
|
|
|
|
Change warning messages from yellow to magenta
|
|
nix --help: Display help using lowdown instead of man
|
|
This matches gcc and clang.
|
|
|
|
|
|
|
|
Also get rid of _killStderr because it wasn't actually checked
anywhere.
|
|
Fixes #4476.
Fixes #5231.
|
|
|
|
|
|
Issues #4499.
|
|
Don't overwrite user provided `lib*_LDFLAGS`
|
|
This fixes a class of crashes and introduces ptr<T> to make the
code robust against this failure mode going forward.
Thanks regnat for the idea of a ref<T> without overhead!
Closes #4895
Closes #4893
Closes #5127
Closes #5113
|
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
Fixes #5159
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
|
|
* libstore: `bz2` should not be linked
* libutil: `zlib.h` should not be included
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
Previously, despite having a boolean that tracked initialization, the
decode characters have been "calculated" every single time a base64
string was being decoded.
With this change we only initialize the decode array once in a
thread-safe manner.
|
|
Otherwise I get a compiler error when building for NetBSD:
src/libutil/util.cc: In function 'void nix::_deletePath(const Path&, uint64_t&)':
src/libutil/util.cc:438:17: error: base operand of '->' is not a pointer
438 | AutoCloseFD dirfd(open(dir.c_str(), O_RDONLY));
| ^~~~~
src/libutil/util.cc:439:10: error: 'dirfd' was not declared in this scope
439 | if (!dirfd) {
| ^~~~~
src/libutil/util.cc:444:17: error: 'dirfd' was not declared in this scope
444 | _deletePath(dirfd.get(), path, bytesFreed);
| ^~~~~
|