1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 12:36:01 +01:00
Commit graph

21181 commits

Author SHA1 Message Date
Sergei Zimmerman
2b2c832f0a
ci: Disable dogfooding
To unbreak the CI.
2025-08-11 20:30:03 +03:00
Jörg Thalheim
83c43d9311
Merge pull request #13731 from Mic92/fix-ci
Revert "Merge pull request #13709 from NixOS/boehm-coroutines-sp"
2025-08-11 19:23:21 +02:00
Jörg Thalheim
46b6907346 Revert "Merge pull request #13709 from NixOS/boehm-coroutines-sp"
This reverts commit 4b3ca9bd80, reversing
changes made to 867b69f533.

Since this commit we get reproducible segfaults building Nix ci in macos github runners:
https://github.com/NixOS/nix/actions/runs/16885882321/job/47837390248
2025-08-11 19:18:04 +02:00
Jörg Thalheim
b2fb421386
Merge pull request #13490 from Mic92/clang-tidy-simple-warnings
Fix simple clang-tidy warnings
2025-08-11 18:21:46 +02:00
Jörg Thalheim
4b3ca9bd80
Merge pull request #13709 from NixOS/boehm-coroutines-sp
Restore fixupBoehmStackPointer
2025-08-11 16:17:14 +02:00
Jörg Thalheim
0675094861 Silence false positive clang-analyzer warning in repl.cc
The clang-analyzer incorrectly flags a use-after-free for GC-managed objects
when used with std::unique_ptr. Since NixRepl inherits from gc, its memory
is properly managed by Boehm GC and this is a false positive.

Added NOLINTNEXTLINE directive to suppress the warning.
2025-08-11 09:27:18 +02:00
Jörg Thalheim
867b69f533
Merge pull request #13729 from xokdvium/issue-13325
libfetchers: Remove badGitRefRegex and use libgit2 for reference validation
2025-08-11 09:15:35 +02:00
Sergei Zimmerman
e8e9376a7b
libfetchers: Remove badGitRefRegex and use libgit2 for reference validation
Fixes usage of `#` symbol in the reference name.
This also seems to identify several deficiencies in the libgit2 refname
validation code wrt to DEL symbol and a singular `@` symbol [1].

