@@ -800,6 +800,12 @@ def create_with_config(self, config: models.TaskConfig) -> models.Task:
800
800
801
801
return self ._req_model ("POST" , models .Task , data = config )
802
802
803
+ def trim_options (self , options : Optional [List [str ]]) -> Optional [List [str ]]:
804
+ # Trim any surrounding whitespace to allow users to quote multiple options with extra
805
+ # whitespace as a workaround for CLI argument parsing limitations. Trimming is needed
806
+ # to ensure that the binary eventually parses the arguments as options.
807
+ return [o .strip () for o in options ] if options else None
808
+
803
809
def create (
804
810
self ,
805
811
job_id : UUID_EXPANSION ,
@@ -886,7 +892,7 @@ def create(
886
892
task = models .TaskDetails (
887
893
analyzer_env = analyzer_env ,
888
894
analyzer_exe = analyzer_exe ,
889
- analyzer_options = analyzer_options ,
895
+ analyzer_options = self . trim_options ( analyzer_options ) ,
890
896
check_asan_log = check_asan_log ,
891
897
check_debugger = check_debugger ,
892
898
check_retry_count = check_retry_count ,
@@ -895,18 +901,18 @@ def create(
895
901
duration = duration ,
896
902
ensemble_sync_delay = ensemble_sync_delay ,
897
903
generator_exe = generator_exe ,
898
- generator_options = generator_options ,
904
+ generator_options = self . trim_options ( generator_options ) ,
899
905
reboot_after_setup = reboot_after_setup ,
900
906
rename_output = rename_output ,
901
907
stats_file = stats_file ,
902
908
stats_format = stats_format ,
903
909
supervisor_env = supervisor_env ,
904
910
supervisor_exe = supervisor_exe ,
905
911
supervisor_input_marker = supervisor_input_marker ,
906
- supervisor_options = supervisor_options ,
912
+ supervisor_options = self . trim_options ( supervisor_options ) ,
907
913
target_env = target_env ,
908
914
target_exe = target_exe ,
909
- target_options = target_options ,
915
+ target_options = self . trim_options ( target_options ) ,
910
916
target_options_merge = target_options_merge ,
911
917
target_timeout = target_timeout ,
912
918
target_workers = target_workers ,
0 commit comments