Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output

This commit is contained in:
John Ericson
2020-06-04 21:04:35 +00:00
20 changed files with 296 additions and 44 deletions
+4 -2
View File
@@ -50,8 +50,10 @@ struct CmdAddToStore : MixDryRun, StoreCommand
info.narSize = sink.s->size();
info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, info.narHash);
if (!dryRun)
store->addToStore(info, sink.s);
if (!dryRun) {
auto source = StringSource { *sink.s };
store->addToStore(info, source);
}
logger->stdout("%s", store->printStorePath(info.path));
}
+7 -7
View File
@@ -110,7 +110,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
auto builder = baseNameOf(drv.builder);
if (builder != "bash")
throw Error("'nix dev-shell' only works on derivations that use 'bash' as their builder");
throw Error("'nix develop' only works on derivations that use 'bash' as their builder");
auto getEnvShPath = store->addTextToStore("get-env.sh", getEnvSh, {});
@@ -233,11 +233,11 @@ struct Common : InstallableCommand, MixProfile
}
};
struct CmdDevShell : Common, MixEnvironment
struct CmdDevelop : Common, MixEnvironment
{
std::vector<std::string> command;
CmdDevShell()
CmdDevelop()
{
addFlag({
.longName = "command",
@@ -261,15 +261,15 @@ struct CmdDevShell : Common, MixEnvironment
return {
Example{
"To get the build environment of GNU hello:",
"nix dev-shell nixpkgs.hello"
"nix develop nixpkgs.hello"
},
Example{
"To store the build environment in a profile:",
"nix dev-shell --profile /tmp/my-shell nixpkgs.hello"
"nix develop --profile /tmp/my-shell nixpkgs.hello"
},
Example{
"To use a build environment previously recorded in a profile:",
"nix dev-shell /tmp/my-shell"
"nix develop /tmp/my-shell"
},
};
}
@@ -343,4 +343,4 @@ struct CmdPrintDevEnv : Common
};
static auto r1 = registerCommand<CmdPrintDevEnv>("print-dev-env");
static auto r2 = registerCommand<CmdDevShell>("dev-shell");
static auto r2 = registerCommand<CmdDevelop>("develop");
+1 -1
View File
@@ -28,4 +28,4 @@ $(eval $(call install-symlink, $(bindir)/nix, $(libexecdir)/nix/build-remote))
src/nix-env/user-env.cc: src/nix-env/buildenv.nix.gen.hh
src/nix/dev-shell.cc: src/nix/get-env.sh.gen.hh
src/nix/develop.cc: src/nix/get-env.sh.gen.hh
+2
View File
@@ -110,6 +110,8 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
.description = "consider all previously downloaded files out-of-date",
.handler = {[&]() { refresh = true; }},
});
deprecatedAliases.insert({"dev-shell", "develop"});
}
void printFlags(std::ostream & out) override