nix-super/src/libexpr
John Ericson 44c8d83831 Create outputOf primop.
In the Nix language, given a drv path, we should be able to construct
another string referencing to one of its output. We can do this today
with `(import drvPath).output`, but this only works for derivations we
already have.

With dynamic derivations, however, that doesn't work well because the
`drvPath` isn't yet built: importing it like would need to trigger IFD,
when the whole point of this feature is to do "dynamic build graph"
without IFD!

Instead, what we want to do is create a placeholder value with the right
string context to refer to the output of the as-yet unbuilt derivation.
A new primop in the language, analogous to `builtins.placeholder` can be
used to create one. This will achieve all the right properties. The
placeholder machinery also will match out the `outPath` attribute for CA
derivations works.

In 60b7121d2c we added that type of
placeholder, and the derived path and string holder changes necessary to
support it. Then in the previous commit we cleaned up the code
(inspiration finally hit me!) to deduplicate the code and expose exactly
what we need. Now, we can wire up the primop trivally!

Part of RFC 92: dynamic derivations (tracking issue #6316)

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-08-14 09:37:37 -04:00
..
flake Merge pull request #8769 from edolstra/generalize-tarball-urls 2023-08-07 17:02:17 +02:00
primops Make the Derived Path family of types inductive for dynamic derivations 2023-08-10 00:08:32 -04:00
tests Rework evaluator SingleDerivedPath infra 2023-08-14 08:44:50 -04:00
value Make the Derived Path family of types inductive for dynamic derivations 2023-08-10 00:08:32 -04:00
attr-path.cc Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
attr-path.hh Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
attr-set.cc Don't pass Symbol by reference 2022-04-26 13:25:17 +02:00
attr-set.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval-cache.cc Make the Derived Path family of types inductive for dynamic derivations 2023-08-10 00:08:32 -04:00
eval-cache.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval-inline.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval-settings.cc Factor out nix-defexpr path computation 2023-08-02 12:54:48 -04:00
eval-settings.hh Factor out nix-defexpr path computation 2023-08-02 12:54:48 -04:00
eval.cc Rework evaluator SingleDerivedPath infra 2023-08-14 08:44:50 -04:00
eval.hh Rework evaluator SingleDerivedPath infra 2023-08-14 08:44:50 -04:00
fetchurl.nix fetchurl.nix: change other use of __impure 2022-09-16 01:54:24 -07:00
function-trace.cc Revert the enum struct change 2020-06-18 22:11:26 +00:00
function-trace.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
get-drvs.cc Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
get-drvs.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
imported-drv-to-derivation.nix Move some corepkgs into the nix binary 2020-03-11 16:57:48 +01:00
json-to-value.cc return string_views from forceString* 2022-01-27 17:15:43 +01:00
json-to-value.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
lexer.l libexpr: use thread_local to make the parser thread-safe 2023-07-03 16:05:43 +08:00
local.mk Enable -Werror=switch-enum 2023-04-03 18:45:20 +02:00
nix-expr.pc.in Fix building with GCC 9 2023-02-10 18:38:57 +01:00
nixexpr.cc Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
nixexpr.hh Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
parser.y Move evaluator settings (type and global) to separate file/header 2023-07-31 10:14:15 -04:00
paths.cc Backport SourcePath from the lazy-trees branch 2023-04-06 13:15:50 +02:00
primops.cc Create outputOf primop. 2023-08-14 09:37:37 -04:00
primops.hh Automatically document builtin constants 2023-06-27 09:37:54 -04:00
print.cc libexpr: quote reserved keys when printing 2023-05-09 09:45:12 -05:00
print.hh libexpr: quote reserved keys when printing 2023-05-09 09:45:12 -05:00
search-path.cc Clean up SearchPath 2023-07-09 23:22:22 -04:00
search-path.hh Clean up SearchPath 2023-07-09 23:22:22 -04:00
symbol-table.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
value-to-json.cc toJSON: Add attribute path to trace 2023-07-31 13:02:54 +02:00
value-to-json.hh Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
value-to-xml.cc Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
value-to-xml.hh Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
value.hh Merge pull request #8566 from inclyc/nixd/value-print-depth 2023-07-01 20:08:52 +02:00