[1]: https://git-scm.com/docs/git-check-ref-format#_description
2025-08-11 02:38:45 +03:00
Jörg Thalheim
b5f843a565
Merge pull request #13726 from a-kenji/ke-document-self-attrs
docs: add self-attrs documentation
2025-08-10 17:18:35 +02:00
a-kenji
937780ea08 docs: Add self-attribute documentation 2025-08-10 15:05:32 +02:00
Sergei Zimmerman
0b7f7e4b03
Merge pull request #13722 from xokdvium/faster-ci 2025-08-09 10:42:42 +03:00
Sergei Zimmerman
6ec88b93ba
ci: Remove max-jobs = 1
This change was necessary when we were using `nix flake check` for CI
(see 6db6b269ed). Now this is not really
necessary, because we are running the checks in a much saner way, that
doesn't use up too much memory for evaluation.
2025-08-09 01:13:59 +03:00
Sergei Zimmerman
5451ad4a4c
Merge pull request #13683 from fzakaria/fzakaria/meson-improvement
Make functional tests depend on nix binary so they auto recompile
2025-08-09 00:14:08 +03:00
John Ericson
bd9ce27df0
Merge pull request #13713 from Mic92/freebsd-installer
add freebsd multi-user installer
2025-08-08 11:53:02 -04:00
John Ericson
8e35f3ca1e
Merge pull request #13717 from Mic92/rc.d-script
add rc.d script for the nix-daemon
2025-08-08 11:49:59 -04:00
AGawas
d2022189a1
Inline printHash16or32 and remove redundant helper (#13716)
Fixes ##13692

---------

Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2025-08-08 11:47:47 -04:00
Jörg Thalheim
d4c6f24e9f
Merge pull request #13718 from xokdvium/coverage-hydra-job-restore
hydra: Restore coverage job
2025-08-08 11:39:29 +02:00
Sergei Zimmerman
51c0e6bc63
hydra: Restore coverage job
Sometime ago we lost the coverage job in the midst of
meson migration. Until we have something like codecov
it'd be very useful to restore this job with the html
reports and historical metrics.

As a bonus we get more coverage metrics by switching to
LLVM tooling from LCOV.
2025-08-08 12:05:06 +03:00
Sergei Zimmerman
cac8ec3b05
Merge pull request #13714 from xokdvium/move-ref-scan-sink
libutil: Move references.{hh,cc} to libstore, remove unused scanForReferences
2025-08-08 11:09:39 +03:00
Sergei Zimmerman
2e3ebfb829
libutil: Move references.{hh,cc} to libstore
The implicit dependency on refLength (which is the StorePath::HashLen)
is not good. Also the companion tests and benchmarks are already in libstore-tests.
2025-08-08 10:30:09 +03:00
Sergei Zimmerman
1b4aa5c1ef
libstore: Remove unused overload of scanForReferences
This doesn't seem to be used anywhere at the moment.
It might be used out-of-tree, but this is a small convenience
function that is not worth keeping without in-tree usage.
2025-08-08 10:30:07 +03:00
Jörg Thalheim
e74cfc52fe docs/uninstall: add instructions for freebsd 2025-08-08 09:10:35 +02:00
Jörg Thalheim
11d03893f8 add freebsd multi-user installer 2025-08-08 09:10:35 +02:00
Jörg Thalheim
73d09e67a7 add rc.d script for the nix-daemon 2025-08-08 09:09:58 +02:00
Farid Zakaria
bf320465ae
Make functional tests depend on nix binary so they auto recompile
With this I'm able to do a fresh config + meson test with all dependencies
correctly propagated.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2025-08-08 03:18:38 +03:00
John Ericson
90aa2b83b5
Merge pull request #13715 from xokdvium/hash-result-struct
libutil: Make HashResult a proper struct
2025-08-07 20:13:39 -04:00
Sergei Zimmerman
143bd60136
libutil: Make HashResult a proper struct
This resolves an existing TODO and makes the
code slightly more readable.
2025-08-08 02:06:14 +03:00
John Ericson
241420a788
Merge pull request #13704 from obsidiansystems/slight-hash-cleanup
Slight clean up the constructors for `Hash`
2025-08-07 18:10:11 -04:00
John Ericson
628d423a12
Merge pull request #13712 from Mic92/freebsd-installer-basic
single-user-install: fix cp for freebsd
2025-08-07 18:04:02 -04:00
Jörg Thalheim
ddd3034909 single-user-install: fix cp flags on freebsd 2025-08-07 23:51:37 +02:00
Jörg Thalheim
1cce358c40 single-user-install: just call uname once 2025-08-07 23:51:37 +02:00
Jörg Thalheim
49b385af00
Merge pull request #13711 from Mic92/chroot-builder
Factor out `ChrootDerivationBuilder`
2025-08-07 22:40:24 +02:00
John Ericson
d4ef822add Factor out ChrootDerivationBuilder
This will allow us to have non-Linux chroot-using sandboxed builds.
2025-08-07 13:47:16 -04:00
Sergei Zimmerman
6b6a1e14ce
Merge pull request #13708 from NixOS/parallel-mark-2
Enable parallel marking in boehm-gc
2025-08-07 13:56:06 +03:00
Eelco Dolstra
3ba103865d Restore fixupBoehmStackPointer
This was removed in https://github.com/NixOS/nix/pull/11152. However,
we need it for the multi-threaded evaluator, because otherwise Boehm
GC will crash while scanning the thread stack:

  #0  GC_push_all_eager (bottom=<optimized out>, top=<optimized out>) at extra/../mark.c:1488
  #1  0x00007ffff74691d5 in GC_push_all_stack_sections (lo=<optimized out>, hi=<optimized out>, traced_stack_sect=0x0) at extra/../mark_rts.c:704
  #2  GC_push_all_stacks () at extra/../pthread_stop_world.c:876
  #3  GC_default_push_other_roots () at extra/../os_dep.c:2893
  #4  0x00007ffff746235c in GC_mark_some (cold_gc_frame=0x7ffee8ecaa50 "`\304G\367\377\177") at extra/../mark.c:374
  #5  0x00007ffff7465a8d in GC_stopped_mark (stop_func=stop_func@entry=0x7ffff7453c80 <GC_never_stop_func>) at extra/../alloc.c:875
  #6  0x00007ffff7466724 in GC_try_to_collect_inner (stop_func=0x7ffff7453c80 <GC_never_stop_func>) at extra/../alloc.c:624
  #7  0x00007ffff7466a22 in GC_collect_or_expand (needed_blocks=needed_blocks@entry=1, ignore_off_page=ignore_off_page@entry=0, retry=retry@entry=0) at extra/../alloc.c:1688
  #8  0x00007ffff746878f in GC_allocobj (gran=<optimized out>, kind=<optimized out>) at extra/../alloc.c:1798
  #9  GC_generic_malloc_inner (lb=<optimized out>, k=k@entry=1) at extra/../malloc.c:193
  #10 0x00007ffff746cd40 in GC_generic_malloc_many (lb=<optimized out>, k=<optimized out>, result=<optimized out>) at extra/../mallocx.c:477
  #11 0x00007ffff746cf35 in GC_malloc_kind (bytes=120, kind=1) at extra/../thread_local_alloc.c:187
  #12 0x00007ffff796ede5 in nix::allocBytes (n=<optimized out>, n=<optimized out>) at ../src/libexpr/include/nix/expr/eval-inline.hh:19

This is because it will use the stack pointer of the coroutine, so it
will scan a region of memory that doesn't exist, e.g.

  Stack for thread 0x7ffea4ff96c0 is [0x7ffe80197af0w,0x7ffea4ffa000)

(where 0x7ffe80197af0w is the sp of the coroutine and 0x7ffea4ffa000
is the base of the thread stack).

We don't scan coroutine stacks, because currently they don't have GC
roots (there is no evaluation happening in coroutines). So there is
currently no need to restore the other parts of the original patch,
such as BoehmGCStackAllocator.
2025-08-07 12:09:34 +02:00
Eelco Dolstra
0d559f0c13 Increase the initial Boehm GC mark stack size
If the mark stack size is too small, it greatly inhibits parallel
marking, which is very bad for performance on multi-core systems.
2025-08-07 11:45:06 +02:00
Eelco Dolstra
4c1c4f79a3 Move setting GC_THREADS into eval-gc.hh 2025-08-07 11:44:20 +02:00
Eelco Dolstra
a3ff648f90 Call GC_allow_register_threads() to enable parallel marking in Boehm GC 2025-08-07 11:44:07 +02:00
John Ericson
c4c3203b7b
Merge pull request #13706 from xokdvium/meson-format
meson: Apply formatting universally
2025-08-06 20:50:44 -04:00
Sergei Zimmerman
041a733139
Merge pull request #13705 from obsidiansystems/consolidate-path-functions
Move some `MixStoreDirMethods` members to the right `.cc` file
2025-08-07 03:39:02 +03:00
John Ericson
e07440665c Move some MixStoreDirMethods members to the right .cc file
I had not wanted to cause unncessary churn before, but now that we've
bitten the bullet with the Big Reformat, I feel it is the right time.

Future readers will appreciate that the declarations and definitions
files are one-to-one as they should be, and `store-api.cc` is good to
shrink in any event.

I don't think there are outstanding PRs changing this code either. (I
had some for a while, but they are all merged.)
2025-08-06 20:13:15 -04:00
John Ericson
9d8d8df729 Slight clean up the constructors for Hash
- No more private constructor that is kinda weird

