1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 14:32:42 +01:00
Commit graph

20916 commits

Author SHA1 Message Date
Las
e87ba85705 Inline buildDone from DerivationGoal into use sites
The basic idea is that while we have duplicated this function, we now
have one call-site in the local build case, and one call site in the
build hook case. This unlocks big opportunities to specialize each copy,
since they really shouldn't be doing the same things. By the time we are
are done, there should not be much duplication left.

See #12628 for further info.
2025-03-12 18:00:07 -04:00
John Ericson
1de97bbe2e Factor out "last 10 log lines" error message code
This will help avoid duplication later. In particular, the next commit
will not need to duplicate as much.
2025-03-12 18:00:07 -04:00
John Ericson
637aa0944d Advanced attributes organize
This is supposed to firstly improve the docs as they are, and secondly
hint at how the core conceptual information ought to be moved to the
store derivation section of the manual.

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2025-03-12 17:45:51 -04:00
Jörg Thalheim
e9f1761597 libfetchers/git: fix caching head when using shallow clones
the old code was using the wrong cache directory, which lead to a
warning on every nix flake update

Update src/libfetchers/git.cc
2025-03-12 22:32:05 +01:00
Robert Hensing
0068e225e0
Merge pull request #12639 from DeterminateSystems/remove-NIX_HELD_LOCKS
Remove use of $NIX_HELD_LOCKS
2025-03-12 21:10:08 +00:00
Eelco Dolstra
78eed85ba3 Remove use of $NIX_HELD_LOCKS
This variable was once used to communicate already acquired store path
locks between Nix and the build hook, but this hasn't been the case
since 9bcb4d2dd9. So let's get rid of
it.
2025-03-12 21:28:56 +01:00
Eelco Dolstra
9c5a8e9352
Merge pull request #12636 from Mic92/crash-handler
port crash-handler from lix to nix
2025-03-12 20:59:20 +01:00
Jörg Thalheim
cac1168afd
Merge pull request #12424 from ilya-bobyr/fish-profile-unify-ca-bundle.crt-search
nix-profile.fish: Look for ca-bundle.crt in $NIX_PROFILES
2025-03-12 17:07:57 +01:00
Graham Christensen
f988d9edbf
Merge pull request #12 from DeterminateSystems/update-upgrade-docs
Update upgrade docs
2025-03-12 13:23:41 +00:00
Luc Perkins
70f08ee91c
Merge pull request #11 from DeterminateSystems/revamp-introduction
Change title in introduction
2025-03-12 13:22:54 +00:00
Jörg Thalheim
c9a3101bff
Merge pull request #12603 from NaN-git/fix-curl-retry
libstore: curl retry: reset content-encoding and don't use string after move
2025-03-12 13:47:51 +01:00
Jade Lovelace
163f94412a port crash-handler from lix to nix
It was first introduced in 19e0ce2c03

In Nix we only register the crash handler in main instead of initNix,
because library user may want to use their own crash handler.

Sample output:

Mar 12 08:38:06 eve nix[2303762]: Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:
Mar 12 08:38:06 eve nix[2303762]: Exception: nix::SysError: error: writing to file: Resource temporarily unavailable
Mar 12 08:38:06 eve nix[2303762]: Stack trace:
Mar 12 08:38:06 eve nix[2303762]:  0# 0x000000000076876A in nix
                                   1# 0x00007FDA40E9F20A in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   2# std::unexpected() in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   3# 0x00007FDA40E9F487 in /nix/store/2lhklm5aizx30qbw49acnrrzkj9lbmij-gcc-14-20241116-lib/lib/libstdc++.so.6
                                   4# nix::writeFull(int, std::basic_string_view<char, std::char_traits<char> >, bool) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   5# nix::writeLine(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   6# nix::JSONLogger::write(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void> const&) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   7# nix::JSONLogger::logEI(nix::ErrorInfo const&) in /home/joerg/git/nix/inst/lib/libnixutil.so
                                   8# nix::Logger::logEI(nix::Verbosity, nix::ErrorInfo) in nix
                                   9# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /home/joerg/git/nix/inst/lib/libnixmain.so
                                  10# 0x000000000087A563 in nix
                                  11# 0x00007FDA40BD41FE in /nix/store/6q2mknq81cyscjmkv72fpcsvan56qhmg-glibc-2.40-66/lib/libc.so.6
                                  12# __libc_start_main in /nix/store/6q2mknq81cyscjmkv72fpcsvan56qhmg-glibc-2.40-66/lib/libc.so.6
                                  13# 0x00000000006F4DF5 in nix

