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

20833 commits

Author SHA1 Message Date
Eelco Dolstra
c82b67fa05 BasicClientConnection::queryPathInfo(): Don't throw exception for invalid paths
This caused RemoteStore::queryPathInfoUncached() to mark the
connection as invalid (see
RemoteStore::ConnectionHandle::~ConnectionHandle()), causing it to
disconnect and reconnect after every lookup of an invalid path. This
caused huge slowdowns in conjunction with
19f89eb684 and lazy-trees.
2025-08-18 18:12:42 +02:00
Eelco Dolstra
48b600d995
Merge pull request #13783 from xokdvium/lowdown-cross
packaging: Fix lowdown cross
2025-08-18 13:17:13 +02:00
Sergei Zimmerman
0216775ab7
packaging: Fix lowdown cross
Stupid mistake on my part. `binaryTarballCross.x86_64-linux.x86_64-unknown-freebsd` now
builds as expected.
2025-08-18 12:57:04 +03:00
Jörg Thalheim
d48e04b05a
Merge pull request #13780 from xokdvium/lowdown-2
libcmd: Fix rendering of absolute URLs in markdown, update lowdown to 2.0.2
2025-08-18 08:54:05 +02:00
Farid Zakaria
b21304fe4c
libfetchers/git: Add support for '.' in gitsubmodules
Period '.' is a special branch name in the gitsubmodule file which
represents the branch of the parent repository [1].

We add support for this by registering the ref of the InputAccessor to
be that of the parent input if '.' is encountered.

Fixes #13215

[1]: man gitmodules
2025-08-18 00:28:20 +03:00
Sergei Zimmerman
3ffeed497a
packaging: Update lowdown to 2.0.2
Nixpkgs has been updated with this version and seems
like next stable nixos release will ship with lowdown 2.0.
2025-08-17 20:49:50 +03:00
Sergei Zimmerman
da8759bb41
libcmd: Fix rendering of absolute URLs in markdown
lowdown >= 1.4.0 supports LOWDOWN_TERM_NORELLINK to render
absolute urls. This is useful, since we want to keep links to
web resources and such intact.
2025-08-17 20:31:34 +03:00
Jörg Thalheim
f6db80a553
Merge pull request #13779 from vog/patch-1
Fix NIX_CONF_DIR description
2025-08-17 18:20:37 +02:00
Volker Diels-Grabsch
1d7ac6603c
Fix NIX_CONF_DIR description
Fix description of `NIX_CONF_DIR`. It currently say that it defaults to `prefix/etc/nix`, which would mean `/nix/etc/nix` on default installations, and contradicts the description in `conf-file-prefix.md`.

This fix makes the description of `NIX_CONF_DIR` consistent with `conf-file-prefix.md`, assuming that the latter is correct.
2025-08-17 17:28:46 +02:00
Sergei Zimmerman
4284497d98
Merge pull request #13778 from xokdvium/fake-references-in-benchmark-drvs
libstore-tests: Obfuscate derivation paths in drv files for benchmarks
2025-08-17 17:25:12 +03:00
Sergei Zimmerman
e244e32308
libstore-tests: Obfuscate derivation paths in drv files for benchmarks
Otherwise this might form a valid reference and nix repo will not be fetched
as a FOD.
2025-08-17 16:57:04 +03:00
Jörg Thalheim
72c8aa8bb1
Merge pull request #13774 from xokdvium/fix-authorization
tests/nixos: Fix daemon store reference in authorization test
2025-08-17 14:48:15 +02:00
Jörg Thalheim
723656daab
Merge pull request #13775 from xokdvium/more-pch
treewide: Futher improve compile times for clangStdenv builds
2025-08-17 14:47:41 +02:00
Jörg Thalheim
1cf0fe3186
Merge pull request #13773 from xokdvium/quotes-fragment
libutil: Fix handling of unescaped spaces, quotes and shevrons in queries and fragments
2025-08-17 14:45:42 +02:00
Sergei Zimmerman
bb9148fd5d
Merge pull request #13777 from PedroManse/master 2025-08-17 12:20:25 +03:00
Manse
ccc0a31f39
fix doc code example
Fixed nix shell's doc's shebang python example
2025-08-17 00:39:41 -03:00
Sergei Zimmerman
8be1cc6e96
libstore-tests: Improve compile times with PCH
(Before)

**** Time summary:
Compilation (25 times):
  Parsing (frontend):          145.5 s
  Codegen & opts (backend):     65.9 s

(After)

**** Time summary:
Compilation (26 times):
  Parsing (frontend):           39.9 s
  Codegen & opts (backend):     55.1 s
2025-08-17 01:08:31 +03:00
Sergei Zimmerman
347ed8d9ba
libfetchers: Improve compile times with PCH
(Before)

**** Time summary:
Compilation (17 times):
  Parsing (frontend):           72.3 s
  Codegen & opts (backend):     47.8 s

(After)

Compilation (19 times):
  Parsing (frontend):           27.5 s
  Codegen & opts (backend):     43.8 s
2025-08-17 00:57:14 +03:00
Sergei Zimmerman
f13aeaf2f1
libutil-tests: Improve compile times with PCH
(Before)

