This repository was archived by the owner on May 14, 2024. It is now read-only.
Open
Conversation
- `fun` was used for variable/field names in a number of places. These have been replaced by similar or more descriptive names, to avoid name shadowing, which is not allowed in the GCC-based build. - Use in-place construction instead of assignment. - `FilteringSourceAccessor::checkAccess` had a fallback for when `makeNotAllowedError` was null. Since `MakeNotAllowedError` is now `fun<>`, we've proven the null branch is dead code and have removed it. - `src/nix/flake.cc`, `src/nix/search.cc`, `src/nix/ls.cc` are left as-is — the self-referential lambdas there cause too much reindentation for too little benefit.
manual: Skip changelog-d on i686
Have `fun`: `std::function` without null
Co-authored-by: Artemis Tosini <artemis.tosini@obsidian.systems>
This was done in 9799023 but accidentally reverted during a merge.
This will allow us to use boost::fibers with the SyncBase class.
…link LocalStore: stop creating outdated profiles symlink
libutil: Template SyncBase over `condition_variable` implementation
This seems quite natural to me, since boehm is necessarily a global resource. I still think that it would be best if we don't make it a requirement to only have a single instance of EvalState per thread, but specifically for this use-case thread_local is a perfect fit.
Because unsigned char * can alias anything, the compiler has no choice
but to actually iterate byte-by-byte in readNum and readLittleEndian:
│ movzbl -0x2f(%rbp),%eax
12.54 │ movzbl -0x2e(%rbp),%edx
│ shl $0x8,%rax
1.88 │ shl $0x10,%rdx
│ or %rdx,%rax
│ movzbl -0x30(%rbp),%edx
5.09 │ or %rdx,%rax
2.37 │ movzbl -0x2d(%rbp),%edx
│ shl $0x18,%rdx
3.95 │ or %rdx,%rax
│ movzbl -0x2c(%rbp),%edx
│ shl $0x20,%rdx
│ or %rax,%rdx
5.59 │ movzbl -0x2b(%rbp),%eax
3.29 │ shl $0x28,%rax
│ or %rdx,%rax
7.83 │ movzbl -0x2a(%rbp),%edx
│ shl $0x30,%rdx
│ or %rax,%rdx
8.22 │ movzbl -0x29(%rbp),%eax
│ shl $0x38,%rax
│ or %rdx,%rax
6.42 │ mov %rax,%rcx
│ mov %rax,-0x60(%rbp)
1.35 │ shr $0x20,%rcxA
Which now compiles down to:
2.20 │ mov -0x30(%rbp),%rax
3.12 │ mov %rax,%rcx
│ mov %rax,-0x60(%rbp)
│ shr $0x20,%rcx
Use #include <...> for Windows system headers
libutil: More efficient `readLittleEndian`
Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
Resolves #15317 Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
Release notes for 2.34.0
libexpr: Make Boehm allocation cache thread_local
Add missing directories to uninstall.md
This will allow extending it further in the next commit
… at all Unlike with absolute (complete) URLs, with relative URLs, this does make a difference -- explicit empty overrides, implicit empty does not.
…aram-check Error on invalid URL param in github fetcher
Git fetcher: Don't compute revCount/lastModified if they're already specified
Revert "fix(libstore/filetransfer): enable TCP keep-alive on curl han…
Restructure and improve Nix documentation for cross-platform accuracy
and better cross-referencing between related pages.
`env-common.md`:
- Reorganize into sections: Configuration, Store settings, Evaluator,
User Directories, Miscellaneous, and OS-specific Appendix
- Add Windows defaults (Known Folders) alongside Unix defaults for all
system directory environment variables
- Document `NIX_DAEMON_SOCKET_PATH` environment variable
- Add XDG Base Directories and Windows Known Folders appendix sections
with anchors for cross-referencing
- Use reference-style links to deduplicate store type URLs
- Shrink configuration env var entries to point to `conf-file-prefix.md`
- Fix some issues relating to directory defaults that go back to make ->
meson transition.
`conf-file-prefix.md`:
- Add Windows configuration directory and list separator info
- Fix config file search to reference user configuration directory and
`XDG_CONFIG_DIRS` separately (not the full User Directories section)
- Note that `NIX_CONFIG` settings are newline-separated
Store documentation:
- `uds-remote-store.md`: Document socket path resolution order
(`NIX_DAEMON_SOCKET_PATH`, then `$NIX_STATE_DIR/daemon-socket/socket`)
- `local-store.md`: Add `{#chroot}` anchor for local chroot store section
- `index.md.in`: Add `{#auto}` anchor for `auto` store URL; fix chroot link
- `store-api.cc`: Add `NIX_STORE_DIR` cross-reference to `store` setting
- `local-fs-store.hh`: Add cross-reference links to env vars in `state`,
`log`, and `real` store dir setting descriptions
- `globals.hh`: Add `NIX_REMOTE` and `auto` cross-references to `storeUri`
`daemon.md`:
- Add "Socket path" section documenting how the listening socket path
is determined
Other:
- `daemon.cc`: Reformat `force-untrusted` flag description as raw string
- `file-system.cc`: Use `getEnvOsNonEmpty` for `TMPDIR` (consistency)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pure refactor with no intended behavior change. The next commit will take advantage of this. `nixDaemonSocketFile` and `nixLogDir` are gone. Instead we have `getStateDir` and `getLogDir` functions on `Store::Config`, which are overridden by `LocalFSStore::Config`. This matches the same pattern that was done for `Store::Config::getReadOnly` --- the functions are introduced initially with global settings, and then overridden to take into account store-specific settings for the stores which have those settings. - Remove `getDefaultStateDir()` / `getDefaultLogDir()` indirections. Those implementation became `StoreConfig::get...Dir()` instead. - Remove `LogFileSettings::nixLogDir` global; move logic to `StoreConfig::getLogDir()`. All usages can go through the store! - Remove `Settings::nixDaemonSocketFile` global; introduce `getDaemonSocketPath()` free function (uses global state dir). It is used to default the socket path for the client (`UdsRemoteStore::Config`) and the server (`nix-daemon` / `nix daemon`). It could be a constant rather than nullary function inthis commit, but we make a function because we will give it an argument in the next commit. - Simplify `derivation-building-goal.cc` via `store.config.getLogDir()` - Add `ref::get()` method (like `shared_ptr::get()`) - Add tests for `getStateDir` on `DummyStoreConfig` and `LocalFSStoreConfig` Co-authored-by: Amaan Qureshi <git@amaanq.com> Co-authored-by: John Ericson <john.ericson@obsidian.systems> Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The behavior change is described in the release note. - `getDaemonSocketPath` now takes a store config argument. It does not need to be virtual because it does not vary except for with respect to the state dir, which we already have `getStateDir` for. It is used to default the socket path for the client (`UdsRemoteStore::Config`) and the server (`nix-daemon` / `nix daemon`). - Add `--socket-path` flag to `nix daemon`, which takes precedence over `NIX_DAEMON_SOCKET_PATH` and the default. It is mutually exclusive with `--stdio`. Fix #15189 Co-authored-by: John Ericson <john.ericson@obsidian.systems> Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
daemon: use per-store state directory for socket path
Mutating global state in tests is fragile since manual restore calls are easy to forget or skip on early returns; an RAII guard ensures cleanup always happens.
This is a more comprehensive fix than the one done in that this replaces ee5860f, because it affects all store types.
tests: RAII guard for experimental feature settings
We don't want to only have build traces for objects we have in the store, anymore.
…heck libstore: check ca-derivations xp in Store::queryRealisation
libstore: Fix max-connections = 0
`UnkeyedRealisation::sign()` and `checkSignatures()` had no test coverage. This adds characterisation tests for fingerprint output and behavioral tests for sign-then-verify, wrong-key rejection, tampered-outpath rejection, and signature stripping.
tests: add Realisation signing tests
doc: fix wording of paragraph discussing informal property
Reduces dependency on shell32.dll
windows: replace StrChrW with standard wcschr
This method returns the signature without inserting it into the set.
The signing tests now use a fixed key and golden-master files, so that they are parameterised over both realisations and produce deterministic output.
tests: add Realisation signing characterisation tests
Add tests for devShells and devShell flake outputs
Get rid of deep realisations entirely
libstore: Fix generation numbers being parsed as 32-bit
…wording doc: fix typo and clarify requisites description in store-object
When `userNamespacesSupported()` returns false, `sandboxGid()` should return `buildUser->getGID()` rather than the user-namespace GID (100). However, `/etc/group` was written during `prepareSandbox()`, before `usingUserNamespace` is determined in `startChild()`, so it always used the default `usingUserNamespace = true` value. This bug dates back at least to 11882d7 ("Create /etc/passwd *after* figuring out the sandbox uid/gid"), which moved the `/etc/passwd` write to after `usingUserNamespace` is set but left `/etc/group` behind. Fix this by removing the `/etc/group` write from `prepareSandbox()` and writing it in `startChild()` alongside `/etc/passwd`, where the sandbox GID is known. This is safe because FreeBSD already writes its own `/etc/group` in its derivation builder independently — now neither platform relies on the shared `prepareSandbox()` for this. Fixes #8502 Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
Fix build failures on systems with unprivileged_userns_clone=0
This change resolves several deficiencies with the current url normalization. Tests documenting these deficiencies have been corrected and new tests added to cover additional fetchGit test expectations. - Add early bailouts matching git's url_is_local_not_ssh(): no colon at all, or slash before colon. - Add `://` check matching git's parse_connect_url(). - Bracket detection for IPv6 follows git's host_end(): prefer `@[` over leading `[`, fall through to colon-based path when `]` is missing. - Refuse to silently discard characters between `]` and `:` (a git bug). - Warn on SCP-style relative paths that can't be faithfully represented as ssh:// URLs, showing exact alternatives. - Drop Windows drive letter special-casing (C:foo parses as SCP). - Known scheme check (ssh, http, etc.) to improve diagnostics. - Guard Unix-specific path tests (absolute, space, quote, pct-encoding) with #ifndef _WIN32, add Windows #else equivalents with drive letters. - Add test for colon-in-path SCP URL (notuser:notpass@host:path). Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo> Co-authored-by: John Ericson <john.ericson@obsidian.systems> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
libutil: relax git URL parsing to accept paths without a user component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )