1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 01:01:48 +02:00

Stabilize the "nix-command" feature

This commit is contained in:
Eelco Dolstra 2024-07-10 17:01:37 +02:00
parent 51583851a2
commit e638d00223
9 changed files with 6 additions and 35 deletions

View file

@ -36,11 +36,6 @@ let
let let
result = '' result = ''
> **Warning** \
> This program is
> [**experimental**](@docroot@/contributing/experimental-features.md#xp-feature-nix-command)
> and its interface is subject to change.
# Name # Name
`${command}` - ${details.description} `${command}` - ${details.description}

View file

@ -994,9 +994,7 @@ void DerivationGoal::buildDone()
msg += line; msg += line;
msg += "\n"; msg += "\n";
} }
auto nixLogCommand = experimentalFeatureSettings.isEnabled(Xp::NixCommand) auto nixLogCommand = "nix log";
? "nix log"
: "nix-store -l";
msg += fmt("For full logs, run '" ANSI_BOLD "%s %s" ANSI_NORMAL "'.", msg += fmt("For full logs, run '" ANSI_BOLD "%s %s" ANSI_NORMAL "'.",
nixLogCommand, nixLogCommand,
worker.store.printStorePath(drvPath)); worker.store.printStorePath(drvPath));

View file

@ -583,7 +583,7 @@ Strings argvToStrings(int argc, char * * argv)
std::optional<ExperimentalFeature> Command::experimentalFeature () std::optional<ExperimentalFeature> Command::experimentalFeature ()
{ {
return { Xp::NixCommand }; return {};
} }
MultiCommand::MultiCommand(std::string_view commandName, const Commands & commands_) MultiCommand::MultiCommand(std::string_view commandName, const Commands & commands_)

View file

@ -86,15 +86,6 @@ constexpr std::array<ExperimentalFeatureDetails, numXpFeatures> xpFeatureDetails
)", )",
.trackingUrl = "https://github.com/NixOS/nix/milestone/31", .trackingUrl = "https://github.com/NixOS/nix/milestone/31",
}, },
{
.tag = Xp::NixCommand,
.name = "nix-command",
.description = R"(
Enable the new `nix` subcommands. See the manual on
[`nix`](@docroot@/command-ref/new-cli/nix.md) for details.
)",
.trackingUrl = "https://github.com/NixOS/nix/milestone/28",
},
{ {
.tag = Xp::GitHashing, .tag = Xp::GitHashing,
.name = "git-hashing", .name = "git-hashing",
@ -302,7 +293,7 @@ static_assert(
* A set of previously experimental features that are now considered * A set of previously experimental features that are now considered
* stable. We don't warn if users have these in `experimental-features`. * stable. We don't warn if users have these in `experimental-features`.
*/ */
std::set<std::string> stabilizedFeatures{"flakes"}; std::set<std::string> stabilizedFeatures{"flakes", "nix-command"};
const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name) const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name)
{ {

View file

@ -20,7 +20,6 @@ enum struct ExperimentalFeature
CaDerivations, CaDerivations,
ImpureDerivations, ImpureDerivations,
FetchTree, FetchTree,
NixCommand,
GitHashing, GitHashing,
RecursiveNix, RecursiveNix,
NoUrlLiterals, NoUrlLiterals,

View file

@ -120,7 +120,6 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
.description = "Print full build logs on standard error.", .description = "Print full build logs on standard error.",
.category = loggingCategory, .category = loggingCategory,
.handler = {[&]() { logger->setPrintBuildLogs(true); }}, .handler = {[&]() { logger->setPrintBuildLogs(true); }},
.experimentalFeature = Xp::NixCommand,
}); });
addFlag({ addFlag({
@ -136,7 +135,6 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
.description = "Disable substituters and consider all previously downloaded files up-to-date.", .description = "Disable substituters and consider all previously downloaded files up-to-date.",
.category = miscCategory, .category = miscCategory,
.handler = {[&]() { useNet = false; }}, .handler = {[&]() { useNet = false; }},
.experimentalFeature = Xp::NixCommand,
}); });
addFlag({ addFlag({
@ -144,7 +142,6 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
.description = "Consider all previously downloaded files out-of-date.", .description = "Consider all previously downloaded files out-of-date.",
.category = miscCategory, .category = miscCategory,
.handler = {[&]() { refresh = true; }}, .handler = {[&]() { refresh = true; }},
.experimentalFeature = Xp::NixCommand,
}); });
} }

View file

@ -54,8 +54,8 @@ var=$(nix config show | grep '^allowed-uris =' | cut -d '=' -f 2 | xargs)
# Test that we can !include a file. # Test that we can !include a file.
export NIX_USER_CONF_FILES=$here/config/nix-with-bang-include.conf export NIX_USER_CONF_FILES=$here/config/nix-with-bang-include.conf
var=$(nix config show | grep '^experimental-features =' | cut -d '=' -f 2 | xargs) var=$(nix config show | grep '^fsync-metadata =' | cut -d '=' -f 2 | xargs)
[[ $var == nix-command ]] [[ $var == true ]]
# Test that it's possible to load config from the environment # Test that it's possible to load config from the environment
prev=$(nix config show | grep '^cores' | cut -d '=' -f 2 | xargs) prev=$(nix config show | grep '^cores' | cut -d '=' -f 2 | xargs)

View file

@ -1,2 +1,2 @@
experimental-features = nix-command fsync-metadata = true
!include ./missing-extra-config.conf !include ./missing-extra-config.conf

View file

@ -79,12 +79,3 @@ nix --experimental-features '' --help 1>/dev/null
nix --experimental-features '' doctor --help 1>/dev/null nix --experimental-features '' doctor --help 1>/dev/null
nix --experimental-features '' repl --help 1>/dev/null nix --experimental-features '' repl --help 1>/dev/null
nix --experimental-features '' upgrade-nix --help 1>/dev/null nix --experimental-features '' upgrade-nix --help 1>/dev/null
# These 3 arguments are currently given to all commands, which is wrong (as not
# all care). To deal with fixing later, we simply make them require the
# nix-command experimental features --- it so happens that the commands we wish
# stabilizing to do not need them anyways.
for arg in '--print-build-logs' '--offline' '--refresh'; do
nix --experimental-features 'nix-command' "$arg" --help 1>/dev/null
expect 1 nix --experimental-features '' "$arg" --help 1>/dev/null
done