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

20720 commits

Author SHA1 Message Date
John Ericson
2600391147 Simplify DerivationGoal loop -> if
More taking advantage of single wanted output. Also `auto *` not `auto`
for easy reading.
2025-08-13 22:44:10 -04:00
John Ericson
1a6f92837a Don't use InitialOutput in DerivationGoal
We don't need the `wanted` field. Just inline the other two fields.
2025-08-13 22:43:33 -04:00
John Ericson
14173d761c Simplify DerivationGoal by just storing a singular initialOutput
We know we want exactly want output in `DerivationGoal` now (since
recent refactors), so we can start simplifying things to take advantage
of this.
2025-08-13 22:07:59 -04:00
John Ericson
4b6edfcfc7 DerivationBuildingGoal: Check outputs beforehand
See the comment in the code for details. Some of the code is duplicated
for now, but we'll be cleaning that up soon.
2025-08-13 22:06:14 -04:00
Sergei Zimmerman
cf7084a67c
Merge pull request #13739 from obsidiansystems/getUri-not-string
Rewrite `StoreConfig::getUri` in terms of new `StoreConfig::getReference`
2025-08-14 02:46:48 +03:00
John Ericson
3e7879e6df Rewrite StoreConfig::getUri in terms of new StoreConfig::getReference
Rather than having store implementations return a free-form URI string,
have them return a `StoreReference`. This reflects that fact that this
method is supposed to invert `resolveStoreConfig`, which goes from a
`StoreReference` to some `StoreConfig` concrete derived class (based on
the registry).

`StoreConfig::getUri` is kept only as a convenience for the common case
that we want to immediately render the `StoreReference`.

A few tests were changed to use `local://` not `local`, since
`StoreReference` does not encode the `local` and `daemon` shorthands
(and instead desugars them to `local://` and `unix://` right away). I
think that is fine. `local` and `daemon` still work as input.
2025-08-13 19:06:59 -04:00
Sergei Zimmerman
dfcbe70564
Merge pull request #13750 from obsidiansystems/simplify-derivation-goal-0
Simplify `DerivationGoal` in two ways
2025-08-14 02:02:03 +03:00
John Ericson
ed55937002 Make many members of DerivationGoal private 2025-08-13 17:50:39 -04:00
John Ericson
c37df9c87c Inline DerivationGoal::query{,Partial}DerivationOutputMap
The functions are used just once.
2025-08-13 17:50:35 -04:00
Jörg Thalheim
be3a508b74
Merge pull request #13748 from Mic92/toml-revert
Revert "Merge pull request #13741 from xokdvium/toml-timestamps"
2025-08-13 22:51:55 +02:00
Jörg Thalheim
75740fbd75 Revert "Merge pull request #13741 from xokdvium/toml-timestamps"
This reverts commit 53ac49f72c, reversing
changes made to 8e5ca787f4.