**** Time summary:
Compilation (30 times):
  Parsing (frontend):           98.2 s
  Codegen & opts (backend):     27.7 s

(After)

**** Time summary:
Compilation (31 times):
  Parsing (frontend):           34.9 s
  Codegen & opts (backend):     28.1 s
2025-08-17 00:57:06 +03:00
Sergei Zimmerman
d6973e105c
libexpr-tests: Improve compile times with PCH
(Before)

**** Time summary:
Compilation (14 times):
  Parsing (frontend):           60.1 s
  Codegen & opts (backend):     18.0 s

(After)

**** Time summary:
Compilation (15 times):
  Parsing (frontend):           16.6 s
  Codegen & opts (backend):     17.4 s
2025-08-17 00:56:54 +03:00
Sergei Zimmerman
3c0a5e0a51
nix-cli: Improve compile times
(Before)

**** Time summary:
Compilation (61 times):
  Parsing (frontend):          143.2 s
  Codegen & opts (backend):    105.8 s

(After)

**** Time summary:
Compilation (61 times):
  Parsing (frontend):          113.8 s
  Codegen & opts (backend):    111.7 s
2025-08-17 00:56:41 +03:00
Sergei Zimmerman
695f3bc7e3
tests/nixos: Fix daemon store reference in authorization test
Recent store reference cleanups have started canonicalizing
daemon -> unix://.
2025-08-16 23:31:57 +03:00
Sergei Zimmerman
dc1b2012af
libutil: Fix handling of unescaped spaces, quotes and shevrons in queries and fragments
Turns out we didn't have tests for some of the important behavior introduced
for flake reference fragments and url queries [1]. This is rather important
and is relied upon by existing tooling. This fixes up these exact cases before
handing off the URL to the Boost.URL parser.

To the best of my knowledge this implements the same behavior as prior regex-based
parser did [2]:

> fragmentRegex = "(?:" + pcharRegex + "|[/? \"^])*";
> queryRegex = "(?:" + pcharRegex + "|[/? \"])*";

[1]: 9c0a09f09f
[2]: https://github.com/NixOS/nix/blob/2.30.2/src/libutil/include/nix/util/url-parts.hh
2025-08-16 23:00:31 +03:00
John Ericson
0fd9ef0cf3
Merge pull request #13770 from obsidiansystems/delete-wrong-decl
Delete dangling declaration
2025-08-16 11:50:20 -04:00
John Ericson
d5102ab30c
Merge pull request #13771 from xokdvium/gdb-dev-shell
dev-shell: Add gdb
2025-08-16 11:45:24 -04:00
Sergei Zimmerman
0348030ae2
dev-shell: Add gdb
It's about time we added debuggers to the dev-shell. Having it in build inputs
does some magic so pretty printers for standard library types work better.
2025-08-16 18:27:39 +03:00
John Ericson
048cfb9cd6 Delete dangling declaration
There is no definition associated with this.
2025-08-16 11:27:10 -04:00
Jörg Thalheim
9fb62805b0
Merge pull request #13749 from Mic92/merge-queues
prepare merge queues for nix
2025-08-16 09:47:57 +02:00
John Ericson
3b03872ebf
Merge pull request #13766 from obsidiansystems/more-store-dir
Make a few more things use `StoreDirConfig` instead of `Store`
2025-08-15 16:20:39 -04:00
John Ericson
97c966cc69
Merge pull request #13765 from obsidiansystems/simplify-derivation-building-goal
Simplify `DerivationBuildingGoal`
2025-08-15 16:19:44 -04:00
John Ericson
9ccbe23056 DerivationBuilder Change missing initialOutput if..throw to assert
Since this goal has no (goal-wide) notion of "wanted outputs" (we're
building the derivation, and thus making all outputs), we should have
`initialOutputs` for all outputs, and if we're missing one that's an
internal error caused by a bug in Nix.

Concretely, `DerivationBuildingGoal::gaveUpOnSubstitution` now clearly
does create `initialOutputs` for all outputs, whereas a few commits ago
that was not obvious, so I feel confident in saying that this invariant
that should be upheld, in fact is upheld.

`scatchOutputs` is initialized for every initial output, so the same
change to it follows for the same reasons.
2025-08-15 15:50:46 -04:00
John Ericson
870bb68d38 DerivationBuilder::registerOutputs: Inline checkSuffix
It is a simple constant that is only used once.
2025-08-15 15:50:41 -04:00
John Ericson
4bc9ae67c7 Give DerivationBuilder a LocalStore not Store
This is just more honest, since we downcasted it to `LocalStore` in many
places. We had the downcast before because it wasn't needed in the hook
case, just the local building case, but now that `DerivationBuilder` is
separated and just does the building case, we have formalized the
boundary where the single downcast should occur.
2025-08-15 15:50:36 -04:00
John Ericson
14e355d87d Remove InitialOutput::wanted
No derivation goal type has a notion of variable wanted outputs any
more. They either want them all, or they just care about a single
output, in which case we would just store this information for the one
output in question.
2025-08-15 15:50:35 -04:00
John Ericson
79fb9b0d3c Make a few more things use StoreDirConfig instead of Store 2025-08-15 15:35:51 -04:00
John Ericson
316fef35dc
Merge pull request #13764 from obsidiansystems/simplify-store-dir
Simplify "Store dir" superclass
2025-08-15 15:24:47 -04:00
Sergei Zimmerman
1ed3ae8a9d
Merge pull request #13763 from obsidiansystems/more-flexible-get
More flexible typing for `get` in `util.hh`
2025-08-15 22:09:57 +03:00
John Ericson
0ef818dd92 More flexible typing for get in util.hh
This is good for e.g. `std::string_view` and `StringMap`.