Co-authored-by: eldritch horrors <pennae@lix.systems>
2025-03-12 10:23:02 +01:00
Dmitry Bogatov
affd9bbab7
Update doc/manual/source/protocols/store-path.md
Co-authored-by: John Ericson <git@JohnEricson.me>
2025-03-11 12:30:21 -04:00
Jörg Thalheim
8e8edb5bf8
Merge pull request #12615 from xokdvium/ubsan-checks
flake: Enable UBSAN for checks
2025-03-11 14:22:20 +01:00
Jörg Thalheim
341628a037
Merge pull request #12618 from fzakaria/minor-text-fixes
Fix minor documentation typos
2025-03-11 14:13:14 +01:00
Jörg Thalheim
d1b21e812d
Merge pull request #12633 from xokdvium/wstring-ctor-fiasco
libutil/windows: Finally use the correct constructor for std::wstring
2025-03-11 13:52:29 +01:00
Sergei Zimmerman
24fbb456ba libutil/windows: Finally use the correct constructor for std::wstring
C++ is very intuitive /s [1]. Fixes #12631.

[1]: https://godbolt.org/z/jMa9GP5sq
2025-03-11 10:57:38 +00:00
mergify[bot]
cacab33f0d
Merge pull request #12629 from NixOS/dependabot/github_actions/cachix/install-nix-action-31
build(deps): bump cachix/install-nix-action from 30 to 31
2025-03-10 23:12:44 +00:00
dependabot[bot]
3387d5a3c4
build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 22:58:40 +00:00
Dmitry Bogatov
a0facb2aba Improve the documentation of the store path protocol
1. Fix confusing wording that might imply unnecessary double-hashing.
2. Add references to specifics of base-32 encoding.
3. Fix incorrect description that sha256 hash of `fingerprint` is
   truncated. "Truncated" is actual wording used in Nix theses, but it has
   unusual meaning, that is better conveyed by word "compressed", which is
   used by the reference C++ implementation.
4. Clarify details of base16 encoding.
2025-03-08 19:00:00 -05:00
Sergei Zimmerman
874587516c flake: Enable UBSAN for checks
Doing this makes catching non-obvious bugs easier. GHA CI workload is
already a concern and there isn't much benefit in running the tests with
and without sanitizers at the same time, so UBSAN is enabled for default
checks.

This change doesn't affect production builds in any way, but is rather a
step in the direction of improving automated testing during development.

Relates to #10969.
2025-03-09 00:24:47 +03:00
Robert Hensing
a047dec120
Merge pull request #12620 from nix-windows/c-api/leaks
c-api: fix a few memory leaks
2025-03-08 22:06:59 +01:00
John Ericson
fb4d55c227
Merge pull request #12619 from nix-windows/tests/fix-rapidcheck-arbitraries
rapidcheck: change to working arbitrary instances
2025-03-08 08:42:12 -08:00
Brian McKenna
79b019ec4f c-api: fix a few memory leaks 2025-03-08 20:23:07 +11:00
Brian McKenna
c58202c6f9 DerivedPathTest: disable prop_legacy_round_rip until fixed 2025-03-08 19:51:25 +11:00
Brian McKenna
c82ef825d4 coerceToSingleDerivedPathUnchecked: pass through experimental features
This fixes a few of the property tests, now that the property tests
are actually generating arbitrary data - some of that data now
requiring experimental features to function properly.
2025-03-08 19:14:58 +11:00
Brian McKenna
9a04f1e732 rapidcheck: change to working arbitrary instances
Here we're switching to combinators instead of dereference operator.
It turns out the dereference operator was being executed upon test
setup, meaning that we were only using a only single value for each of
the executions of the property tests! Really not good.