This broke nixpkgs eval test that was depending overflowing integers...
2025-08-13 22:46:09 +02:00
Jörg Thalheim
5d3197bb6c
Merge pull request #13497 from Mic92/repl-use-after-free-fix
Fix use-after-free warning in repl.cc
2025-08-13 21:55:01 +02:00
Jörg Thalheim
53ac49f72c
Merge pull request #13741 from xokdvium/toml-timestamps
libexpr: Canonicalize TOML timestamps for toml11 > 4.0
2025-08-13 21:22:15 +02:00
Sergei Zimmerman
8e5ca787f4
Merge pull request #13743 from kip93/fix/lfs-ssh
Fix Git LFS SSH issues
2025-08-13 21:50:41 +03:00
Leandro Reina
ccf658ed5c
Fix Git LFS SSH issues
* Adds support for NIX_SSHOPTS
* Properly uses the parsed port from URL (fixes #13337)
* Don't guess the HTTP endpoint, use the response of git-lfs-authenticate
* Add an SSH Git LFS test
* Removed some unused test code
2025-08-13 21:04:29 +03:00
Jörg Thalheim
68839b9545
Merge pull request #13742 from xokdvium/fix-i686
libutil: Fix i686-linux build on clangStdenv
2025-08-13 09:03:25 +02:00
Sergei Zimmerman
b5289fa130
libutil: Fix i686-linux build on clangStdenv
Clang refused to do a narrowing conversion in an initializer list:

```
 local-keys.cc:56:90: note: insert an explicit cast to silence this issue
return name + ":" + base64::encode(std::as_bytes(std::span<const unsigned char>{sig, sigLen}));
                                                                                    ^~~~~~
                                                                                    static_cast<size_type>( )
```
2025-08-12 22:48:15 +03:00
Sergei Zimmerman
320b2c74ef
packaging: Build with toml11 4.4.0 2025-08-12 22:22:12 +03:00
Sergei Zimmerman
dc769d72cb
libexpr: Canonicalize TOML timestamps for toml11 > 4.0
This addresses several changes from toml11 4.0 bump in
nixpkgs [1].

1. Added more regression tests for timestamp formats.
   Special attention needs to be paid to the precision
   of the subsecond range for local-time. Prior versions select the closest
   (upwards) multiple of 3 with a hard cap of 9 digits.

2. Normalize local datetime and offset datetime to always
   use the uppercase separator `T`. This is actually the issue
   surfaced in [2]. This canonicalization is basically a requirement
   by (a certain reading) of rfc3339 section 5.6 [3].

3. If using toml11 >= 4.0 also keep the old behavior wrt
   to the number of digits used for subsecond part of the local-time.
   Newer versions cap it at 6 digits unconditionally.

[1]: https://www.github.com/NixOS/nixpkgs/pull/331649
[2]: https://www.github.com/NixOS/nix/issues/11441
[3]: https://datatracker.ietf.org/doc/html/rfc3339
2025-08-12 21:49:30 +03:00
Jörg Thalheim
ffe5c1ecb4
Merge pull request #13737 from NixOS/dependabot/github_actions/actions/download-artifact-5
build(deps): bump actions/download-artifact from 4 to 5
2025-08-12 15:43:43 +02:00
Sergei Zimmerman
d8fc55a46e
libexpr: Use table.size() instead of unnecessary loop 2025-08-12 14:58:53 +03:00
Sergei Zimmerman
a80a5c4dba
libexpr: Use recursive lambda instead of std::function
There's no reason to use a std::function for recursive lambdas
since there are polymorphic lambdas.
2025-08-12 14:55:29 +03:00
Sergei Zimmerman
df4e55ffc1
libexpr: Remove extra trailing semicolons (NFC)
This looks really weird after the reformat.
2025-08-12 14:31:38 +03:00
Sergei Zimmerman
7ed0229d1a
tests/functional/lang: Add more tests for TOML timestamps
Current test suite doesn't cover the subsecond formatting at
all and toml11 is quite finicky with that. We should at the very
least test its behavior to avoid silent breakages on updates.
2025-08-12 14:28:39 +03:00
dependabot[bot]
4fb89eb2ea
build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 09:05:31 +00:00
Sergei Zimmerman
6d481efd37
Merge pull request #13738 from NixOS/dependabot/github_actions/actions/checkout-5 2025-08-12 12:04:27 +03:00
dependabot[bot]
e8d780642d
build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 08:21:23 +00:00
Sergei Zimmerman
b21f811ff6
Merge pull request #13736 from obsidiansystems/getUri-on-config
`getUri` should be `const` and on `Store::Config` not `Store`
2025-08-12 01:13:08 +03:00
John Ericson
0ef6f72c9c getUri should be const and on Store::Config not Store
It is a side-effect property of the configuration alone, not the rest of
the store.
2025-08-11 17:44:50 -04:00
Jörg Thalheim
f93d25c0e7
Merge pull request #13735 from Mic92/override-dogfooding
ci: add workflow dispatch to bypass nix installer dogfooding
2025-08-11 20:24:08 +02:00
Jörg Thalheim
dfb78af184
Merge pull request #13734 from xokdvium/get-uri-correct
libstore: Correct getUri methods for all stores
2025-08-11 20:16:08 +02:00
Jörg Thalheim
f62b022872 ci: add workflow dispatch to bypass nix installer dogfooding
This helps to fix CI if our dogfooding Nix installer is broken
2025-08-11 19:51:46 +02:00
Sergei Zimmerman
41af531392
libstore: Correct getUri methods for all stores
Previously `getUri` didn't include store query parameters,
`ssh-ng` didn't include any information at all and the local
store didn't have the path:

```
$ nix store info --store "local?root=/tmp/aaa&require-sigs=false"
Store URL: local
Version: 2.31.0
Trusted: 1
$ nix store info --store "ssh-ng://localhost?remote-program=nix-daemon"
Store URL: ssh-ng://
Version: 2.31.0
Trusted: 1
$ nix store info --store "ssh://localhost?remote-program=nix-store"
Store URL: ssh://localhost
```

This commit changes this to:

```
$ nix store info --store "local?root=/tmp/aaa&require-sigs=false"
Store URL: local?require-sigs=false&root=/tmp/aaa
Version: 2.31.0
Trusted: 1
$ nix store info --store "ssh-ng://localhost?remote-program=nix-daemon"
Store URL: ssh-ng://localhost?remote-program=nix-daemon
Version: 2.31.0
Trusted: 1
$ nix store info --store "ssh://localhost?remote-program=nix-store"
Store URL: ssh://localhost?remote-program=nix-store
```
2025-08-11 20:44:31 +03:00
Sergei Zimmerman
73ebdf2497
libstore-tests: Restore commented out tests 2025-08-11 20:44:29 +03:00
Sergei Zimmerman
2c38ad2cfa
libutil: Include necessary headers in config-impl.hh
These headers need to be included before everything else
(at least in GCC).
2025-08-11 20:44:27 +03:00
Sergei Zimmerman
28b74c3143
libstore: Add forward declarations for SandboxMode serializers
This is necessary to make libstore-tests for store configs work again.
2025-08-11 20:44:25 +03:00
Sergei Zimmerman
a7fb257ec2
libutil: Make AbstractConfig::getSettings const 2025-08-11 20:44:23 +03:00
Sergei Zimmerman
920a878eaa
Merge pull request #13733 from xokdvium/fix-ci-2
ci: Bump pinned stable nix version
2025-08-11 20:36:38 +03:00
Sergei Zimmerman
9d033733f2
ci: Bump pinned stable nix version
2.30.1 can't build our daemon tests. The fix is in 2.30.2.
2025-08-11 20:35:12 +03:00
Sergei Zimmerman
1030ed1e7d
Merge pull request #13732 from xokdvium/disable-dogfood
ci: Disable dogfooding
2025-08-11 20:31:14 +03:00
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