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

21181 commits

Author SHA1 Message Date
Robert Hensing
0468c1d69a flake.nix: Create package sets independent of overlay
This was carefully refactored by inlining some Nixpkgs definitions
like `generateSplicesForMkScope`, so the memoization properties
should remain the same.
2025-07-19 16:27:55 +03:00
Sergei Zimmerman
a54284cbc7
rl-next: Add release note about IPv6 Scoped Addresses in URIs 2025-07-18 21:24:03 +03:00
Sergei Zimmerman
bd1d2d1041
libutil: Use Boost.URL in parseURL
Boost.URL is a significantly more RFC-compliant parser
than what libutil currently has a bundle of incomprehensible
regexes.

One aspect of this change is that RFC4007 ZoneId IPv6 literals
are represented in URIs according to RFC6874 [1].

Previously they were represented naively like so: [fe80::818c:da4d:8975:415c\%enp0s25].
This is not entirely correct, because the percent itself has to be pct-encoded:

> "%" is always treated as
   an escape character in a URI, so, according to the established URI
   syntax [RFC3986] any occurrences of literal "%" symbols in a URI MUST
   be percent-encoded and represented in the form "%25".  Thus, the
   scoped address fe80::a%en1 would appear in a URI as
   http://[fe80::a%25en1].

[1]: https://datatracker.ietf.org/doc/html/rfc6874

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2025-07-18 21:24:01 +03:00
Sergei Zimmerman
d020f21a2a
libutil: Use default operator== for ParsedURL
The default comparison operator can be generated
by the compiler since C++20.
2025-07-18 21:23:42 +03:00
Sergei Zimmerman
ad449c0288
libutil: Refactor percentDecode,percentEncode to use Boost.URL
The myriad of hand-rolled URL parsing and validation code
is a constant source of problems. Regexes are not a great way
of writing parsers and there's a history of getting them wrong.
Boost.URL is a good library we can outsource most of the heavy
lifting to.
2025-07-18 21:23:40 +03:00
Sergei Zimmerman
d9053390ce
libutil-test-support: Add HasSubstrIgnoreANSIMatcher
This matcher is useful for checking error messages, which
always contain ANSI escapes.
2025-07-18 21:23:38 +03:00
Sergei Zimmerman
ffc9bfb66d
lib{store,flake}-tests: Add test for spaces in URIs
These cases do not seem to be covered by the test suite at all.
2025-07-18 21:23:35 +03:00
Sergei Zimmerman
b8d223a210
Merge pull request #13108 from DeterminateSystems/check-format
Rip off the bandaid: Format the codebase with clang-format
2025-07-18 20:38:50 +03:00
Graham Christensen
fb493ad7ca Update .git-blame-ignore-revs to ignore the mass reformatting 2025-07-18 12:47:27 -04:00
Graham Christensen
e4f62e4608 Apply clang-format universally.
* It is tough to contribute to a project that doesn't use a formatter,
* It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files
* Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose,

Let's rip the bandaid off?

Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge.
2025-07-18 12:47:27 -04:00
Graham Christensen
e7af2e6566 Drop a ton of files that should just get formatted 2025-07-18 12:46:51 -04:00
Graham Christensen
41bf87ec70 Update clang-format with fixing namespace coments, and separate definition blocks 2025-07-18 12:46:51 -04:00
Graham Christensen
6896761d79 Add sed 2025-07-18 12:46:51 -04:00
Graham Christensen
ee9b57cbf5 format.sh: support looping until it is happy 2025-07-18 12:46:51 -04:00
Sergei Zimmerman
60c48b7058
Merge pull request #13501 from k1gen/fix-rsync-requirement
Require rsync in nix-manual meson.build
2025-07-18 00:43:27 +03:00
Oleksandr Knyshuk
cfb8a31885
Require rsync in nix-manual meson.build
Closes: #13313
2025-07-17 22:59:37 +02:00
Jörg Thalheim
599c1d78ed
Merge pull request #13496 from k1gen/fix-help-shell-command
Fix `nix help shell` by properly handling command aliases
2025-07-17 19:40:47 +02:00
Jörg Thalheim
4c95086879
Merge pull request #13493 from Mic92/clang-tidy-virtual-methods
Fix virtual method calls during construction
2025-07-17 17:41:18 +02:00
Oleksandr Knyshuk
d678b071d6
Make nix help shell work by handling aliases properly
Previously, `nix help shell` failed with "Nix has no subcommand 'shell'" despite `nix shell --help`
working correctly. This happened because the `shell` command is actually an alias for `env shell`,
and the help system wasn't resolving aliases when looking up documentation.

