Commit Graph

14085 Commits

Author SHA1 Message Date
Théophane Hufschmitt
81466aff45 Make nix-collect-garbage -d look into more places
Make it look into the new-style profiles dir, the old-style one, and the
target of `~/.nix-profile` to be sure that we don't miss anything

(cherry picked from commit 64b0cc5bc4)
2023-05-16 13:52:04 +00:00
John Ericson
02b2ea1e1a
Merge pull request #8320 from NixOS/backport-8310-to-2.15-maintenance
[Backport 2.15-maintenance] Fix `nix print-dev-env` & `nix develop` with drv paths
2023-05-12 00:02:10 -04:00
John Ericson
fec05fad3a Fix nix print-dev-env & nix develop with drv paths
Fixes #8309

This regression was because both `CmdDevelop` and `CmdPrintDevEnv` were
switched to be `InstallableValueCommand` subclasses, but actually
neither should have been.

The `nixpkgsFlakeRef` method should indeed not be on the base
installable class, because "flake refs" and "nixpkgs" are not
installable-wide notions, but that doesn't mean these commands should
only accept installable values.

(cherry picked from commit a93110ab19)
2023-05-11 21:08:10 +00:00
Robert Hensing
ab14087ea3
Merge pull request #8237 from NixOS/backport-8231-to-2.15-maintenance
[Backport 2.15-maintenance] Gate experimental features in `DerivationOutput::fromJSON`
2023-04-18 17:36:25 +02:00
John Ericson
bef52e525d Gate experimental features in DerivationOutput::fromJSON
This is an entry point for outside data, so we need to check enabled
experimental features here.

(cherry picked from commit aa74c7b0bc)
2023-04-18 13:43:19 +00:00
John Ericson
80afafdbd4
Merge pull request #8221 from NixOS/backport-8214-to-2.15-maintenance
[Backport 2.15-maintenance] Display valid installable in `InstallableDerivedPath::parse` warning
2023-04-15 10:37:59 -04:00
John Ericson
e79de4791d Legacy vs non-legacy to_string/parse for DerivedPath
As requested by @roberth, it is good to call out the specific instances
we care about, which is `!` for the RPC protocols, and `^` for humans.

This doesn't take advantage of parametricity as much, but since the
human and computer interfaces are good to decouple anyways (we don't
care if they drift further apart over time in the slightest) some
separation and slight duplication is fine.

Also, unit test both round trips.

(cherry picked from commit ee420ac64e)
2023-04-15 12:15:19 +00:00
Raphael Robatsch
a345c14cc1 Display valid installable in InstallableDerivedPath::parse warning
The warning message should produce an installable name that can be
passed to `nix build`, `nix path-info`, etc. again. Since the CLI
expects that the .drv path and the output names are separated by
a caret, the warning message must also separate the .drv path and output
names with a caret.

However, `DerivedPath::Built.to_string()` uses an exclamation point as
the separator instead. This commit adds a `separator` argument to the
to_string method.

This changes the warning message from:
If this command is now failing try again with '/nix/store/foo.drv!*'
to:
If this command is now failing try again with '/nix/store/foo.drv^*'

(cherry picked from commit 9e8f209036)
2023-04-15 12:15:19 +00:00
Eelco Dolstra
717cd487b1 Bump version 2023-04-11 20:16:10 +02:00
John Ericson
8340e2623a
Merge pull request #8203 from NixOS/backport-8201-to-2.15-maintenance
[Backport 2.15-maintenance] Do not gate or hide experimental settings
2023-04-11 11:45:02 -04:00
John Ericson
9af0a0e049 Do not gate or hide experimental settings
This is somewhat hacky fix just for 2.15. I unintentionally hid them
from the manual, when no one wanted to hide them that (including
myself). I also required the experimental feature to be enabled in an
order-dependent way, which is not good.

The simplest fix for this immanent release is just to always show them,
and always allow them to be set.

Effectively undoes some changes from aa663b7e89

