| From a54baf53d934a3c95bcc42bdbeaefca3cc12aab7 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Wed, 20 Jul 2022 14:45:45 +0100 |
| Subject: [PATCH 01/11] Make --expr always include nixpkgs |
| |
| --- |
| src/libcmd/installables.cc | 7 +++++-- |
| 1 file changed, 5 insertions(+), 2 deletions(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index 60d6e9dc08c..e065f655452 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -788,8 +788,11 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| else if (file) |
| state->evalFile(lookupFileArg(*state, *file), *vFile); |
| else { |
| - auto e = state->parseExprFromString(*expr, absPath(".")); |
| - state->eval(e, *vFile); |
| + Strings e = {}; |
| + e.push_back("with (builtins.getFlake \"nixpkgs\")"); |
| + e.push_back(*expr); |
| + auto parsed = state->parseExprFromString(concatStringsSep(";", e), absPath(".")); |
| + state->eval(parsed, *vFile); |
| } |
| |
| for (auto & s : ss) { |
| |
| From 8e2457a62ab209e1f111ab71aeaa694ad35fd0fd Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Wed, 20 Jul 2022 14:46:17 +0100 |
| Subject: [PATCH 02/11] Stop --expr requiring --impure flag |
| |
| --- |
| src/libcmd/installables.cc | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index e065f655452..fc83d6e35b8 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -776,7 +776,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| throw UsageError("'--file' and '--expr' are exclusive"); |
| |
| // FIXME: backward compatibility hack |
| - if (file) evalSettings.pureEval = false; |
| + evalSettings.pureEval = false; |
| |
| auto state = getEvalState(); |
| auto vFile = state->allocValue(); |
| |
| From c2f7a39313ab34dc208fddc0a2467e7739bc3754 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Wed, 20 Jul 2022 23:51:16 +0100 |
| Subject: [PATCH 03/11] Make nix shell take installables as context |
| |
| --- |
| src/libcmd/installables.cc | 46 +++++++++++++++++++++++++++++++++++++- |
| 1 file changed, 45 insertions(+), 1 deletion(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index fc83d6e35b8..477aa8cc760 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -789,10 +789,54 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| state->evalFile(lookupFileArg(*state, *file), *vFile); |
| else { |
| Strings e = {}; |
| - e.push_back("with (builtins.getFlake \"nixpkgs\")"); |
| + |
| + for (auto & s : ss) { |
| + std::exception_ptr ex; |
| + |
| + if (s.find('/') != std::string::npos) { |
| + try { |
| + result.push_back(std::make_shared<InstallableStorePath>(store, store->followLinksToStorePath(s))); |
| + continue; |
| + } catch (BadStorePath &) { |
| + } catch (...) { |
| + if (!ex) |
| + ex = std::current_exception(); |
| + } |
| + } |
| + |
| + try { |
| + auto [flakeRef, fragment, outputsSpec] = parseFlakeRefWithFragmentAndOutputsSpec(s, absPath(".")); |
| +/* result.push_back(std::make_shared<InstallableFlake>( |
| + this, |
| + getEvalState(), |
| + std::move(flakeRef), |
| + fragment, |
| + outputsSpec, |
| + getDefaultFlakeAttrPaths(), |
| + getDefaultFlakeAttrPathPrefixes(), |
| + lockFlags));*/ |
| + e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\")" + (fragment != "" ? "." + fragment : "")); |
| + e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\").packages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| + e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\").legacyPackages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| + continue; |
| + } catch (...) { |
| + ex = std::current_exception(); |
| + } |
| + |
| + std::rethrow_exception(ex); |
| + } |
| + |
| e.push_back(*expr); |
| auto parsed = state->parseExprFromString(concatStringsSep(";", e), absPath(".")); |
| state->eval(parsed, *vFile); |
| + |
| + auto [prefix, outputsSpec] = parseOutputsSpec("."); |
| + result.push_back( |
| + std::make_shared<InstallableAttrPath>( |
| + state, *this, vFile, |
| + prefix == "." ? "" : prefix, |
| + outputsSpec)); |
| + return result; |
| } |
| |
| for (auto & s : ss) { |
| |
| From 2aaef9cd16698dd4c574c0c0fe6bc03394ef2296 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Wed, 20 Jul 2022 23:56:09 +0100 |
| Subject: [PATCH 04/11] Update documentation to match nix shell change |
| |
| --- |
| src/nix/nix.md | 9 +++++++-- |
| 1 file changed, 7 insertions(+), 2 deletions(-) |
| |
| diff --git a/src/nix/nix.md b/src/nix/nix.md |
| index db60c59ffaf..3491b38af23 100644 |
| --- a/src/nix/nix.md |
| +++ b/src/nix/nix.md |
| @@ -138,8 +138,13 @@ the Nix store. Here are the recognised types of installables: |
| * **Nix expressions**: `--expr '(import <nixpkgs> {}).hello.overrideDerivation (prev: { name = "my-hello"; })'`. |
| |
| When the `--expr` option is given, all installables are interpreted |
| - as Nix expressions. You may need to specify `--impure` if the |
| - expression references impure inputs (such as `<nixpkgs>`). |
| + as context for the expression. For example, the following is valid: |
| + |
| + ```console |
| + # nix shell nixpkgs#python3 --expr 'withPackages(pyPkgs: with pyPkgs; [ numpy ])' |
| + ``` |
| + |
| + Using `--expr` implies `--impure`. |
| |
| For most commands, if no installable is specified, the default is `.`, |
| i.e. Nix will operate on the default flake output attribute of the |
| |
| From 340051b4f71957bc93ec7ac6511657c4de6dc0ce Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Thu, 21 Jul 2022 21:49:44 +0100 |
| Subject: [PATCH 05/11] Only build . with expr if it'd be a default installable |
| |
| --- |
| src/libcmd/installables.cc | 16 +++++++++------- |
| 1 file changed, 9 insertions(+), 7 deletions(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index 477aa8cc760..e82103422bf 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -830,13 +830,15 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| auto parsed = state->parseExprFromString(concatStringsSep(";", e), absPath(".")); |
| state->eval(parsed, *vFile); |
| |
| - auto [prefix, outputsSpec] = parseOutputsSpec("."); |
| - result.push_back( |
| - std::make_shared<InstallableAttrPath>( |
| - state, *this, vFile, |
| - prefix == "." ? "" : prefix, |
| - outputsSpec)); |
| - return result; |
| + if (!ss.empty()) { |
| + auto [prefix, outputsSpec] = parseOutputsSpec("."); |
| + result.push_back( |
| + std::make_shared<InstallableAttrPath>( |
| + state, *this, vFile, |
| + prefix == "." ? "" : prefix, |
| + outputsSpec)); |
| + return result; |
| + } |
| } |
| |
| for (auto & s : ss) { |
| |
| From 01426c7c8d76b57fd342d7e2ce4390c9dba92c27 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Fri, 22 Jul 2022 14:28:31 +0100 |
| Subject: [PATCH 06/11] Do not include implicit installables with expr |
| |
| --- |
| src/libcmd/command.hh | 2 +- |
| src/libcmd/installables.cc | 9 +++++---- |
| 2 files changed, 6 insertions(+), 5 deletions(-) |
| |
| diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh |
| index 3b4b40981de..ba6ab4197ad 100644 |
| --- a/src/libcmd/command.hh |
| +++ b/src/libcmd/command.hh |
| @@ -102,7 +102,7 @@ struct SourceExprCommand : virtual Args, MixFlakeOptions |
| SourceExprCommand(bool supportReadOnlyMode = false); |
| |
| std::vector<std::shared_ptr<Installable>> parseInstallables( |
| - ref<Store> store, std::vector<std::string> ss); |
| + ref<Store> store, std::vector<std::string> ss, std::optional<std::vector<std::string>> explicitInstallables); |
| |
| std::shared_ptr<Installable> parseInstallable( |
| ref<Store> store, const std::string & installable); |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index e82103422bf..5c11c976299 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -763,7 +763,7 @@ FlakeRef InstallableFlake::nixpkgsFlakeRef() const |
| } |
| |
| std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| - ref<Store> store, std::vector<std::string> ss) |
| + ref<Store> store, std::vector<std::string> ss, std::optional<std::vector<std::string>> explicitInstallables = std::nullopt) |
| { |
| std::vector<std::shared_ptr<Installable>> result; |
| |
| @@ -790,7 +790,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| else { |
| Strings e = {}; |
| |
| - for (auto & s : ss) { |
| + for (auto & s : explicitInstallables.value_or(ss)) { |
| std::exception_ptr ex; |
| |
| if (s.find('/') != std::string::npos) { |
| @@ -837,8 +837,8 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| state, *this, vFile, |
| prefix == "." ? "" : prefix, |
| outputsSpec)); |
| - return result; |
| } |
| + return result; |
| } |
| |
| for (auto & s : ss) { |
| @@ -1132,11 +1132,12 @@ void InstallablesCommand::prepare() |
| |
| Installables InstallablesCommand::load() { |
| Installables installables; |
| + auto explicitInstallables = _installables; |
| if (_installables.empty() && useDefaultInstallables()) |
| // FIXME: commands like "nix profile install" should not have a |
| // default, probably. |
| _installables.push_back("."); |
| - return parseInstallables(getStore(), _installables); |
| + return parseInstallables(getStore(), _installables, explicitInstallables); |
| } |
| |
| std::vector<std::string> InstallablesCommand::getFlakesForCompletion() |
| |
| From 82904ee72f245f4b901f8f9b94c4e9caff2b53be Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Fri, 22 Jul 2022 20:13:48 +0100 |
| Subject: [PATCH 07/11] Allow running --expr purely again |
| |
| --- |
| src/libcmd/installables.cc | 15 ++++++++------- |
| src/nix/nix.md | 2 -- |
| 2 files changed, 8 insertions(+), 9 deletions(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index 5c11c976299..e54d4107353 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -776,7 +776,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| throw UsageError("'--file' and '--expr' are exclusive"); |
| |
| // FIXME: backward compatibility hack |
| - evalSettings.pureEval = false; |
| + if (file) evalSettings.pureEval = false; |
| |
| auto state = getEvalState(); |
| auto vFile = state->allocValue(); |
| @@ -790,7 +790,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| else { |
| Strings e = {}; |
| |
| - for (auto & s : explicitInstallables.value_or(ss)) { |
| + for (auto & s : explicitInstallables.value_or(std::vector<std::string>())) { |
| std::exception_ptr ex; |
| |
| if (s.find('/') != std::string::npos) { |
| @@ -806,7 +806,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| |
| try { |
| auto [flakeRef, fragment, outputsSpec] = parseFlakeRefWithFragmentAndOutputsSpec(s, absPath(".")); |
| -/* result.push_back(std::make_shared<InstallableFlake>( |
| + auto installableFlake = InstallableFlake( |
| this, |
| getEvalState(), |
| std::move(flakeRef), |
| @@ -814,10 +814,11 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| outputsSpec, |
| getDefaultFlakeAttrPaths(), |
| getDefaultFlakeAttrPathPrefixes(), |
| - lockFlags));*/ |
| - e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\")" + (fragment != "" ? "." + fragment : "")); |
| - e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\").packages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| - e.push_back("with (builtins.getFlake \"" + flakeRef.to_string() + "\").legacyPackages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| + lockFlags); |
| + auto lockedFlake = installableFlake.getLockedFlake()->flake.lockedRef; |
| + e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\")" + (fragment != "" ? "." + fragment : "")); |
| + e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\").packages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| + e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\").legacyPackages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| continue; |
| } catch (...) { |
| ex = std::current_exception(); |
| diff --git a/src/nix/nix.md b/src/nix/nix.md |
| index 3491b38af23..2fdaf258643 100644 |
| --- a/src/nix/nix.md |
| +++ b/src/nix/nix.md |
| @@ -144,8 +144,6 @@ the Nix store. Here are the recognised types of installables: |
| # nix shell nixpkgs#python3 --expr 'withPackages(pyPkgs: with pyPkgs; [ numpy ])' |
| ``` |
| |
| - Using `--expr` implies `--impure`. |
| - |
| For most commands, if no installable is specified, the default is `.`, |
| i.e. Nix will operate on the default flake output attribute of the |
| flake in the current directory. |
| |
| From 60aeb420787c6276e26df6c73bd33d2a870590ef Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Sat, 23 Jul 2022 11:46:07 +0100 |
| Subject: [PATCH 08/11] Fix builtins.currentSystem in pure evaluation |
| |
| --- |
| src/libcmd/installables.cc | 15 ++++++++++++--- |
| 1 file changed, 12 insertions(+), 3 deletions(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index e54d4107353..95a31dba289 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -816,9 +816,18 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| getDefaultFlakeAttrPathPrefixes(), |
| lockFlags); |
| auto lockedFlake = installableFlake.getLockedFlake()->flake.lockedRef; |
| - e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\")" + (fragment != "" ? "." + fragment : "")); |
| - e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\").packages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| - e.push_back("with (builtins.getFlake \"" + lockedFlake.to_string() + "\").legacyPackages.\"${builtins.currentSystem}\"" + (fragment != "" ? "." + fragment : "")); |
| + |
| + auto defaultPathPrefixes = getDefaultFlakeAttrPathPrefixes(); |
| + defaultPathPrefixes.push_back(""); |
| + |
| + for (auto & path : defaultPathPrefixes) { |
| + if (path.length()) { |
| + path.pop_back(); |
| + path = "." + path; |
| + } |
| + |
| + e.push_back(str(boost::format("with (builtins.getFlake \"%1%\")%2%%3%") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| + } |
| continue; |
| } catch (...) { |
| ex = std::current_exception(); |
| |
| From ed9400560c79657b9d7a2e2952fb4effc6453928 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Sun, 24 Jul 2022 01:30:00 +0100 |
| Subject: [PATCH 09/11] Gracefully handle missing attributes |
| |
| --- |
| src/libcmd/installables.cc | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index 95a31dba289..419fc90c96a 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -826,7 +826,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| path = "." + path; |
| } |
| |
| - e.push_back(str(boost::format("with (builtins.getFlake \"%1%\")%2%%3%") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| + e.push_back(str(boost::format("with (builtins.getFlake \"%1%\")%2%%3% or {}") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| } |
| continue; |
| } catch (...) { |
| |
| From 3fba464fe76656d54136ab757fc7ede579254a4e Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Sun, 24 Jul 2022 07:11:37 +0100 |
| Subject: [PATCH 10/11] Fix including a flake without any attrpath |
| |
| --- |
| src/libcmd/installables.cc | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index 419fc90c96a..bad324b424c 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -826,7 +826,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| path = "." + path; |
| } |
| |
| - e.push_back(str(boost::format("with (builtins.getFlake \"%1%\")%2%%3% or {}") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| + e.push_back(str(boost::format("with (builtins.getFlake \"%1%\").outputs%2%%3% or {}") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| } |
| continue; |
| } catch (...) { |
| |
| From 8ad1e705394a304db09935c207a964de33c02c08 Mon Sep 17 00:00:00 2001 |
| From: Skyler Grey <skyler3665@gmail.com> |
| Date: Fri, 24 Feb 2023 01:09:56 +0000 |
| Subject: [PATCH 11/11] Fix regressions in the patch due to nix changes |
| |
| --- |
| src/libcmd/installables.cc | 48 +++++++++++++++++++++++++++++++++----- |
| 1 file changed, 42 insertions(+), 6 deletions(-) |
| |
| diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc |
| index bad324b424c..57c2492c106 100644 |
| --- a/src/libcmd/installables.cc |
| +++ b/src/libcmd/installables.cc |
| @@ -791,11 +791,47 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| Strings e = {}; |
| |
| for (auto & s : explicitInstallables.value_or(std::vector<std::string>())) { |
| + |
| + auto [prefix_, extendedOutputsSpec_] = ExtendedOutputsSpec::parse(s); |
| + // To avoid clang's pedantry |
| + auto prefix = std::move(prefix_); |
| + auto extendedOutputsSpec = std::move(extendedOutputsSpec_); |
| std::exception_ptr ex; |
| |
| - if (s.find('/') != std::string::npos) { |
| + if (prefix.find('/') != std::string::npos) { |
| try { |
| - result.push_back(std::make_shared<InstallableStorePath>(store, store->followLinksToStorePath(s))); |
| + auto derivedPath = std::visit(overloaded { |
| + // If the user did not use ^, we treat the output more liberally. |
| + [&](const ExtendedOutputsSpec::Default &) -> DerivedPath { |
| + // First, we accept a symlink chain or an actual store path. |
| + auto storePath = store->followLinksToStorePath(prefix); |
| + // Second, we see if the store path ends in `.drv` to decide what sort |
| + // of derived path they want. |
| + // |
| + // This handling predates the `^` syntax. The `^*` in |
| + // `/nix/store/hash-foo.drv^*` unambiguously means "do the |
| + // `DerivedPath::Built` case", so plain `/nix/store/hash-foo.drv` could |
| + // also unambiguously mean "do the DerivedPath::Opaque` case". |
| + // |
| + // Issue #7261 tracks reconsidering this `.drv` dispatching. |
| + return storePath.isDerivation() |
| + ? (DerivedPath) DerivedPath::Built { |
| + .drvPath = std::move(storePath), |
| + .outputs = OutputsSpec::All {}, |
| + } |
| + : (DerivedPath) DerivedPath::Opaque { |
| + .path = std::move(storePath), |
| + }; |
| + }, |
| + // If the user did use ^, we just do exactly what is written. |
| + [&](const ExtendedOutputsSpec::Explicit & outputSpec) -> DerivedPath { |
| + return DerivedPath::Built { |
| + .drvPath = store->parseStorePath(prefix), |
| + .outputs = outputSpec, |
| + }; |
| + }, |
| + }, extendedOutputsSpec.raw()); |
| + result.push_back(std::make_shared<InstallableStorePath>(store, std::move(derivedPath))); |
| continue; |
| } catch (BadStorePath &) { |
| } catch (...) { |
| @@ -805,7 +841,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| } |
| |
| try { |
| - auto [flakeRef, fragment, outputsSpec] = parseFlakeRefWithFragmentAndOutputsSpec(s, absPath(".")); |
| + auto [flakeRef, fragment, outputsSpec] = parseFlakeRefWithFragmentAndExtendedOutputsSpec(s, absPath(".")); |
| auto installableFlake = InstallableFlake( |
| this, |
| getEvalState(), |
| @@ -826,7 +862,7 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| path = "." + path; |
| } |
| |
| - e.push_back(str(boost::format("with (builtins.getFlake \"%1%\").outputs%2%%3% or {}") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| + e.push_back(boost::str(boost::format("with (builtins.getFlake \"%1%\").outputs%2%%3% or {}") % lockedFlake.to_string() % path % (fragment != "" ? "." + fragment : ""))); |
| } |
| continue; |
| } catch (...) { |
| @@ -841,11 +877,11 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( |
| state->eval(parsed, *vFile); |
| |
| if (!ss.empty()) { |
| - auto [prefix, outputsSpec] = parseOutputsSpec("."); |
| + auto [prefix, outputsSpec] = ExtendedOutputsSpec::parse("."); |
| result.push_back( |
| std::make_shared<InstallableAttrPath>( |
| state, *this, vFile, |
| - prefix == "." ? "" : prefix, |
| + prefix == "." ? "" : std::string { prefix }, |
| outputsSpec)); |
| } |
| return result; |