1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00
Commit graph

19668 commits

Author SHA1 Message Date
Sergei Zimmerman
11919bc471 {libexpr,libcmd}: Make debugger significantly faster
The underlying issue is that debugger code path was
calling PosTable::operator[] in each eval method.
This has become incredibly expensive since 5d9fdab3de.

While we are it it, I've reworked the code to
not use std::shared_ptr where it really isn't necessary.

As I've documented in previous commits, this is actually
more a workaround for recursive header dependencies now
and is only necessary in `error.hh` code.

Some ad-hoc benchmarking:

After this commit:

```
Benchmark 1: nix eval nixpkgs#hello --impure --ignore-try --no-eval-cache --debugger
  Time (mean ± σ):     784.2 ms ±   7.1 ms    [User: 561.4 ms, System: 147.7 ms]
  Range (min … max):   773.5 ms … 792.6 ms    10 runs
```

On master 3604c7c51:

```
Benchmark 1: nix eval nixpkgs#hello --impure --ignore-try --no-eval-cache --debugger
  Time (mean ± σ):     22.914 s ±  0.178 s    [User: 18.524 s, System: 4.151 s]
  Range (min … max):   22.738 s … 23.290 s    10 runs
```

(cherry picked from commit adbd08399c)
2025-03-14 13:22:53 +00:00
Sergei Zimmerman
593e0eebeb libutil: Fix Pos::getSourcePath
Previous implementation didn't actually check if
std::get_if returned a nullptr:

std::optional<SourcePath> getSourcePath() const {
    return *std::get_if<SourcePath>(&origin);
}

(cherry picked from commit 50123f2a56)
2025-03-14 13:22:52 +00:00
Sergei Zimmerman
8c2a792d2b libutil: Document hacks and problems around Pos class
This should provide context for follow-up commits in
the patch series.

(cherry picked from commit bf12aedf2e)
2025-03-14 13:22:52 +00:00
Sergei Zimmerman
b540c2419f {libutil,libexpr}: Move pos-idx,pos-table code to libutil
All of this code doesn't actually depend on anything from
libexpr. Because Pos is so tigtly coupled with Error, it
makes sense to have in the same library.