This patch modifies the `showHelp` function to check for and resolve aliases before generating the
manpage name, ensuring that shorthand commands like `shell` get proper help documentation.

Closes: #13431
2025-07-17 17:26:56 +02:00
Jörg Thalheim
3c0cd73418 Fix uninitialized field in Attr constructor
The default constructor for Attr was not initializing the value pointer,
which could lead to undefined behavior when the uninitialized pointer is
accessed. This was caught by clang-tidy's UninitializedObject check.

This fixes the warning:
  1 uninitialized field at the end of the constructor call
  [clang-analyzer-optin.cplusplus.UninitializedObject]
2025-07-17 17:12:20 +02:00
Jörg Thalheim
6bf940d636 Fix clang-tidy uninitialized value warning in derivation-options.cc
Make lambda capture explicit to avoid clang-analyzer-core.CallAndMessage warning
2025-07-17 17:09:46 +02:00
Jörg Thalheim
4ba3b15a10 Fix s3.hh to include public config header
The s3.hh public header was incorrectly including store-config-private.hh
instead of the public config.hh. Since NIX_WITH_S3_SUPPORT is defined in
the public config, this caused clang-tidy to report it as undefined.
2025-07-17 17:09:38 +02:00
Jörg Thalheim
6e733b0544 Fix SIZE_MAX undefined warning in fchmodat2-compat.hh
Include <cstdint> to ensure SIZE_MAX is defined
2025-07-17 17:08:49 +02:00
Jörg Thalheim
32a11a64c1
Merge pull request #13491 from Mic92/clang-tidy-windows-fixes
Fix Windows header inclusions for clang-tidy
2025-07-17 16:46:54 +02:00
Jörg Thalheim
36d451ddf4
Merge pull request #13476 from NixOS/improve-ignored-exceptions
Improve rendering of ignored exceptions
2025-07-17 15:57:59 +02:00
Jörg Thalheim
a4d03ba527
Merge pull request #13370 from NixOS/unit-tests-home
Give unit tests access to a $HOME directory
2025-07-17 15:56:26 +02:00
Jörg Thalheim
44963da787 Fix virtual method calls during construction in LocalBinaryCacheStore
Move init() call from constructor to openStore() method to avoid calling
virtual methods during object construction. This prevents undefined
behavior when virtual methods are called before the object is fully
constructed.
2025-07-17 15:45:32 +02:00
Jörg Thalheim
f12f96bcbb Fix virtual method calls during construction in S3BinaryCacheStoreImpl
Move init() call from constructor to openStore() method to avoid calling
virtual methods during object construction. This prevents undefined
behavior when virtual methods are called before the object is fully
constructed.
2025-07-17 15:45:32 +02:00
Jörg Thalheim
6681933643 Fix Windows header inclusions for clang-tidy
Move windows-error.hh includes inside _WIN32 guards to prevent
clang-tidy errors when analyzing these files on non-Windows platforms.
2025-07-17 15:40:46 +02:00
tomberek
de1d91f711
Merge pull request #13486 from fzakaria/issue-12935
Add helpful messages when file:// used as tarball
2025-07-17 02:51:31 -04:00
tomberek
5ced59a21b
Merge pull request #13449 from fzakaria/issue-10431
Add error message when git returns non-0 for fetch
2025-07-17 02:50:13 -04:00
Farid Zakaria
196c21c5a0 Add helpful messages when file:// used as tarball
When `file://` is used accidentally in a flake as the source it is
expected to be a tarball by default.

Add some friendlier error messages to either inform the user this is not
in fact a tarball or if it's a git directory, let them know they can use
`git+file`.

