Skip to content

Commit a66d268

Browse files
committed
Merge remote-tracking branch 'detsys/detsys-main' into multithreaded-eval-v2
2 parents 0e4ed54 + 842b884 commit a66d268

File tree

18 files changed

+262
-58
lines changed

18 files changed

+262
-58
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.29.0
1+
2.29.1

.version-determinate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.6
1+
3.6.8

doc/manual/source/SUMMARY.md.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
- [Contributing](development/contributing.md)
130130
- [Determinate Nix Release Notes](release-notes-determinate/index.md)
131131
- [Changes between Nix and Determinate Nix](release-notes-determinate/changes.md)<!-- next -->
132+
- [Release 3.6.8 (2025-06-25)](release-notes-determinate/rl-3.6.8.md)
133+
- [Release 3.6.7 (2025-06-24)](release-notes-determinate/rl-3.6.7.md)
132134
- [Release 3.6.6 (2025-06-17)](release-notes-determinate/rl-3.6.6.md)
133135
- [Release 3.6.5 (2025-06-16)](release-notes-determinate/rl-3.6.5.md)
134136
- [Release 3.6.2 (2025-06-02)](release-notes-determinate/rl-3.6.2.md)

doc/manual/source/release-notes-determinate/changes.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changes between Nix and Determinate Nix
22

3-
This section lists the differences between upstream Nix 2.29 and Determinate Nix 3.6.6.<!-- differences -->
3+
This section lists the differences between upstream Nix 2.29 and Determinate Nix 3.6.8.<!-- differences -->
44

55
* In Determinate Nix, flakes are stable. You no longer need to enable the `flakes` experimental feature.
66