Needed by #11139

Co-authored-by: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com>
2025-08-15 14:23:37 -04:00
John Ericson
64c2ee3f45 Simplify "Store dir" superclass
We can cut out some gratuitous inhertence as follows:

- `MixStoreDirMethods` -> `StoreDirConfig`

- `StoreDirConfig` deleted because no longer needed. It is just folded
  into `StoreConfig`.

- `StoreDirConfigBase` -> `StoreConfigBase` same trick still needed, but
  now is for `StoreConfig` not `StoreDirConfig`

Here's how we got here:

1. I once factored out `StoreDirConfig` in #6236.

2. I factored out `MixStoreDirMethods` in #13154.

But, I didn't realize at point (2) that we didn't need `StoreDirConfig`
anymore, all uses of `StoreDirConfig` could instead be uses of
`MixStoreDirMethods`. Now I am doing that, and renaming
`MixStoreDirMethods` to just `StoreDirConfig` to reduce churn.
2025-08-15 14:12:37 -04:00
Sergei Zimmerman
22378ea093
Merge pull request #13762 from xokdvium/delete-footguns
libutil: Delete footgun overloads of get and getOr
2025-08-15 17:58:32 +03:00
Sergei Zimmerman
408c09a120
libutil: Delete footgun overloads of get and getOr
To avoid mistakes like the one in cea85e79ee.
These overloads are just asking for trouble.
2025-08-15 17:29:17 +03:00
Sergei Zimmerman
c736db5320
Merge pull request #13761 from xokdvium/fix-dangling-pointers
libstore: Fix dangling pointers in DerivationGoal constructors
2025-08-15 17:03:49 +03:00
Sergei Zimmerman
cea85e79ee
libstore: Fix dangling pointers in DerivationGoal constructors
This leads to a use-after free, because staticOutputHashes returns a temporary
object that dies before we can do a `return *mOutputHash`.

This is most likely the cause for random failures in Hydra [1].

[1]: https://hydra.nixos.org/build/305091330/nixlog/2
2025-08-15 16:39:28 +03:00
Jörg Thalheim
4e776a5be8
Merge pull request #13753 from obsidiansystems/simplify-derivation-goal
Simplify `DerivationGoal` in many ways
2025-08-15 08:25:47 +02:00
Jörg Thalheim
677b1c0f8f prepare merge queues for nix 2025-08-15 08:05:01 +02:00
Sergei Zimmerman
f64000e3f4
Merge pull request #13756 from xokdvium/fix-copy-path-message
libstore: Fix makeCopyPathMessage
2025-08-15 02:10:41 +03:00
Sergei Zimmerman
e74ef417db
libstore: Fix makeCopyPathMessage
Old code completely ignored query parameters and it seems ok to keep
that behavior. There's a lot of code out there that parses nix code
like nix-output-monitor and it can't parse messages like:

> copying path '/nix/store/wha2hi4yhkjmccqhivxavbfspsg1wrsj-source' from 'https://cache.nixos.org' to 'local://'...

Let's not break these tools without a good reason. This goes in line
with what other code does by ignoring parameters in logs.

The issue is just in detecting the shorthand notations for the store
reference - not in printing the url in logs.

By default the daemon opens a local store with ?path-info-cache-size=0,
so that leads to the erronenous 'local://'.
2025-08-15 00:55:03 +03:00
John Ericson
4b4895e750
Merge pull request #13755 from xokdvium/concise-uri-logs
treewide: Remove getUri and replace with getHumanReadableURI where appropriate
2025-08-14 15:39:09 -04:00
Sergei Zimmerman
1b7ffa53af
treewide: Remove getUri and replace with getHumanReadableURI where appropriate
The problem with old code was that it used getUri for both the `diskCache`
as well as logging. This is really bad because it mixes the textual human
readable representation with the caching.

Also using getUri for the cache key is really problematic for the S3 store,
since it doesn't include the `endpoint` in the cache key, so it's totally broken.

This starts separating the logging / cache concerns by introducing a
`getHumanReadableURI` that should only be used for logging. The caching
logic now instead uses `getReference().render(/*withParams=*/false)` exclusively.
This would need to be fixed in follow-ups, because that's really fragile and
broken for some store types (but it was already broken before).
2025-08-14 16:47:05 +03:00
Jörg Thalheim
58eabe7479
Merge pull request #13754 from xokdvium/cleanup-docker-check-secrets
ci: Cleanup docker check secrets
2025-08-14 15:27:46 +02:00