And on Windows, we instead get:

    operator* is not allowed in this context

ff6af6fc68/src/gen/detail/GenerationHandler.cpp (L16C31-L16C71)

Now a few of the property tests fail, because we're generating cases
which haven't been exercised before.
2025-03-08 19:08:29 +11:00
Farid Zakaria
33493b9ead Fix minor documentation typos
Was reading the store chapter and came across a few small typos
and edits.
2025-03-07 23:07:03 -08:00
Luc Perkins
b62167a014
Update upgrade docs 2025-03-07 14:53:22 -03:00
Eelco Dolstra
47e23811ff
Merge pull request #12613 from Mic92/minor-cleanups
Fix double quoting in some error messages
2025-03-07 18:38:48 +01:00
Luc Perkins
644f79dfd8
Add installation instructions to intro 2025-03-07 14:18:04 -03:00
Jörg Thalheim
3b1e23af09 libstore/remote-store: avoid old-style casting for maxConnections
Type-checking works better this way as (type) style casting is too
permissive.
2025-03-07 04:00:26 +01:00
Jörg Thalheim
3b0b2fd8d6 libflake: fix double quoting when updating flakes 2025-03-07 04:00:24 +01:00
Jörg Thalheim
559a2d1bc7 libfetchers/git: fix double quoting in error message 2025-03-07 04:00:22 +01:00
Graham Christensen
d1ec1b7eff
Merge pull request #10 from DeterminateSystems/grahamc-patch-1
Publish the flake as public, every time
2025-03-06 23:42:09 +00:00
Graham Christensen
fd6231e612
Publish the flake as public, every time
This exposed a bug in FlakeHub's private toggling, where the public 3.0.0 release followed by an accidentally private 0.1.x release, managed to cause the flake to be shunted closed.

This should not be possible, so let's dig into how that came to be and make sure to create a test case against this should-be-impossible transition.
2025-03-06 15:36:43 -08:00
Luc Perkins
4f6d3299a4
Change document title 2025-03-06 14:42:58 -03:00
Luc Perkins
fea4ee8c5e
Merge pull request #9 from DeterminateSystems/nix-channel-deprecated
Move nix-channel under deprecated commands
2025-03-06 17:37:54 +00:00
Luc Perkins
aaf1967faa
Remove default Nix expression links 2025-03-05 17:49:23 -03:00
Luc Perkins
0f04d36c73
Remove default Nix expression doc from summary 2025-03-05 17:45:11 -03:00
Luc Perkins
d67db97abb
Remove channels link 2025-03-05 17:41:24 -03:00
Luc Perkins
1a5c4d49e4
Merge pull request #8 from DeterminateSystems/uninstallation-instructions
Revamp uninstallation docs
2025-03-05 20:38:27 +00:00
Luc Perkins
e2bc5e3774
Remove default Nix expression doc 2025-03-05 17:37:59 -03:00
Luc Perkins
e6a6bcbb73
Move nix-channel under deprecated commands 2025-03-05 17:30:47 -03:00
Luc Perkins
cef7855523
Fix merge conflict 2025-03-05 17:27:03 -03:00
Luc Perkins
39d99ebaa3
Merge pull request #7 from DeterminateSystems/github-links
Update GitHub links
2025-03-05 20:18:16 +00:00
Luc Perkins
f76ef9d4d3
Merge pull request #6 from DeterminateSystems/nix-installer-recommandation
Recommend only the Determinate Nix Installer
2025-03-05 20:07:26 +00:00
Luc Perkins
42606c16ad
Remove one more reference to binary doc 2025-03-05 16:59:50 -03:00
Luc Perkins
4323868244
Remove links to binary doc 2025-03-05 16:55:45 -03:00
Luc Perkins
c451f60cc7
Revamp uninstallation docs 2025-03-05 16:51:55 -03:00