(cherry picked from commit a53b184e63)
2025-03-14 13:22:52 +00:00
mergify[bot]
96f0fd3ce0
Merge pull request #12605 from NixOS/mergify/bp/2.27-maintenance/pr-12604
Fix chopped up repl output (backport #12604)
2025-03-04 19:33:00 +00:00
Robert Hensing
dc6a936d97 repl: Fix :print corruption
See preceding commits.

(cherry picked from commit 1e1c587073)
2025-03-04 19:10:02 +00:00
Robert Hensing
ac3fc8876c refactor: RAII logger suspension
(cherry picked from commit 30694b5d8a)
2025-03-04 19:10:01 +00:00
Robert Hensing
375df6c086 repl: Fix value printing corruption
The resume call would get some non-flushed(?) data.
Extending the pause to include the newline makes the complete flush
part of the pause.

(cherry picked from commit 880489051a)
2025-03-04 19:10:01 +00:00
Robert Hensing
88e6b7d6b2 progress-bar: Make pause/resume nestable
(cherry picked from commit 49d8ee5359)
2025-03-04 19:10:01 +00:00
mergify[bot]
181ffe30be
Merge pull request #12602 from NixOS/mergify/bp/2.27-maintenance/pr-12600
packaging: Typo in setVersionLayer / preConfigure (backport #12600)
2025-03-04 17:09:29 +00:00
Robert Hensing
afad1e536e packaging: Typo in setVersionLayer / preConfigure
Apparently dead code in our use case, but good to keep nonetheless.
Credit: ztzg in https://github.com/NixOS/nix/pull/12498#pullrequestreview-2658031853

(cherry picked from commit dcaea8cb1c)
2025-03-04 16:46:18 +00:00
John Ericson
fffb54d8f7
Merge pull request #12594 from NixOS/mergify/bp/2.27-maintenance/pr-12442
Expand manual on derivation outputs (backport #12442)
2025-03-03 17:28:32 -05:00
Robert Hensing
8b9d401fe4 manual: Edit
(cherry picked from commit 1e00d14c29)
2025-03-03 22:13:09 +00:00
John Ericson
f278a631b0 Expand manual on derivation outputs
Note, this includes some text adapted from from Eelco's dissertation

(cherry picked from commit 2aa6e0f084)
2025-03-03 22:13:08 +00:00
mergify[bot]
7e61e9650c
Merge pull request #12590 from NixOS/mergify/bp/2.27-maintenance/pr-12582
packaging/everything.nix: Use a multi-output derivation (backport #12582)
2025-03-02 13:16:07 +00:00
Robert Hensing
7e7e9d9eab packaging/everything.nix: Use a multi-output derivation
This should fix a few packaging regressions.

`dev` also includes a merged `includes/`, which may be helpful until
inter-component includes are fixed properly.

(cherry picked from commit 41085295ab)
2025-03-02 13:09:49 +00:00
Robert Hensing
863c1b60d2
Merge pull request #12576 from obsidiansystems/2.27-no-dyn-drv
[2.27] Once again revert "Adapt scheduler to work with dynamic derivations"
2025-02-27 20:56:16 +01:00
John Ericson
f636ced7d2 Revert "Revert "Revert "Adapt scheduler to work with dynamic derivations"""
The bug reappeared after all, and the fix introduced a different bug. We
want to release 2.27 imminently so there is no time to do a proper fix,
which appears to require a larger reworking. Hopefully we will have it
for 2.28, however.

This reverts commit c98525235f.
2025-02-27 13:42:57 -05:00
Eelco Dolstra
494953cfb6 Mark official release 2025-02-27 17:03:27 +01:00
Eelco Dolstra
1293388039
Merge pull request #12544 from xokdvium/debugger-use-after-free
libexpr: Fix use-after-free of StaticEnv::up
2025-02-27 16:55:49 +01:00
Eelco Dolstra
b628adc8c8
Merge pull request #12574 from NixOS/release-notes
2.27 release notes
2025-02-27 16:21:46 +01:00
Eelco Dolstra
ed294a31f5 Add more release notes 2025-02-26 22:23:44 +01:00
Eelco Dolstra
1d89507656 Fix date 2025-02-26 22:05:50 +01:00
Eelco Dolstra
c5a64aefac Add contributors 2025-02-26 22:01:24 +01:00
Eelco Dolstra
4a7bdddc8b Edit release notes 2025-02-26 21:59:41 +01:00
Eelco Dolstra
80020b684f release notes: 2.27.0 2025-02-26 21:57:30 +01:00
Eelco Dolstra
31923aaac0
Merge pull request #12572 from DeterminateSystems/fix-mingw-build
Fix mingw build
2025-02-26 21:32:58 +01:00
Eelco Dolstra
ec8f78b0be Fix mingw build
https://hydra.nixos.org/build/291153007
2025-02-26 19:54:47 +01:00
Eelco Dolstra
81834e7f00
Merge pull request #12566 from NaN-git/fix-curl-callback
libstore: fix curl callback function signature
2025-02-25 20:15:06 +01:00
Eelco Dolstra
671d1b0123
Merge pull request #12501 from DeterminateSystems/stop-progress-bar
Remove {start,stop}ProgressBar()
2025-02-25 20:07:29 +01:00
Philipp Otterbein
b074345d35 libstore: fix curl callback function signature 2025-02-25 19:42:59 +01:00
Robert Hensing
ff2798bf17
Merge pull request #12465 from tomberek/tomberek.access-token-prefixing
Fine-grained access-tokens
2025-02-25 16:04:20 +01:00
Robert Hensing
1222438ae7 Merge remote-tracking branch 'upstream/master' into tomberek.access-token-prefixing 2025-02-25 15:40:34 +01:00
Robert Hensing
c07172220c refact: Rename url -> hostAndPath
https://github.com/NixOS/nix/pull/12465/files#r1955286197

> Perhaps that is a misnomer.
2025-02-25 15:21:09 +01:00
Eelco Dolstra
8384e41b76
Merge pull request #12559 from DeterminateSystems/archive-relative-paths
nix flake archive: Recurse into relative path inputs
2025-02-24 22:30:16 +01:00
Eelco Dolstra
14c9755462 nix flake archive: Recurse into relative path inputs
We can't ignore them entirely, since we do want to archive their
transitive inputs.

Fixes #12438.
2025-02-24 22:10:02 +01:00
John Ericson
c8a443df50
Merge pull request #12546 from DeterminateSystems/version-in-manual
Include the Nix version in the title of the manual
2025-02-24 13:11:30 -05:00
Robert Hensing
1f98abee84
Merge pull request #12557 from roberth/packaging-x86_64-darwin-stdenv
packaging: Use correct stdenv for x86_64-darwin
2025-02-24 17:04:48 +01:00
Robert Hensing
0772c2e3ab packaging: Use correct stdenv for x86_64-darwin 2025-02-24 16:44:12 +01:00
Jörg Thalheim
d433a2242e
Merge pull request #12553 from DeterminateSystems/archive-relative-paths
nix flake archive: Skip relative path inputs
2025-02-24 15:48:16 +01:00
Eelco Dolstra
b4dfeafed5 nix flake archive: Skip relative path inputs
Fixes #12438.
2025-02-24 15:30:30 +01:00
Eelco Dolstra
f3ea14c8dc
Merge pull request #12542 from tomberek/tomberek.ssl-default
doc: ssl-cert-file leaks into OSX builds
2025-02-24 14:51:34 +01:00
Eelco Dolstra
779bb3b920 Include the Nix version in the title of the manual
This makes it easy to see at a glance what the version of the manual
is, e.g. "Nix 2.27.0 Reference Manual".
2025-02-24 14:49:58 +01:00
Eelco Dolstra
d904921eec
Merge pull request #12510 from tie/fix-progress-parallel
libstore: fix expected bytes in progress bar
2025-02-21 20:11:18 +01:00
Eelco Dolstra
223f82efab
Merge pull request #12543 from B4dM4n/fix-perl-store-bindings
Fix perl store bindings
2025-02-21 15:46:46 +01:00
Sergei Zimmerman
0d5004508f tests/functional: Add flake-based regression for debugger use-after-free
This is the simplest reproducer I have. It would be great to find
a repro without flakes, but I guess this should be ok for now.
2025-02-21 14:36:39 +00:00
Sergei Zimmerman
af2ddfdb3b libexpr: Fix use-after-free of StaticEnv::up
It's not very clear what the ownership model is here, but one thing
is certain: `.up` can't be destroyed before the StaticEnv that refers
to it is.

Changing a non-owning pointer to taking shared ownership of the parent
`StaticEnv` prevents the `.up` from being freed.

I'm not a huge fan of the inverted ownership, where child `StaticEnv`
takes a refcount of the parent, but this seems like the least intrusive
way to fix the use-after-free.

This shouldn't cause any shared_ptr cycles to appear (hopefully).
2025-02-21 14:36:39 +00:00
Fabian Möller
5cf9e18167
Fix perl store bindings
When #9863 converted the `Nix::Store` free functions into member functions, the
implicit `this` argument was not accounted for when iterating over the variable
number of arguments in some functions.
2025-02-21 11:49:00 +01:00
Thomas Bereknyei
bbf6ff29e6 doc: ssl-cert-file leaks into OSX builds 2025-02-20 17:57:10 -05:00
John Ericson
61f49de7ae
Merge pull request #12511 from xokdvium/chore/delete-dead-code
libfetchers-tests: Add back git-utils.cc
2025-02-20 15:56:38 -05:00