fixes #12935
2025-07-16 21:17:07 -07:00
Eelco Dolstra
17c94ca89e
Merge pull request #13469 from drupol/push-nnwkpwsowkqm
docker: set default parameters values
2025-07-16 21:02:51 +02:00
Farid Zakaria
a4f548fed1 Fix FetchGit test 2025-07-16 08:04:16 -07:00
Farid Zakaria
fb6f494d35 merge stderr to stdout so we can emit it 2025-07-16 08:04:16 -07:00
Farid Zakaria
8e8416387c Add error message when git returns non-0 for fetch
Users have complained that fetchGit is flaky however the culprit is
likely that `git fetch` was unable itself to download the repository for
whatever reason (i.e. poor network etc..)

Nothing was checking the status of `git fetch` and the error message
that would eventually surface to the users were that the commit was not
found.

Add explicit error checking for status code from `git fetch` and return
a message earlier on to indicate that the failure was from that point.

fixes #10431
2025-07-16 08:04:16 -07:00
Eelco Dolstra
1272c4957f
Merge pull request #13442 from NixOS/boost-minver
Require Boost 1.82.0 or higher
2025-07-16 14:54:14 +02:00
Sergei Zimmerman
d7c340afbf
Merge pull request #13473 from xokdvium/dogfood-ci 2025-07-15 22:35:43 +03:00
Eelco Dolstra
8e98f62a6e PosixSourceAccessor: Use concurrent_flat_map 2025-07-15 19:49:07 +02:00
Eelco Dolstra
7b2f24d688 Improve handleSQLiteBusy() message
Closes https://github.com/NixOS/nix/pull/10319.
2025-07-15 19:09:45 +02:00
Eelco Dolstra
fde6068874 Improve rendering of ignored exceptions
Instead of

  error (ignored): error: SQLite database '...' is busy

we now get

  error (ignored): SQLite database '...' is busy
2025-07-15 19:09:40 +02:00
Eelco Dolstra
6abc29bba5 Move boost version check to libutil 2025-07-15 15:17:33 +02:00
Sergei Zimmerman
3b3c02160d
ci: Dogfood nix from master for vm_tests and flake_regressions
This should provide more coverage for the build from master that
is being dogfooded.
2025-07-14 17:03:12 +03:00
Sergei Zimmerman
04f6974d2c
ci: Dogfood Nix from master 2025-07-14 17:03:10 +03:00
Eelco Dolstra
e8314e69ab
Merge pull request #13460 from m4dc4p/m4dc4p/handle-expired-tokens
Better Handling for Expired Credentials
2025-07-14 11:51:30 +02:00
Eelco Dolstra
03bf582be3
Merge pull request #13468 from xokdvium/darwin-sandbox-sockets
libstore: fix Unix sockets in the build directory on sandboxed macOS
2025-07-14 11:13:36 +02:00
Pol Dellaiera
3e9a100bdf docker: set default parameters values 2025-07-13 22:49:12 +02:00
Emily
5cd94436f5
libstore: fix Unix sockets in the build directory on sandboxed macOS
We’re already allowing `/tmp` anyway, so this should be harmless,
and it fixes a regression in the default configuration caused by
moving the build directories out of `temp-dir`. (For instance, that
broke the Lix `guessOrInventPath.sockets` test.)

Note that removing `/tmp` breaks quite a few builds, so although it may
be a good idea in general it would require work on the Nixpkgs side.

Fixes: 749afbbe99fd7b45f828b72628252feba9241362
Change-Id: I6a6a69645f429bc50d4cb24283feda3d3091f534

(This is a cherry-pick of commit d1db3e5fa3faa43b3d2f2e2e843e9cfc1e6e1b71)

Lix patch: https://gerrit.lix.systems/c/lix/+/3500
2025-07-13 19:19:38 +03:00
m4dc4p
f786c0b8d1
Update src/libstore/s3-binary-cache-store.cc
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-07-12 08:06:09 -07:00
m4dc4p
22d6969d66
Update src/libstore/s3-binary-cache-store.cc
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-07-12 08:05:52 -07:00