Windows: Fix external detection for service accounts (#37293)
Prior to this PR, the HOMEDRIVE environment variable was used to detect what drive we are operating in. This variable is not available for service account logins (like what is used for CI), so switch to extracting the drive from PROGRAMFILES (which is more-widely defined).
This commit is contained in:
parent
85cc9097cb
commit
ec800cccbb
@ -218,8 +218,10 @@ def update_configuration(detected_packages, scope=None, buildable=True):
|
||||
|
||||
|
||||
def _windows_drive():
|
||||
"""Return Windows drive string"""
|
||||
return os.environ["HOMEDRIVE"]
|
||||
"""Return Windows drive string extracted from PROGRAMFILES
|
||||
env var, which is garunteed to be defined for all logins"""
|
||||
drive = re.match(r"([a-zA-Z]:)", os.environ["PROGRAMFILES"]).group(1)
|
||||
return drive
|
||||
|
||||
|
||||
class WindowsCompilerExternalPaths(object):
|
||||
|
Loading…
Reference in New Issue
Block a user