@@ -378,15 +378,15 @@ DerivationOptions<SingleDerivedPath> derivationOptionsFromStructuredAttrs(
378378 getStringSetAttr (env, parsed, " requiredSystemFeatures" ).value_or (defaults.requiredSystemFeatures ),
379379 .preferLocalBuild = getBoolAttr (env, parsed, " preferLocalBuild" , defaults.preferLocalBuild ),
380380 .allowSubstitutes = getBoolAttr (env, parsed, " allowSubstitutes" , defaults.allowSubstitutes ),
381- .meta = [&]() -> std::optional<nlohmann::json> {
381+ .meta = [&]() -> std::optional<nlohmann::json:: object_t > {
382382 if (!parsed)
383383 return std::nullopt ;
384384
385385 auto & structuredAttrs = parsed->structuredAttrs ;
386386
387387 // Only extract __meta if derivation-meta feature is used
388388 if (hasDerivationMetaFeature (structuredAttrs)) {
389- return structuredAttrs.at (" __meta" );
389+ return getObject ( structuredAttrs.at (" __meta" ) );
390390 }
391391 return std::nullopt ;
392392 }(),
@@ -628,12 +628,7 @@ DerivationOptions<SingleDerivedPath> adl_serializer<DerivationOptions<SingleDeri
628628 .requiredSystemFeatures = getStringSet (valueAt (json, " requiredSystemFeatures" )),
629629 .preferLocalBuild = getBoolean (valueAt (json, " preferLocalBuild" )),
630630 .allowSubstitutes = getBoolean (valueAt (json, " allowSubstitutes" )),
631- .meta = [&]() -> std::optional<nlohmann::json> {
632- if (auto * metaPtr = optionalValueAt (json, " meta" ))
633- if (auto * nonNullMeta = getNullable (*metaPtr))
634- return *nonNullMeta;
635- return std::nullopt ;
636- }(),
631+ .meta = valueAt (json, " meta" ).get <std::optional<nlohmann::json::object_t >>(),
637632 };
638633}
639634
@@ -668,10 +663,7 @@ void adl_serializer<DerivationOptions<SingleDerivedPath>>::to_json(
668663 json[" requiredSystemFeatures" ] = o.requiredSystemFeatures ;
669664 json[" preferLocalBuild" ] = o.preferLocalBuild ;
670665 json[" allowSubstitutes" ] = o.allowSubstitutes ;
671- if (o.meta )
672- json[" meta" ] = *o.meta ;
673- else
674- json[" meta" ] = nullptr ;
666+ json[" meta" ] = o.meta ;
675667}
676668
677669OutputChecks<SingleDerivedPath> adl_serializer<OutputChecks<SingleDerivedPath>>::from_json(const json & json_)
0 commit comments