@@ -114,6 +114,14 @@ int main(int argc, char** argv) {
114
114
app.add_flag (" --interpolate-undefined" , stack_options.interpolate_undefined ,
115
115
" Interpolate undefined variables with empty strings" );
116
116
117
+ // The --strict flag here is useful for all our smoketests, since this is the
118
+ // combination of flags we use for maximum reproducibility / isolation.
119
+ // Note: This option also affects / overwrites options for the run subcommand!
120
+ app.add_flag (" -t,--strict" , stack_options.strict_mode ,
121
+ " Forces flags: --no-system-plugins --no-system-confs --require-success" );
122
+ app.add_flag (" -s,--secure" , stack_options.secure_mode ,
123
+ " Forces flags: --strict --no-hooks --no-interpolate" );
124
+
117
125
// ----------------------------------------------------------------------- //
118
126
119
127
CLI11_PARSE (app, argc, argv);
@@ -131,7 +139,17 @@ int main(int argc, char** argv) {
131
139
cloe::logger::set_level (level);
132
140
}
133
141
134
- // Setup stack and provide launch command.
142
+ // Setup stack, applying strict/secure mode if necessary, and provide launch command.
143
+ if (stack_options.secure_mode ) {
144
+ stack_options.strict_mode = true ;
145
+ stack_options.no_hooks = true ;
146
+ stack_options.interpolate_vars = false ;
147
+ }
148
+ if (stack_options.strict_mode ) {
149
+ stack_options.no_system_plugins = true ;
150
+ stack_options.no_system_confs = true ;
151
+ run_options.require_success = true ;
152
+ }
135
153
stack_options.environment ->prefer_external (false );
136
154
stack_options.environment ->allow_undefined (stack_options.interpolate_undefined );
137
155
stack_options.environment ->insert (CLOE_SIMULATION_UUID_VAR, " ${" CLOE_SIMULATION_UUID_VAR " }" );
0 commit comments