@@ -74,3 +74,15 @@ This section lists the differences between upstream Nix 2.29 and Determinate Nix
7474
* Improve caching of inputs in dry-run mode by @edolstra in [DeterminateSystems/nix-src#98](https://github.com/DeterminateSystems/nix-src/pull/98)
7575

7676
<!-- Determinate Nix version 3.6.6 -->
77+
78+
<!-- Determinate Nix version 3.6.7 -->
79+
80+
<!-- Determinate Nix version 3.6.8 -->
81+
82+
* Fix fetchToStore() caching with --impure, improve testing by @edolstra in [DeterminateSystems/nix-src#117](https://github.com/DeterminateSystems/nix-src/pull/117)
83+
84+
* Add lazy-locks setting by @edolstra in [DeterminateSystems/nix-src#113](https://github.com/DeterminateSystems/nix-src/pull/113)
85+
86+
* Sync 2.29.1 by @edolstra in [DeterminateSystems/nix-src#124](https://github.com/DeterminateSystems/nix-src/pull/124)
87+
88+
* Release v3.6.7 by @github-actions in [DeterminateSystems/nix-src#126](https://github.com/DeterminateSystems/nix-src/pull/126)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Release 3.6.7 (2025-06-24)
2+
3+
* Based on [upstream Nix 2.29.1](../release-notes/rl-2.29.md).
4+
5+
## What's Changed
6+
7+
### Security contents
8+
9+
* Patched against GHSA-g948-229j-48j3
10+
11+
### Lazy trees:
12+
13+
* Lazy trees now produces `flake.lock` files with NAR hashes unless `lazy-locks` is set to `true` by @edolstra in [DeterminateSystems/nix-src#113](https://github.com/DeterminateSystems/nix-src/pull/113)
14+
* Improved caching with lazy-trees when using --impure, with enhanced testing by @edolstra in [DeterminateSystems/nix-src#117](https://github.com/DeterminateSystems/nix-src/pull/117)
15+
16+
17+
**Full Changelog**: [v3.6.6...v3.6.7](https://github.com/DeterminateSystems/nix-src/compare/v3.6.6...v3.6.7)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Release 3.6.8 (2025-06-25)
2+
3+
* Based on [upstream Nix 2.29.1](../release-notes/rl-2.29.md).
4+
5+
## What's Changed
6+
* Fix fetchToStore() caching with --impure, improve testing by @edolstra in [DeterminateSystems/nix-src#117](https://github.com/DeterminateSystems/nix-src/pull/117)
7+
* Add lazy-locks setting by @edolstra in [DeterminateSystems/nix-src#113](https://github.com/DeterminateSystems/nix-src/pull/113)
8+
* Sync 2.29.1 by @edolstra in [DeterminateSystems/nix-src#124](https://github.com/DeterminateSystems/nix-src/pull/124)
9+
* Release v3.6.7 by @github-actions in [DeterminateSystems/nix-src#126](https://github.com/DeterminateSystems/nix-src/pull/126)
10+
11+
12+
**Full Changelog**: [v3.6.6...v3.6.8](https://github.com/DeterminateSystems/nix-src/compare/v3.6.6...v3.6.8)

src/libfetchers/fetchers.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ std::pair<ref<SourceAccessor>, Input> Input::getAccessorUnchecked(ref<Store> sto
354354

355355
if (!accessor->fingerprint)
356356
accessor->fingerprint = result.getFingerprint(store);
357+
else
358+
result.cachedFingerprint = accessor->fingerprint;
357359

358360
return {accessor, std::move(result)};
359361
}

src/libfetchers/path.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ struct PathInputScheme : InputScheme
127127

128128
auto absPath = getAbsPath(input);
129129

130-
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
131-
132130
// FIXME: check whether access to 'path' is allowed.
133131
auto storePath = store->maybeParseStorePath(absPath.string());
134132

@@ -137,6 +135,7 @@ struct PathInputScheme : InputScheme
137135

138136
time_t mtime = 0;
139137
if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) {
138+
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
140139
// FIXME: try to substitute storePath.
141140
auto src = sinkToSource([&](Sink & sink) {
142141
mtime = dumpPathAndGetMtime(absPath.string(), sink, defaultPathFilter);

src/libflake/flake.cc

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ static void parseFlakeInputAttr(
8585

8686
static FlakeInput parseFlakeInput(
8787
EvalState & state,
88-
std::string_view inputName,
8988
Value * value,
9089
const PosIdx pos,
9190
const InputAttrPath & lockRootAttrPath,
@@ -155,8 +154,8 @@ static FlakeInput parseFlakeInput(
155154
input.ref = parseFlakeRef(state.fetchSettings, *url, {}, true, input.isFlake, true);
156155
}
157156

158-
if (!input.follows && !input.ref)
159-
input.ref = FlakeRef::fromAttrs(state.fetchSettings, {{"type", "indirect"}, {"id", std::string(inputName)}});
157+
if (input.ref && input.follows)
158+
throw Error("flake input has both a flake reference and a follows attribute, at %s", state.positions[pos]);
160159

161160
return input;
162161
}
@@ -185,7 +184,6 @@ static std::pair<std::map<FlakeId, FlakeInput>, fetchers::Attrs> parseFlakeInput
185184
} else {
186185
inputs.emplace(inputName,
187186
parseFlakeInput(state,
188-
inputName,
189187
inputAttr.value,
190188
inputAttr.pos,
191189
lockRootAttrPath,
@@ -467,18 +465,27 @@ LockedFlake lockFlake(
467465

468466
/* Get the overrides (i.e. attributes of the form
469467
'inputs.nixops.inputs.nixpkgs.url = ...'). */
470-
for (auto & [id, input] : flakeInputs) {
468+
std::function<void(const FlakeInput & input, const InputAttrPath & prefix)> addOverrides;
469+
addOverrides = [&](const FlakeInput & input, const InputAttrPath & prefix)
470+
{
471471
for (auto & [idOverride, inputOverride] : input.overrides) {
472-
auto inputAttrPath(inputAttrPathPrefix);
473-
inputAttrPath.push_back(id);
472+
auto inputAttrPath(prefix);
474473
inputAttrPath.push_back(idOverride);
475-
overrides.emplace(inputAttrPath,
476-
OverrideTarget {
477-
.input = inputOverride,
478-
.sourcePath = sourcePath,
479-
.parentInputAttrPath = inputAttrPathPrefix
480-
});
474+
if (inputOverride.ref || inputOverride.follows)
475+
overrides.emplace(inputAttrPath,
476+
OverrideTarget {
477+
.input = inputOverride,
478+
.sourcePath = sourcePath,
479+
.parentInputAttrPath = inputAttrPathPrefix
480+
});
481+
addOverrides(inputOverride, inputAttrPath);
481482
}
483+
};
484+
485+
for (auto & [id, input] : flakeInputs) {
486+
auto inputAttrPath(inputAttrPathPrefix);
487+
inputAttrPath.push_back(id);
488+
addOverrides(input, inputAttrPath);
482489
}
483490

484491
/* Check whether this input has overrides for a
@@ -534,7 +541,8 @@ LockedFlake lockFlake(
534541
continue;
535542
}
536543

537-
assert(input.ref);
544+
if (!input.ref)
545+
input.ref = FlakeRef::fromAttrs(state.fetchSettings, {{"type", "indirect"}, {"id", std::string(id)}});
538546

539547
auto overridenParentPath =
540548
input.ref->input.isRelative()
@@ -554,7 +562,7 @@ LockedFlake lockFlake(
554562

555563
/* Get the input flake, resolve 'path:./...'
556564
flakerefs relative to the parent flake. */
557-
auto getInputFlake = [&](const FlakeRef & ref)
565+
auto getInputFlake = [&](const FlakeRef & ref, const fetchers::UseRegistries useRegistries)
558566
{
559567
if (auto resolvedPath = resolveRelativePath()) {
560568
return readFlake(state, ref, ref, ref, *resolvedPath, inputAttrPath);
@@ -645,7 +653,7 @@ LockedFlake lockFlake(
645653
}
646654

647655
if (mustRefetch) {
648-
auto inputFlake = getInputFlake(oldLock->lockedRef);
656+
auto inputFlake = getInputFlake(oldLock->lockedRef, useRegistriesInputs);
649657
nodePaths.emplace(childNode, inputFlake.path.parent());
650658
computeLocks(inputFlake.inputs, childNode, inputAttrPath, oldLock, followsPrefix,
651659
inputFlake.path, false);
@@ -670,7 +678,8 @@ LockedFlake lockFlake(
670678
nuked the next time we update the lock
671679
file. That is, overrides are sticky unless you
672680
use --no-write-lock-file. */
673-
auto ref = (input2.ref && explicitCliOverrides.contains(inputAttrPath)) ? *input2.ref : *input.ref;
681+
auto inputIsOverride = explicitCliOverrides.contains(inputAttrPath);
682+
auto ref = (input2.ref && inputIsOverride) ? *input2.ref : *input.ref;
674683

675684
/* Warn against the use of indirect flakerefs
676685
(but only at top-level since we don't want
@@ -696,7 +705,7 @@ LockedFlake lockFlake(
696705
};
697706

698707
if (input.isFlake) {
699-
auto inputFlake = getInputFlake(*input.ref);
708+
auto inputFlake = getInputFlake(*input.ref, inputIsOverride ? fetchers::UseRegistries::All : useRegistriesInputs);
700709

701710
auto childNode = make_ref<LockedNode>(
702711
inputFlake.lockedRef,

src/libstore/local-store.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ LocalStore::LocalStore(ref<const Config> config)
247247
else if (curSchema == 0) { /* new store */
248248
curSchema = nixSchemaVersion;
249249
openDB(*state, true);
250-
writeFile(schemaPath, fmt("%1%", curSchema), 0666, true);
250+
writeFile(schemaPath, fmt("%1%", curSchema), 0666, FsSync::Yes);
251251
}
252252

253253
else if (curSchema < nixSchemaVersion) {
@@ -298,7 +298,7 @@ LocalStore::LocalStore(ref<const Config> config)
298298
txn.commit();
299299
}
300300

301-
writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, true);
301+
writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, FsSync::Yes);
302302

303303
lockFile(globalLock.get(), ltRead, true);
304304
}

0 commit comments

Comments
 (0)