update filename used for cc wrapper invocation debug log (#5837)
The name of the debug log written by the cc compiler wrapper was given by Spec.short_spec, which includes the architecture. Somewhere along the line Spec.format started adding spaces around the architecture property so the filename started including spaces; the cc wrapper script appears to ignore this, so files like spack-cc-bzip2-....in.log (which record the wrapped compiler invocations) were not being generated. This uses a different format string from the spec to generate the wrapper log file names (which does not include spaces).
This commit is contained in:
		
							
								
								
									
										5
									
								
								lib/spack/env/cc
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								lib/spack/env/cc
									
									
									
									
										vendored
									
									
								
							| @@ -45,6 +45,7 @@ parameters=( | |||||||
|     SPACK_PREFIX |     SPACK_PREFIX | ||||||
|     SPACK_ENV_PATH |     SPACK_ENV_PATH | ||||||
|     SPACK_DEBUG_LOG_DIR |     SPACK_DEBUG_LOG_DIR | ||||||
|  |     SPACK_DEBUG_LOG_ID | ||||||
|     SPACK_COMPILER_SPEC |     SPACK_COMPILER_SPEC | ||||||
|     SPACK_CC_RPATH_ARG |     SPACK_CC_RPATH_ARG | ||||||
|     SPACK_CXX_RPATH_ARG |     SPACK_CXX_RPATH_ARG | ||||||
| @@ -355,8 +356,8 @@ fi | |||||||
| # Write the input and output commands to debug logs if it's asked for. | # Write the input and output commands to debug logs if it's asked for. | ||||||
| # | # | ||||||
| if [[ $SPACK_DEBUG == TRUE ]]; then | if [[ $SPACK_DEBUG == TRUE ]]; then | ||||||
|     input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log" |     input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.in.log" | ||||||
|     output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log" |     output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.out.log" | ||||||
|     echo "[$mode] $command $input_command" >> "$input_log" |     echo "[$mode] $command $input_command" >> "$input_log" | ||||||
|     echo "[$mode] ${full_command[@]}" >> "$output_log" |     echo "[$mode] ${full_command[@]}" >> "$output_log" | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -91,6 +91,7 @@ | |||||||
| SPACK_INSTALL = 'SPACK_INSTALL' | SPACK_INSTALL = 'SPACK_INSTALL' | ||||||
| SPACK_DEBUG = 'SPACK_DEBUG' | SPACK_DEBUG = 'SPACK_DEBUG' | ||||||
| SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC' | SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC' | ||||||
|  | SPACK_DEBUG_LOG_ID = 'SPACK_DEBUG_LOG_ID' | ||||||
| SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR' | SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR' | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -297,6 +298,7 @@ def set_build_environment_variables(pkg, env, dirty): | |||||||
|     if spack.debug: |     if spack.debug: | ||||||
|         env.set(SPACK_DEBUG, 'TRUE') |         env.set(SPACK_DEBUG, 'TRUE') | ||||||
|     env.set(SPACK_SHORT_SPEC, pkg.spec.short_spec) |     env.set(SPACK_SHORT_SPEC, pkg.spec.short_spec) | ||||||
|  |     env.set(SPACK_DEBUG_LOG_ID, pkg.spec.format('${PACKAGE}-${HASH:7}')) | ||||||
|     env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) |     env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) | ||||||
|  |  | ||||||
|     # Add any pkgconfig directories to PKG_CONFIG_PATH |     # Add any pkgconfig directories to PKG_CONFIG_PATH | ||||||
|   | |||||||
| @@ -70,8 +70,10 @@ def setUp(self): | |||||||
|         os.environ['SPACK_PREFIX'] = self.prefix |         os.environ['SPACK_PREFIX'] = self.prefix | ||||||
|         os.environ['SPACK_ENV_PATH'] = "test" |         os.environ['SPACK_ENV_PATH'] = "test" | ||||||
|         os.environ['SPACK_DEBUG_LOG_DIR'] = "." |         os.environ['SPACK_DEBUG_LOG_DIR'] = "." | ||||||
|  |         os.environ['SPACK_DEBUG_LOG_ID'] = "foo-hashabc" | ||||||
|         os.environ['SPACK_COMPILER_SPEC'] = "gcc@4.4.7" |         os.environ['SPACK_COMPILER_SPEC'] = "gcc@4.4.7" | ||||||
|         os.environ['SPACK_SHORT_SPEC'] = "foo@1.2" |         os.environ['SPACK_SHORT_SPEC'] = ( | ||||||
|  |             "foo@1.2 arch=linux-rhel6-x86_64 /hashabc") | ||||||
|  |  | ||||||
|         os.environ['SPACK_CC_RPATH_ARG']  = "-Wl,-rpath," |         os.environ['SPACK_CC_RPATH_ARG']  = "-Wl,-rpath," | ||||||
|         os.environ['SPACK_CXX_RPATH_ARG'] = "-Wl,-rpath," |         os.environ['SPACK_CXX_RPATH_ARG'] = "-Wl,-rpath," | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 scheibelp
					scheibelp