(cherry picked from commit 450e5ec618)
2023-04-11 15:37:29 +00:00
Eelco Dolstra
d2932ad0be Revert "Filter tests/nixos from source"
This reverts commit 80f9231b69 because
it causes a divergence in the source tree used for the Nix build
between hydra.nixos.org and Nix.
2023-04-11 16:26:57 +02:00
Eelco Dolstra
d7bedc60f9 Mark official release 2023-04-11 14:06:41 +02:00
Eelco Dolstra
0a54624275
Merge pull request #8200 from edolstra/release-notes
2.15 release notes
2023-04-11 13:18:30 +02:00
Eelco Dolstra
e570a91661 Release notes 2023-04-11 12:40:56 +02:00
Eelco Dolstra
162c3f5f7c
Merge pull request #8170 from tweag/fix-aarch64-build
Explicitely define `LockFile::operator!=`
2023-04-11 12:35:23 +02:00
Eelco Dolstra
45ca4e6432
Merge pull request #8158 from tweag/harden-profiles-test
Fix the flaky `nix-profile` test
2023-04-11 12:12:09 +02:00
Eelco Dolstra
8fd91b3585
Merge pull request #8153 from obsidiansystems/more-labeler
Try auto-labeling a few more things
2023-04-11 12:10:34 +02:00
Eelco Dolstra
60a1bf08b6
Merge pull request #7798 from peeley/list-experimental-features
Documentation: list experimental features in manual
2023-04-11 11:55:35 +02:00
Eelco Dolstra
deb7f4b466
Nitpicks 2023-04-11 11:29:35 +02:00
Robert Hensing
a2ec8eaf17
Merge pull request #8190 from NaN-git/configure_ac
add check for librapidcheck
2023-04-10 20:13:32 +02:00
John Ericson
73eb6a2a57 Single page for experimental feature descriptions
As requested by @fricklerhandwerk.
2023-04-09 11:01:23 -04:00
Philipp Otterbein
ca6b759f4e fix failing configure in nix-tests 2023-04-09 02:33:53 +02:00
Philipp Otterbein
8ffc05e7ec add check for librapidcheck
declare RAPIDCHECK_HEADERS as variable
2023-04-08 22:29:43 +02:00
Robert Hensing
8f0ec323ea
Merge pull request #8180 from obsidiansystems/factor-out-daemon-cmd-helpers
Tidy up and comment daemon CLI
2023-04-08 16:57:49 +02:00
John Ericson
8f44edc83e Tidy up and comment daemon CLI
Some of the factoring out was taken from #7912 by @mupdt. Thanks!

No behavior should be changed in this commit.

