File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ def find_opt(args, name):
6464 return - 1
6565
6666
67+ def remove_opt (args : list [str ], name : str ) -> None :
68+ opt = f'--{ name } '
69+ optstart = f'{ opt } ='
70+ args [:] = [
71+ arg
72+ for arg in args
73+ if arg != opt and not arg .startswith (optstart )
74+ ]
75+
76+
6777def ensure_opt (args , name , value ):
6878 opt = f'--{ name } '
6979 pos = find_opt (args , name )
@@ -128,6 +138,10 @@ def prepare(script=None, outdir=None):
128138 # Run configure.
129139 print (f'configuring python in { builddir } ...' )
130140 config_args = shlex .split (sysconfig .get_config_var ('CONFIG_ARGS' ) or '' )
141+ # Optimisations such as LTO and PGO only slow down the build of this
142+ # throwaway interpreter without affecting what the test checks.
143+ remove_opt (config_args , 'enable-optimizations' )
144+ remove_opt (config_args , 'with-lto' )
131145 cmd = [os .path .join (srcdir , 'configure' ), * config_args ]
132146 ensure_opt (cmd , 'cache-file' , os .path .join (outdir , 'python-config.cache' ))
133147 prefix = os .path .join (outdir , 'python-installation' )
You can’t perform that action at this time.
0 commit comments