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

19681 commits

Author SHA1 Message Date
Robert Hensing
60bffbd41b nix-fetchers-c: Init with settings object
Also make it a dependency of nix-flake-c; we'll need that.
2025-04-02 18:29:42 +02:00
Robert Hensing
1061a0965a nix-flake-c: Add missing bits 2025-04-02 18:02:32 +02:00
Robert Hensing
05e5bd2140 Docs 2025-04-02 18:02:32 +02:00
Robert Hensing
02360dd65c nix-expr: Expose nix_api_expr_internal.h intentionally
This is required for other bindings like nix-flake-c to hook into
nix-expr-c appropriately.
The `_internal` part should be a sufficient deterrent normally,
and it may also be useful for bindings that migrate from the C++
interface.
2025-04-02 18:02:32 +02:00
Robert Hensing
60b4b220d8 test: Fixup test name 2025-04-02 18:02:32 +02:00
Robert Hensing
0dc9b6b7c7 libutil-tests-support: Add file/line to ctx errors 2025-04-02 18:02:32 +02:00
mergify[bot]
70dcd738ef
Merge pull request #12870 from DeterminateSystems/improve-git-error
Git fetcher: Improve error message for untracked files
2025-04-02 15:39:35 +00:00
Jörg Thalheim
7a6570a11c
Merge pull request #12836 from NixOS/component-in-header-path
Expose the nix component in header include paths
2025-04-02 15:29:22 +02:00
Eelco Dolstra
f15681df26 Make Git error messages more consistent 2025-04-02 12:58:53 +02:00
Eelco Dolstra
277c29a64b Tweak error message 2025-04-02 12:58:11 +02:00
Graham Christensen
62e2304891 Improve and fix the error message when a file is not tracked by Git 2025-04-02 12:58:06 +02:00
Robert Hensing
cf409fd250
Merge pull request #12868 from NixOS/bump-2.29.0
Bump version
2025-04-02 00:23:30 +02:00
John Ericson
fc1de4a610 Bump version 2025-04-01 14:26:00 -04:00
mergify[bot]
9ed5482545
Merge pull request #12810 from roberth/packaging-sync
Packaging improvements from Nixpkgs
2025-04-01 17:49:35 +00:00
Robert Hensing
27d71b21fc packaging: finalAttrs.doCheck -> finalAttrs.finalPackage.doCheck
This includes the logic that disables checks on cross appropriately.

Co-authored-by: Peder Bergebakken Sundt <pbsds@hotmail.com>
2025-04-01 18:51:09 +02:00
Robert Hensing
1172e49a3a packaging: Various improvements
Co-authored-by: Mic92 <Mic92@users.noreply.github.com>
2025-04-01 18:51:09 +02:00
Jörg Thalheim
c57e2486df
Merge pull request #12853 from roberth/flake-nixos-unstable
flake: nixpkgs: 24.11 -> nixos-unstable
2025-04-01 18:49:10 +02:00
John Ericson
cc24766fa6 Expose the nix component in header include paths
For example, instead of doing

    #include "nix/store-config.hh"
    #include "nix/derived-path.hh"

Now do

    #include "nix/store/config.hh"
    #include "nix/store/derived-path.hh"

This was originally planned in the issue, and also recent requested by
Eelco.

Most of the change is purely mechanical. There is just one small
additional issue. See how, in the example above, we took this
opportunity to also turn `<comp>-config.hh` into `<comp>/config.hh`.
Well, there was already a `nix/util/config.{cc,hh}`. Even though there
is not a public configuration header for libutil (which also would be
called `nix/util/config.{cc,hh}`) that's still confusing, To avoid any
such confusion, we renamed that to `nix/util/configuration.{cc,hh}`.

Finally, note that the libflake headers already did this, so we didn't
need to do anything to them. We wouldn't want to mistakenly get
`nix/flake/flake/flake.hh`!

