Fix path handling in prefix inspections (#35318)
At least with ZSH, prefix inspections containing `./bin` result in a `$PREFIX/./bin` and result in strange `$PATH` handling. I.e., `module load git` will prepend `/path/to/git/./bin`, `which git` will find the right executable, but `git --version` will print the system one. Normalize the relative path to avoid this behavior. See also spack/spack#31867.
This commit is contained in:
		@@ -912,7 +912,7 @@ def inspect_path(root, inspections, exclude=None):
 | 
			
		||||
    env = EnvironmentModifications()
 | 
			
		||||
    # Inspect the prefix to check for the existence of common directories
 | 
			
		||||
    for relative_path, variables in inspections.items():
 | 
			
		||||
        expected = os.path.join(root, relative_path)
 | 
			
		||||
        expected = os.path.join(root, os.path.normpath(relative_path))
 | 
			
		||||
 | 
			
		||||
        if os.path.isdir(expected) and not exclude(expected):
 | 
			
		||||
            for variable in variables:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user