add logging to help users debug where external file searches are taking a long time (#35900)
This commit is contained in:
		| @@ -485,7 +485,13 @@ def update_compiler_args_for_dep(dep): | ||||
|             query = pkg.spec[dep.name] | ||||
|             dep_link_dirs = list() | ||||
|             try: | ||||
|                 # In some circumstances (particularly for externals) finding | ||||
|                 # libraries packages can be time consuming, so indicate that | ||||
|                 # we are performing this operation (and also report when it | ||||
|                 # finishes). | ||||
|                 tty.debug("Collecting libraries for {0}".format(dep.name)) | ||||
|                 dep_link_dirs.extend(query.libs.directories) | ||||
|                 tty.debug("Libraries for {0} have been collected.".format(dep.name)) | ||||
|             except NoLibrariesError: | ||||
|                 tty.debug("No libraries found for {0}".format(dep.name)) | ||||
| 
 | ||||
| @@ -772,7 +778,9 @@ def setup_package(pkg, dirty, context="build"): | ||||
|         set_compiler_environment_variables(pkg, env_mods) | ||||
|         set_wrapper_variables(pkg, env_mods) | ||||
| 
 | ||||
|     tty.debug("setup_package: grabbing modifications from dependencies") | ||||
|     env_mods.extend(modifications_from_dependencies(pkg.spec, context, custom_mods_only=False)) | ||||
|     tty.debug("setup_package: collected all modifications from dependencies") | ||||
| 
 | ||||
|     # architecture specific setup | ||||
|     platform = spack.platforms.by_name(pkg.spec.architecture.platform) | ||||
| @@ -780,6 +788,7 @@ def setup_package(pkg, dirty, context="build"): | ||||
|     platform.setup_platform_environment(pkg, env_mods) | ||||
| 
 | ||||
|     if context == "build": | ||||
|         tty.debug("setup_package: setup build environment for root") | ||||
|         builder = spack.builder.create(pkg) | ||||
|         builder.setup_build_environment(env_mods) | ||||
| 
 | ||||
| @@ -790,6 +799,7 @@ def setup_package(pkg, dirty, context="build"): | ||||
|                 " includes and omit it when invoked with '--cflags'." | ||||
|             ) | ||||
|     elif context == "test": | ||||
|         tty.debug("setup_package: setup test environment for root") | ||||
|         env_mods.extend( | ||||
|             inspect_path( | ||||
|                 pkg.spec.prefix, | ||||
| @@ -806,6 +816,7 @@ def setup_package(pkg, dirty, context="build"): | ||||
|     # Load modules on an already clean environment, just before applying Spack's | ||||
|     # own environment modifications. This ensures Spack controls CC/CXX/... variables. | ||||
|     if need_compiler: | ||||
|         tty.debug("setup_package: loading compiler modules") | ||||
|         for mod in pkg.compiler.modules: | ||||
|             load_module(mod) | ||||
| 
 | ||||
| @@ -943,6 +954,7 @@ def default_modifications_for_dep(dep): | ||||
|             _make_runnable(dep, env) | ||||
| 
 | ||||
|     def add_modifications_for_dep(dep): | ||||
|         tty.debug("Adding env modifications for {0}".format(dep.name)) | ||||
|         # Some callers of this function only want the custom modifications. | ||||
|         # For callers that want both custom and default modifications, we want | ||||
|         # to perform the default modifications here (this groups custom | ||||
| @@ -968,6 +980,7 @@ def add_modifications_for_dep(dep): | ||||
|                 builder.setup_dependent_build_environment(env, spec) | ||||
|             else: | ||||
|                 dpkg.setup_dependent_run_environment(env, spec) | ||||
|         tty.debug("Added env modifications for {0}".format(dep.name)) | ||||
| 
 | ||||
|     # Note that we want to perform environment modifications in a fixed order. | ||||
|     # The Spec.traverse method provides this: i.e. in addition to | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Peter Scheibel
					Peter Scheibel