Skip to content

Commit

Permalink
[RXP] Improve VS configure handling as well as provide a solution for…
Browse files Browse the repository at this point in the history
… the disabled 8.3 issue for the user
  • Loading branch information
mattatobin committed Apr 4, 2024
1 parent d36e17e commit 1ee036e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
20 changes: 4 additions & 16 deletions build/moz.configure/toolchain.configure
Expand Up @@ -402,22 +402,10 @@ def get_vc_paths(topsrcdir):
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, 'replace'))

# Can't pass -requires with -legacy, so query each separately.
# Legacy versions first (VS2015)
for install in vswhere(['-legacy', '-version', '[14.0,15.0)']):
version = Version(install['installationVersion'])
# Skip anything older than VS2015.
if version < '14':
continue
path = install['installationPath']

yield (Version(install['installationVersion']), {
'x64': [os.path.join(path, r'VC\bin\amd64')],
# The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
'x86': [os.path.join(path, r'VC\bin\amd64_x86'), os.path.join (path, r'VC\bin\amd64')],
})
# Then VS2017 and newer.
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
for install in vswhere(['-latest', '-products', '*',
'-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'-requires', 'Microsoft.VisualStudio.Component.VC.ATL',
'-requires', 'Microsoft.VisualStudio.Component.VC.ATLMFC']):
path = install['installationPath']
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
Expand Down
8 changes: 6 additions & 2 deletions build/moz.configure/util.configure
Expand Up @@ -118,8 +118,12 @@ def normalize_path():
needed = GetShortPathNameW(path, out, size)
if size >= needed:
if ' ' in out.value:
die("GetShortPathName returned a long path name. "
"Are 8dot3 filenames disabled?")
die("GetShortPathName returned a long path name: `%s`. "
"Use `fsutil file setshortname' "
"to create a short name "
"for any components of this path "
"that have spaces.",
out.value)
return normsep(out.value)
size = needed

Expand Down

0 comments on commit 1ee036e

Please sign in to comment.