@@ -557,7 +557,9 @@ def prepare(args, source, directory, env):
557557 build .mkdir ()
558558 prefix .mkdir ()
559559 provider = args .provider_prefix or directory / 'no-provider'
560- build_env = dict (env , CXX = args .compiler , CC = args .cc , MAKE = args .make , CXXFLAGS = '-O0 -g -DLIBHTTPSERVER_REMAINING_CAPTURE' ,
560+ optimization = '-O3' if host == 'Linux' else '-O0'
561+ build_env = dict (env , CXX = args .compiler , CC = args .cc , MAKE = args .make ,
562+ CXXFLAGS = optimization + ' -g -DLIBHTTPSERVER_REMAINING_CAPTURE' ,
561563 CPPFLAGS = '' , LDFLAGS = '' , PKG_CONFIG_PATH = '' ,
562564 PKG_CONFIG_LIBDIR = os .pathsep .join (args .pkg_config_dir ))
563565 if mode == 'yes' :
@@ -606,14 +608,35 @@ def prepare(args, source, directory, env):
606608 command ([args .make , '-j2' , '-C' , 'test' ] + selected , build , build_env )
607609 if host == 'Darwin' :
608610 # A separate TLS-off static lane preserves the original external-H1 linkage.
609- plain = directory / 'plain-build'
611+ plain , plain_prefix = directory / 'plain-build' , directory / 'plain-prefix '
610612 plain .mkdir ()
613+ plain_prefix .mkdir ()
611614 plain_env = dict (build_env , V3_TLS_CFLAGS = '' , V3_TLS_LIBS = '' , LDFLAGS = '' )
612615 command ([bash , configure , '--disable-v3-tls' , '--disable-shared' , '--enable-static' ,
613- '--disable-examples' ], plain , plain_env )
616+ '--disable-examples' , '--prefix=' + plain_prefix . as_posix () ], plain , plain_env )
614617 command ([args .make , '-j2' , '-C' , 'src' ], plain , plain_env )
615- command ([args .make , '-j2' , '-C' , 'test' , 'external_http1_e2e' ], plain , plain_env )
616- programs = dict (tls_psk = build / 'test/tls_psk' , external_http1_e2e = plain / 'test/external_http1_e2e' )
618+ command ([args .make , '-C' , 'src' , 'install' ], plain , plain_env )
619+ command ([args .make , 'install-pkgconfigDATA' ], plain , plain_env )
620+ plain_runtime = dict (runtime , PKG_CONFIG_PATH = '' , PKG_CONFIG_LIBDIR = os .pathsep .join (
621+ [str (plain_prefix / 'lib/pkgconfig' )] + args .pkg_config_dir ))
622+ cflags = shlex .split (command (['pkg-config' , '--cflags' , 'libhttpserver' ], plain , plain_runtime ).strip ())
623+ libraries = shlex .split (command (['pkg-config' , '--libs' , '--static' , 'libhttpserver' ], plain , plain_runtime ).strip ())
624+ # Select the installed archive explicitly, even if another shared package is on the host.
625+ libraries = [str (plain_prefix / 'lib/libhttpserver.a' ) if item == '-lhttpserver' else item
626+ for item in libraries ]
627+ consumer = directory / 'external-build'
628+ consumer .mkdir ()
629+ executable = consumer / 'external_http1_e2e'
630+ flags = cflags + ['-DHTTPSERVER_COMPILATION' , '-I' + str (source / 'src' ), '-I' + str (source / 'test' )]
631+ for macro , value in (('TLS_TEST_DIR' , source / 'test' ),
632+ ('PARITY_TRANSCRIPT_DIR' , source / 'test/parity/transcripts' ),
633+ ('PARITY_DATA_ROOT' , source / 'test' ), ('HTTP2_CORPUS_DIR' , source / 'test/conformance/http2' )):
634+ flags += ['-D' + macro + '="' + value .as_posix () + '"' ]
635+ units = [source / 'test' / unit for unit in
636+ package_matrix .load ()['suites' ]['external_http1_e2e' ]['sources' ]]
637+ compiles ['external_http1_e2e' ] = compile_probe (args .compiler , units , flags , libraries , executable ,
638+ command , plain_runtime , source , plain , plain_prefix , True )
639+ programs = dict (tls_psk = build / 'test/tls_psk' , external_http1_e2e = executable )
617640 for name in ('config.h' , 'config.log' , 'Makefile' , 'test/Makefile' ):
618641 shutil .copyfile (plain / name , setup / ('plain-' + name .replace ('/' , '-' )))
619642 else :
@@ -637,6 +660,9 @@ def prepare(args, source, directory, env):
637660 artifacts = [build / 'config.h' , build / 'config.log' , build / 'Makefile' , build / 'test/Makefile' ]
638661 artifacts += [path for path in (prefix .rglob ('*' ) if host == 'Windows' else (build / 'src/.libs' ).glob ('*' ))
639662 if path .is_file () and path .suffix .lower () in ('.dll' , '.so' , '.dylib' , '.a' )]
663+ if host == 'Darwin' :
664+ artifacts += [path for path in plain_prefix .rglob ('*' ) if path .is_file ()]
665+ artifacts += [Path (str (programs ['external_http1_e2e' ]) + '.map' )]
640666 if args .toolchain_prefix :
641667 artifacts += [path for path in (args .toolchain_prefix / ('bin' if host == 'Windows' else 'lib/c++' )).glob ('*' )
642668 if path .is_file () and (path .suffix .lower () in ('.dll' , '.dylib' ) and
@@ -726,9 +752,10 @@ def launch(name, case, cap):
726752 argv = [str (programs [name ])]
727753 if name == 'wire_cleanup' :
728754 argv = [sys .executable , str (source / 'test/integ/native_websocket_client.py' ),
729- str (programs [name ]), '--first-wire-cycle-only' ]
730- cwd = (source / 'test' if host == 'Windows' and name != 'consumer' else
731- directory / ('plain-build/test' if name == 'external_http1_e2e' else 'build/test' ) if host != 'Windows' else case )
755+ str (programs [name ]), '--first-wire-cycle-only' ,
756+ '--fixture-stdout-receipt' , str (case / 'fixture-stdout.bin' )]
757+ cwd = (source / 'test' if name == 'external_http1_e2e' or (host == 'Windows' and name != 'consumer' ) else
758+ directory / 'build/test' if host != 'Windows' else case )
732759 # Singles with a 60s original budget keep retirement inside that allowance.
733760 cleanup = min (6 , cap / 5 )
734761 result = run_program (argv , case , runtime , cap = cap , gate = min (target ['gate' ], cap ),
0 commit comments