Progress on #7876
2025-04-01 11:40:42 -04:00
Robert Hensing
58b657b976 tests/nixos: Work around network-online.target inactivity 2025-04-01 16:36:47 +02:00
Robert Hensing
4de73df8bf
Merge pull request #12765 from Mic92/clan-tidy-cleanups
Add various clang tidy fixes
2025-04-01 15:36:50 +02:00
Robert Hensing
55297f865c Format
clang-format: 18.1.8 -> 19.1.7
2025-04-01 15:33:49 +02:00
Robert Hensing
c212035d94 flake: nixpkgs: 24.11 -> nixos-unstable
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/48d12d5e70ee91fe8481378e540433a7303dbf6a?narHash=sha256-1Noao/H%2BN8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E%3D' (2024-12-16)
  → 'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30)
2025-04-01 15:19:54 +02:00
mergify[bot]
cfc4db85a5
Merge pull request #12850 from Mic92/header
Revert "Create script to symlink headers to old location"
2025-04-01 12:50:04 +00:00
mergify[bot]
fadd86011f
Merge pull request #12814 from silvanshade/link-with-mold
Use mold instead of GNU ld for faster builds
2025-04-01 12:09:05 +00:00
Jörg Thalheim
c69e11ac46 Revert "Create script to symlink headers to old location"
This reverts commit c6a176be62.

Polluting the source tree with untracked symlinks that can end up
dangling may be unsound.
2025-04-01 13:55:41 +02:00
Jörg Thalheim
cfeb9404a8 remove deprecated gold linker
Binutils deprecated the gold linker, so do we.
For development we now use mold instead,
we can potentially also use it for release builds later.
2025-04-01 12:52:29 +02:00
Eelco Dolstra
db70061f0b
Merge pull request #12809 from DeterminateSystems/handle-failed-cached-values
Throw CachedEvalError if a cached value exists but has type "failed"
2025-04-01 11:49:09 +02:00
Eelco Dolstra
2ec1eba7ca Merge remote-tracking branch 'origin/master' into handle-failed-cached-values 2025-04-01 11:00:27 +02:00
mergify[bot]
3f5f2c4734
Merge pull request #12798 from obsidiansystems/clean-config-headers
Cleanup config headers
2025-04-01 07:47:32 +00:00
Jörg Thalheim
6fe39566d2
Merge pull request #12805 from thomie/nix-daemon-source-once
nix-daemon: source nix-profile-daemon.sh only once
2025-04-01 08:46:13 +02:00
John Ericson
c204e307ac Cleanup config headers
There are two big changes:

1. Public and private config is now separated. Configuration variables
   that are only used internally do not go in a header which is
   installed.

   (Additionally, libutil has a unix-specific private config header,
   which should only be used in unix-specific code. This keeps things a
   bit more organized, in a purely private implementation-internal way.)

2. Secondly, there is no more `-include`. There are very few config
   items that need to be publically exposed, so now it is feasible to
   just make the headers that need them just including the (public)
   configuration header.

And there are also a few more small cleanups on top of those:

- The configuration files have better names.

- The few CPP variables that remain exposed in the public headers are
  now also renamed to always start with `NIX_`. This ensures they should
  not conflict with variables defined elsewhere.

- We now always use `#if` and not `#ifdef`/`#ifndef` for our
  configuration variables, which helps avoid bugs by requiring that
  variables must be defined in all cases.
2025-03-31 23:28:36 -04:00
Jörg Thalheim
0e1da295e9
Merge pull request #12817 from NixOS/link-header-script
Create script to symlink headers to old location
2025-04-01 00:48:01 +02:00
John Ericson
c6a176be62 Create script to symlink headers to old location
See comments on the script; this is supposed to avoid breaking muscle
memory without complicating the build system (which proved harder than I
thought too) or not doing the header hygiene change at all.

link-headers: use pathlib consistenly and fix type errors
2025-03-31 21:32:27 +02:00
mergify[bot]
5a8dedc45c
Merge pull request #12764 from NixOS/header-file-namespacing
Separate headers from source files
2025-03-31 18:03:22 +00:00
John Ericson
38dfb40fdb
Merge pull request #12815 from NixOS/mergify-yml-2.28
.mergify.yml: Add backport 2.28-maintenance entry
2025-03-31 13:18:11 -04:00
silvanshade
3546e574ca
Use mold instead of GNU ld for faster builds 2025-03-31 10:38:11 -06:00
Jörg Thalheim
97ff7330ef
Merge pull request #12812 from DeterminateSystems/disable-packaging-overriding
Disable packaging-overriding test
2025-03-31 18:30:23 +02:00
John Ericson
f3e1c47f47 Separate headers from source files
The short answer for why we need to do this is so we can consistently do
`#include "nix/..."`. Without this change, there are ways to still make
that work, but they are hacky, and they have downsides such as making it
harder to make sure headers from the wrong Nix library (e..g.
`libnixexpr` headers in `libnixutil`) aren't being used.