- Two new static functions, `baseFromSize` and `baseFromSize`, that do
  one thing, and one thing only (simple).

- Two `Hash::parse*` that previously used the private constructor now
  can use these two functions directly.

- The remaining `Hash::parseAny*` methods, which are inherently more
  complex, are written in terms of a `parseAnyHelper` static function
  which is also complex, but keeps the complexity in one spot.
2025-08-06 20:04:59 -04:00
Sergei Zimmerman
cf10085940
git-blame-ignore-revs: Add the meson reformatting commit 2025-08-07 03:01:40 +03:00
Sergei Zimmerman
385e2c3542
meson: Apply formatting universally
Now that we have applied the [1] patch, the diff is much
nicer and less noisy.

[1]: https://www.github.com/mesonbuild/meson/pull/14861
2025-08-07 02:58:29 +03:00
Sergei Zimmerman
bf80696ed9
meson: Get rid of multiline array formatting hack 2025-08-07 02:57:02 +03:00
Sergei Zimmerman
da028aa454
maintainers: Fetch patch for multiline formatting in meson 2025-08-07 02:56:59 +03:00
John Ericson
9ff4c446df
Merge pull request #3425 from mkg20001/pr
Add user@address:port support
2025-08-06 17:16:58 -04:00
Maciej Krüger
49ba06175e
Add user@address:port support
This patch allows users to specify the connection port
in the store URLS like so:

```
nix store info --store "ssh-ng://localhost:22" --json
```

Previously this failed with: `error: failed to start SSH connection to 'localhost:22'`,
because the code did not distinguish the port from the hostname. This
patch remedies that problem by introducing a ParsedURL::Authority type
for working with parsed authority components of URIs.

Now that the URL parsing code is less ad-hoc we can
add more long-awaited fixes for specifying SSH connection
ports in store URIs.

Builds upon the work from bd1d2d1041.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2025-08-06 23:48:14 +03:00
tomberek
55f6ff36c2
Merge pull request #13526 from philiptaron/issue-12786/canonicaliseTimestampAndPermissions-on-dir-better
libstore: always canonicalize directory permissions
2025-08-06 16:30:13 -04:00
Jörg Thalheim
1376e27156
Merge pull request #13702 from h0nIg/revert-13351-push-rrzylpqynznw
Revert "docker: make sure `nix config check` works"
2025-08-06 20:49:11 +02:00