@@ -65,6 +65,14 @@ pub struct ProjectModel {
6565 /// The target of the project, this may contain
6666 /// platform specific configurations.
6767 pub targets : Option < Targets > ,
68+
69+ /// Names of environment variables that should be exposed as secrets to
70+ /// the build script. Backends forward these into the generated
71+ /// `build.script.secrets` so rattler-build performs the host-env
72+ /// passthrough at build time. Stored as a set: order is not observable
73+ /// and changing it should not invalidate caches.
74+ #[ serde( default , skip_serializing_if = "std::collections::BTreeSet::is_empty" ) ]
75+ pub secrets : std:: collections:: BTreeSet < String > ,
6876}
6977
7078impl IsDefault for ProjectModel {
@@ -550,6 +558,7 @@ impl Hash for ProjectModel {
550558 repository,
551559 documentation,
552560 targets,
561+ secrets,
553562 } = self ;
554563
555564 StableHashBuilder :: < H > :: new ( )
@@ -564,6 +573,7 @@ impl Hash for ProjectModel {
564573 . field ( "name" , name)
565574 . field ( "readme" , readme)
566575 . field ( "repository" , repository)
576+ . field ( "secrets" , secrets)
567577 . field ( "targets" , targets)
568578 . field ( "version" , version)
569579 . finish ( state) ;
@@ -871,6 +881,7 @@ mod tests {
871881 repository : None ,
872882 documentation : None ,
873883 targets : None ,
884+ secrets : std:: collections:: BTreeSet :: new ( ) ,
874885 } ;
875886
876887 let hash1 = calculate_hash ( & project_model) ;
@@ -930,6 +941,7 @@ mod tests {
930941 repository : None ,
931942 documentation : None ,
932943 targets : None ,
944+ secrets : std:: collections:: BTreeSet :: new ( ) ,
933945 } ;
934946
935947 let hash1 = calculate_hash ( & project_model) ;
0 commit comments