The C API alraedy used `nix_api_*`, so its headers are *not* put in
subdirectories accordingly.

Progress on #7876

We resisted doing this for a while because it would be annoying to not
have the header source file pairs close by / easy to change file
path/name from one to the other. But I am ameliorating that with
symlinks in the next commit.
2025-03-31 12:20:25 -04:00
John Ericson
326548bae5 Cleanup config header for libcmd
- Since it's now private, give it a rename. Note that I want to switch the
  word order on the public ones too.

- Since it is only needed by two files, just include there rather than
  the nasty blanket-forced thing.
2025-03-31 12:20:25 -04:00
John Ericson
c29b2d1058 .mergify.yml: Add backport 2.28-maintenance entry 2025-03-31 12:15:28 -04:00
Eelco Dolstra
a4be66828a Disable packaging-overriding
Fixes #12690.
2025-03-31 16:37:36 +02:00
Eelco Dolstra
5a35745949 AttrCursor::Parent: shared_ptr -> ref 2025-03-31 15:14:10 +02:00
Eelco Dolstra
8b438fccb4 Throw CachedEvalError if a cached value exists but has type "failed"
Otherwise you get unhelpful errors like

  error: 'apps' is not an attribute set

Fixes #12762.
2025-03-31 15:11:39 +02:00
Thomas Miedema
2b4e3fa144 nix-daemon: source nix-profile-daemon.sh only once
On my system (Ubuntu 24.04 with nix installed using
https://zero-to-nix.com/), I noticed that my PATH
contained multiple times the following entries:

  /home/thomas/.nix-profile/bin
  /nix/var/nix/profiles/default/bin

Fix it by inserting a missing `export`, to make
sure `nix-daemon.sh` is really only executed once.
2025-03-29 20:23:16 +01:00
John Ericson
3f13cc0f87
Merge pull request #12794 from obsidiansystems/fix-windows-build
Fix windows build
2025-03-28 21:04:14 -04:00
John Ericson
99041b4d84 Fix windows build
PR #12767 accidentally broke it.
2025-03-28 20:04:51 -04:00
John Ericson
1cfbd489f5
Merge pull request #12789 from DeterminateSystems/nix-daemon-no-store
nix daemon: Don't open the store
2025-03-28 20:01:11 -04:00
Eelco Dolstra
9590167290 nix daemon: Don't open the store
This makes it behave the same as nix-daemon. Opening the store in the
parent can cause a SIGBUS in libsqlite in the child:

  #0  0x00007f141cf6f789 in __memset_avx2_unaligned_erms () from /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6
  #1  0x00007f141c322fe8 in walIndexAppend () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #2  0x00007f141c3711a2 in pagerWalFrames () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #3  0x00007f141c38317e in sqlite3PagerCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #4  0x00007f141c383555 in sqlite3BtreeCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #5  0x00007f141c384797 in sqlite3VdbeHalt () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #6  0x00007f141c3b8f60 in sqlite3VdbeExec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #7  0x00007f141c3bbfef in sqlite3_step () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #8  0x00007f141c3bd0e5 in sqlite3_exec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0
  #9  0x00007f141da140e0 in nix::SQLiteTxn::commit() () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so
  #10 0x00007f141d9ce69c in nix::LocalStore::registerValidPaths(std::map<nix::StorePath, nix::ValidPathInfo, std::less<nix::StorePath>, std::allocator<std::pair<nix::StorePath const, nix::ValidPathInfo> > > const&)::{lambda()#1}::operator()() const () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so
2025-03-28 19:29:50 +01:00
John Ericson
fd98f30e4e
Merge pull request #12758 from roberth/lutimes-error
libutil: Fix error message
2025-03-28 13:06:43 -04:00
John Ericson
f1197f7601
Merge pull request #12768 from Mic92/improve-error-messages
substitution-goal: convert assert into an Error
2025-03-28 13:05:46 -04:00