Co-Authored-By: mupdt <25388474+mupdt@users.noreply.github.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-07 16:49:52 -04:00
Robert Hensing
4411c7d7e0
Merge pull request #8179 from tweag/disable-gc-on-coroutine
disable gc on coroutine
2023-04-07 18:21:11 +02:00
John Ericson
0746951be1
Finish converting existing comments for internal API docs (#8146)
* Finish converting existing comments for internal API docs

99% of this was just reformatting existing comments. Only two exceptions:

- Expanded upon `BuildResult::status` compat note

- Split up file-level `symbol-table.hh` doc comments to get
  per-definition docs

Also fixed a few whitespace goofs, turning leading tabs to spaces and
removing trailing spaces.

Picking up from #8133

* Fix two things from comments

* Use triple-backtick not indent for `dumpPath`

* Convert GNU-style `\`..'` quotes to markdown style in API docs

This will render correctly.
2023-04-07 13:55:28 +00:00
Robert Hensing
54b3b6ebc6
Merge pull request #7887 from obsidiansystems/add-derivation
`nix derivation add`, `show-derivation` -> `derivation show`
2023-04-07 15:02:35 +02:00
Yorick van Pelt
62ddd8633c Add talkative msg for coro gc debug 2023-04-07 14:54:50 +02:00
Yorick van Pelt
58d24a4cb6 Always disable GC in a coroutine unless the patch is applied 2023-04-07 14:54:38 +02:00
Yorick van Pelt
00bc34430b DisableGC: replace by CoroutineContext, std::shared_ptr<void> 2023-04-07 14:53:40 +02:00
Yorick van Pelt
2c53ef1bfe Disable GC inside coroutines on mac OS 2023-04-07 14:52:59 +02:00
John Ericson
9d1105824f Add release notes for nix derivation {add,show} 2023-04-07 08:35:59 -04:00
John Ericson
59e0728714 Create nix derivation add command
Also refine `nix derivation show`'s docs very slightly.
2023-04-07 08:34:58 -04:00
John Ericson
27597f8131 Rename files to reflect new nix derivation show name
This will match the files we added for `nix add derivation` in the rest
of this PR.
2023-04-07 08:34:58 -04:00
John Ericson
2b98af2e62 nix show-derivation -> nix derivation show 2023-04-07 08:34:58 -04:00
John Ericson
4e9f32f993 Liberate checkDerivationOutputs from LocalStore
Make it instead a method on `Derivation` that can work with any store.
We will need this for a CLI command to create a derivation.
2023-04-07 08:34:58 -04:00
John Ericson
b200784cec Include the name in the JSON for derivations
This is non-breaking change in the to-JSON direction. This *is* a
breaking change in the from-JSON direction, but we don't care, as that
is brand new in this PR.

`nix show-derivation --help` currently has the sole public documentation
of this format, it is updated accordingly.
2023-04-07 08:34:58 -04:00
John Ericson
fe9cbe838c Create Derivation::fromJSON
And test, of course
2023-04-07 08:34:58 -04:00
Théophane Hufschmitt
81dfc2b012
Merge pull request #7515 from MatthewCroughan/mc/check-trusted-user
Add Store::isTrustedClient()
2023-04-07 13:41:32 +02:00
Eelco Dolstra
6960de73af
Typo 2023-04-07 13:08:32 +02:00
matthewcroughan
9207f94582 Add Store::isTrustedClient()
This function returns true or false depending on whether the Nix client
is trusted or not. Mostly relevant when speaking to a remote store with
a daemon.

We include this information in `nix ping store` and `nix doctor`

Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
2023-04-06 19:59:57 -04:00
John Ericson
bc192a95ef Describe active experimental features in the contributing guide
They are put in the manual separate pages under the new overarching
description of experimental features.

The settings page just lists the valid experimental feature names (so
people know what a valid setting entry looks like), with links to those
pages. It doesn't attempt to describe each experimental feature as that
is too much information for the configuration settings section.
2023-04-06 18:07:59 -04:00
John Ericson
6c4049b38a Link the new general documentation on xp features on the setting 2023-04-06 18:07:58 -04:00
John Ericson
b7cd87a853 Merge remote-tracking branch 'upstream/master' into list-experimental-features 2023-04-06 18:07:46 -04:00
Noah Snelson
e399cb49c2
Fix typo in no-url-literals experimental feature docs
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-04-06 15:02:19 -07:00
Noah Snelson
8a7790f46a Expand documentation for experimental-features
Adds examples and additional information to the `impure-derivations`,
`recursive-nix`, and `no-url-literals` experimental feature
documentation.
2023-04-06 14:52:34 -07:00
Théophane Hufschmitt
9185639631
Document the concept of “experimental feature” (#5930)
Add a page explaining what “experimental features” are, when and how they should be used

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2023-04-06 11:25:22 +00:00
Théophane Hufschmitt
faefaac875 Explicitely define LockFile::operator!=
It should be syntethised in terms of `operator==`, but the GCC version
used on aarch64-linux doesn't implement that (see
https://hydra.nixos.org/build/214848896=. So explicitely define it.

Fix https://github.com/NixOS/nix/issues/8159
2023-04-05 17:20:04 +02:00