diff --git a/BUILD.gn b/BUILD.gn index e204d2d72..268edd3c1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,12 +10,7 @@ # # GN Setup: # -# 1. Enable use of GN instead of GYP by setting the `CEF_USE_GN` environment -# variable to a value of `1`. For example, on Windows: -# -# > set CEF_USE_GN=1 -# -# 2. Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS` +# Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS` # environment variables. # # Example A: Use /DEBUG:FASTLINK on Windows: diff --git a/cef.gyp b/cef.gyp deleted file mode 100644 index 5c5765495..000000000 --- a/cef.gyp +++ /dev/null @@ -1,2025 +0,0 @@ -# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights -# reserved. Use of this source code is governed by a BSD-style license that -# can be found in the LICENSE file. - -{ - 'variables': { - 'chromium_code': 1, - 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/cef', - 'framework_name': 'Chromium Embedded Framework', - 'commit_number': ' + # set VS_VERSION= + # set VS_CRT_ROOT= # set VS_ROOT= - # set VS_CRT_ROOT= (GN only) # set SDK_ROOT= # set INCLUDE= - # set PATH= # set LIB= + # set PATH= + # if bool(int(os.environ.get('WIN_CUSTOM_TOOLCHAIN', '0'))): required_vars = [ - 'GYP_MSVS_VERSION', + 'VS_VERSION', + 'VS_CRT_ROOT', 'VS_ROOT', 'SDK_ROOT', 'INCLUDE', - 'PATH', 'LIB', + 'PATH', ] - if use_gn: - required_vars.append('VS_CRT_ROOT') for var in required_vars: if not var in os.environ.keys(): raise Exception('%s environment variable must be set' % var) - custom_toolchain = True - - # VC variables will be set via INCLUDE/PATH/LIB. + # VC variables for CEF will be set via INCLUDE/LIB/PATH. + # TODO(cef): Make INCLUDE/PATH/LIB values optional when + # "%VS_ROOT%\VC\vcvarsall.bat" exists (use those values instead). os.environ['CEF_VCVARS'] = 'none' - # Necessary to return correct VS version information via GetVSVersion in - # src/tools/gyp/pylib/gyp/msvs_emulation.py. + # Checked in build/toolchain/win/setup_toolchain.py _LoadToolchainEnv. + # If "%VS_ROOT%\VC\vcvarsall.bat" exists then environment variables will + # be derived from there and the specified INCLUDE/LIB/PATH values, if any, + # will be ignored by Chromium. If this file does not exist then the + # INCLUDE/LIB/PATH values are also required by Chromium. os.environ['GYP_MSVS_OVERRIDE_PATH'] = os.environ['VS_ROOT'] - if use_gn: - # Windows custom toolchain requirements. See comments in gn_args.py. - gn_args['visual_studio_path'] = os.environ['VS_ROOT'] - gn_args['visual_studio_version'] = os.environ['GYP_MSVS_VERSION'] - gn_args['visual_studio_runtime_dirs'] = os.environ['VS_CRT_ROOT'] - gn_args['windows_sdk_path'] = os.environ['SDK_ROOT'] - else: - # Set windows_sdk_path via GYP_DEFINES. - gyp_defines = '' - if 'GYP_DEFINES' in os.environ: - gyp_defines = os.environ['GYP_DEFINES'] + ' ' - gyp_defines = \ - gyp_defines + \ - 'windows_sdk_path=' + os.environ['SDK_ROOT'].replace('\\', '/') - os.environ['GYP_DEFINES'] = gyp_defines + # Windows custom toolchain requirements. See comments in gn_args.py. + gn_args['visual_studio_path'] = os.environ['VS_ROOT'] + gn_args['visual_studio_version'] = os.environ['VS_VERSION'] + gn_args['visual_studio_runtime_dirs'] = os.environ['VS_CRT_ROOT'] + gn_args['windows_sdk_path'] = os.environ['SDK_ROOT'] - # Generate environment files (environment.x64, environment.x86) in each - # build output directory. - # When using the default toolchain this is done by - # GenerateEnvironmentFiles in src/tools/gyp/pylib/gyp/msvs_emulation.py. - setup_script = os.path.join(cef_dir, 'tools/setup_toolchain.py') - win_tool_script = os.path.join(src_dir, 'tools/gyp/pylib/gyp/win_tool.py') - out_dirs = ['Debug', 'Debug_x64', 'Release', 'Release_x64'] - for out_dir in out_dirs: - out_dir_abs = os.path.join(src_dir, 'out', out_dir) - if not os.path.exists(out_dir_abs): - os.makedirs(out_dir_abs) - cmd = ['python', setup_script, - os.environ['VS_ROOT'], win_tool_script, os.environ['SDK_ROOT']] - RunAction(out_dir_abs, cmd) +configs = GetAllPlatformConfigs(gn_args) +for dir, config in configs.items(): + # Create out directories and write the args.gn file. + out_path = os.path.join(src_dir, 'out', dir) + make_dir(out_path, False) + args_gn_path = os.path.join(out_path, 'args.gn') + args_gn_contents = GetConfigFileContents(config) + write_file(args_gn_path, args_gn_contents) -if use_gn: - configs = GetAllPlatformConfigs(gn_args) - for dir, config in configs.items(): - # Create out directories and write the args.gn file. - out_path = os.path.join(src_dir, 'out', dir) - make_dir(out_path, False) - args_gn_path = os.path.join(out_path, 'args.gn') - args_gn_contents = GetConfigFileContents(config) - write_file(args_gn_path, args_gn_contents) - - # Generate the Ninja config. - cmd = [ 'gn', 'gen', os.path.join('out', dir) ] - if 'GN_ARGUMENTS' in os.environ.keys(): - cmd.extend(os.environ['GN_ARGUMENTS'].split(' ')) - RunAction(src_dir, cmd) -else: - os.environ['CEF_DIRECTORY'] = os.path.basename(cef_dir) - gyper = [ 'python', '../build/gyp_chromium', 'cef.gyp', '-I', 'cef.gypi' ] - if custom_toolchain: - # Disable GYP's auto-detection of the VS install. - gyper.extend(['-G', 'ninja_use_custom_environment_files']) - if 'GYP_ARGUMENTS' in os.environ.keys(): - gyper.extend(os.environ['GYP_ARGUMENTS'].split(' ')) - RunAction(cef_dir, gyper) + # Generate the Ninja config. + cmd = [ 'gn', 'gen', os.path.join('out', dir) ] + if 'GN_ARGUMENTS' in os.environ.keys(): + cmd.extend(os.environ['GN_ARGUMENTS'].split(' ')) + RunAction(src_dir, cmd) diff --git a/tools/gn_args.py b/tools/gn_args.py index d8ff104fe..959f12af8 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -207,7 +207,7 @@ def ValidateArgs(args): # Windows custom toolchain requirements. # See tools/depot_tools/win_toolchain/package_from_installed.py for an # example packaging script along with required directory contents and - # PATH/LIB/INCLUDE values. + # INCLUDE/LIB/PATH values. # # Required GN arguments: # visual_studio_path="" @@ -225,24 +225,41 @@ def ValidateArgs(args): # # Required environment variables: # DEPOT_TOOLS_WIN_TOOLCHAIN=0 + # GYP_MSVS_OVERRIDE_PATH= # CEF_VCVARS=none - # GYP_MSVS_OVERRIDE_PATH= - # PATH= - # LIB= # INCLUDE= + # LIB= + # PATH= + # if visual_studio_path != '': assert visual_studio_version != '', 'visual_studio_path requires visual_studio_version' assert visual_studio_runtime_dirs != '', 'visual_studio_path requires visual_studio_runtime_dirs' assert windows_sdk_path != '', 'visual_studio_path requires windows_sdk_path' - assert bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 0))), \ - "visual_studio_path requires DEPOT_TOOLS_WIN_TOOLCHAIN=0 env variable" + + # VC variables for CEF will be set via INCLUDE/LIB/PATH. + # TODO(cef): Make INCLUDE/LIB/PATH values optional when + # "%VS_ROOT%\VC\vcvarsall.bat" exists (use those values instead). assert os.environ.get('CEF_VCVARS', '') == 'none', \ "visual_studio_path requires CEF_VCVARS=none env variable" - assert 'GYP_MSVS_OVERRIDE_PATH' is os.environ \ - and 'PATH' in os.environ \ + assert 'INCLUDE' in os.environ \ and 'LIB' in os.environ \ - and 'INCLUDE' in os.environ, \ - "visual_studio_path requires GYP_MSVS_OVERRIDE_PATH, PATH, LIB and INCLUDE env variables" + and 'PATH' in os.environ, \ + "visual_studio_path requires INCLUDE, LIB and PATH env variables" + + # Checked in build/toolchain/win/setup_toolchain.py _LoadToolchainEnv. + # If "%VS_ROOT%\VC\vcvarsall.bat" exists then environment variables will + # be derived from there and the specified INCLUDE/LIB/PATH values, if any, + # will be ignored by Chromium. If this file does not exist then the + # INCLUDE/LIB/PATH values are also required by Chromium. + assert bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 0))), \ + "visual_studio_path requires DEPOT_TOOLS_WIN_TOOLCHAIN=0 env variable" + msvs_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH', '') + assert msvs_path == visual_studio_path and os.path.exists(msvs_path), \ + "visual_studio_path requires matching GYP_MSVS_OVERRIDE_PATH env variable" + + vcvars_path = os.path.join(msvs_path, 'VC', 'vcvarsall.bat') + if (os.path.exists(vcvars_path)): + msg('INCLUDE/LIB/PATH values will be derived from %s' % vcvars_path) def GetConfigArgs(args, is_debug, is_x64): """ diff --git a/tools/make_distrib.py b/tools/make_distrib.py index 5e61911c8..8b38ba958 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -282,9 +282,6 @@ elif sys.platform == 'darwin': elif sys.platform.startswith('linux'): platform = 'linux' -# Whether to use GN or GYP. GN is currently the default. -use_gn = bool(int(os.environ.get('CEF_USE_GN', '1'))) - # the outputdir option is required if options.outputdir is None: parser.print_help(sys.stderr) @@ -340,21 +337,6 @@ platform_arch = '32' if options.x64build: platform_arch = '64' -if platform == 'linux' and not use_gn: - # GYP places x86 and x64 builds in the same directory. Check file attributes - # to differentiate between them. - platform_arch = '' - lib_dir_name = 'lib' - release_libcef_path = os.path.join(src_dir, 'out', 'Release', lib_dir_name, 'libcef.so'); - debug_libcef_path = os.path.join(src_dir, 'out', 'Debug', lib_dir_name, 'libcef.so'); - file_desc = '' - output = subprocess.check_output('file ' + release_libcef_path + ' ' + debug_libcef_path + '; exit 0', - env=os.environ, stderr=subprocess.STDOUT, shell=True) - if output.find('32-bit') != -1: - platform_arch = '32' - if output.find('64-bit') != -1: - platform_arch = '64' - # output directory output_dir_base = 'cef_binary_' + cef_ver @@ -388,20 +370,12 @@ cef_paths = cef_paths['variables'] cef_paths2 = eval_file(os.path.join(cef_dir, 'cef_paths2.gypi')) cef_paths2 = cef_paths2['variables'] -# Determine the build directory suffix. -build_dir_suffix = '' -if use_gn: - # CEF uses a consistent directory naming scheme for GN via - # GetAllPlatformConfigs in gn_args.py. - if options.x64build: - build_dir_suffix = '_GN_x64' - else: - build_dir_suffix = '_GN_x86' +# Determine the build directory suffix. CEF uses a consistent directory naming +# scheme for GN via GetAllPlatformConfigs in gn_args.py. +if options.x64build: + build_dir_suffix = '_GN_x64' else: - # GYP outputs both x86 and x64 builds to the same directory on Linux and - # Mac OS X. On Windows it suffixes the directory name for x64 builds. - if platform == 'windows' and options.x64build: - build_dir_suffix = '_x64' + build_dir_suffix = '_GN_x86' # Determine the build directory paths. out_dir = os.path.join(src_dir, 'out') @@ -509,7 +483,6 @@ if mode == 'standard': variables, options.quiet) # transfer gyp files - copy_file(os.path.join(script_dir, 'distrib/cefclient.gyp'), output_dir, options.quiet) paths_gypi = os.path.join(cef_dir, 'cef_paths2.gypi') data = read_file(paths_gypi) data = data.replace('tests/cefclient/', 'cefclient/') @@ -526,7 +499,7 @@ if platform == 'windows': 'libGLESv2.dll', 'natives_blob.bin', 'snapshot_blob.bin', - # Should match the output path from src/media/cdm_paths.gypi. + # Should match the output path from media/cdm/ppapi/cdm_paths.gni. 'WidevineCdm\\_platform_specific\\win_%s\\widevinecdmadapter.dll' % \ ('x64' if options.x64build else 'x86'), ] @@ -535,13 +508,10 @@ if platform == 'windows': sandbox_libs = [ 'obj\\base\\base.lib', 'obj\\base\\base_static.lib', - 'obj\\cef\\cef_sandbox.lib', 'obj\\base\\third_party\\dynamic_annotations\\dynamic_annotations.lib', + 'obj\\cef\\cef_sandbox.lib', + 'obj\\sandbox\\win\\sandbox.lib', ] - if use_gn: - sandbox_libs.append('obj\\sandbox\\win\\sandbox.lib') - else: - sandbox_libs.append('obj\\sandbox\\sandbox.lib') valid_build_dir = None diff --git a/tools/repack_locales.py b/tools/repack_locales.py deleted file mode 100644 index fe8b9e56d..000000000 --- a/tools/repack_locales.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Helper script to repack paks for a list of locales. - -Gyp doesn't have any built-in looping capability, so this just provides a way to -loop over a list of locales when repacking pak files, thus avoiding a -proliferation of mostly duplicate, cut-n-paste gyp actions. -""" - -import getopt -import os -import sys - -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', - 'tools', 'grit')) -from grit.format import data_pack - -# Some build paths defined by gyp. -GRIT_DIR = None -SHARE_INT_DIR = None -INT_DIR = None - - -class Usage(Exception): - def __init__(self, msg): - self.msg = msg - - -def calc_output(locale, create_dir): - """Determine the file that will be generated for the given locale.""" - #e.g. '<(INTERMEDIATE_DIR)/da.pak', - # For Fake Bidi, generate it at a fixed path so that tests can safely - # reference it. - if locale == 'fake-bidi': - return '%s/%s.pak' % (INT_DIR, locale) - if sys.platform in ('darwin',): - # For Cocoa to find the locale at runtime, it needs to use '_' instead - # of '-' (http://crbug.com/20441). Also, 'en-US' should be represented - # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578). - if locale == 'en-US': - locale = 'en' - dir = '%s/%s.lproj' % (INT_DIR, locale.replace('-', '_')) - if create_dir and not os.path.exists(dir): - os.makedirs(dir) - return dir + '/locale.pak' - else: - return os.path.join(INT_DIR, locale + '.pak') - - -def calc_inputs(locale): - """Determine the files that need processing for the given locale.""" - inputs = [] - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/chrome/generated_resources_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'chrome', - 'generated_resources_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/chrome/locale_settings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'chrome', - 'locale_settings_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/chrome/platform_locale_settings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'chrome', - 'platform_locale_settings_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/components/strings/components_locale_settings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings', - 'components_locale_settings_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/components/strings/components_strings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings', - 'components_strings_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'content', 'app', 'strings', - 'content_strings_%s.pak' % locale)) - - #e.g. - # '<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'extensions', 'strings', - 'extensions_strings_%s.pak' % locale)) - - #e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_da.pak', - inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings', - 'ui_strings_%s.pak' % locale)) - - #e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_da.pak', - inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings', - 'app_locale_settings_%s.pak' % locale)) - - #e.g. '<(SHARED_INTERMEDIATE_DIR)/cef/cef_strings_da.pak' - inputs.append(os.path.join(SHARE_INT_DIR, 'cef', - 'cef_strings_%s.pak' % locale)) - - return inputs - - -def list_outputs(locales): - """Returns the names of files that will be generated for the given locales. - - This is to provide gyp the list of output files, so build targets can - properly track what needs to be built. - """ - outputs = [] - for locale in locales: - outputs.append(calc_output(locale, False)) - # Quote each element so filename spaces don't mess up gyp's attempt to parse - # it into a list. - return " ".join(['"%s"' % x for x in outputs]) - - -def list_inputs(locales): - """Returns the names of files that will be processed for the given locales. - - This is to provide gyp the list of input files, so build targets can properly - track their prerequisites. - """ - inputs = [] - for locale in locales: - inputs += calc_inputs(locale) - # Quote each element so filename spaces don't mess up gyp's attempt to parse - # it into a list. - return " ".join(['"%s"' % x for x in inputs]) - - -def repack_locales(locales): - """ Loop over and repack the given locales.""" - for locale in locales: - inputs = [] - inputs += calc_inputs(locale) - output = calc_output(locale, True) - data_pack.DataPack.RePack(output, inputs) - - -def DoMain(argv): - global GRIT_DIR - global SHARE_INT_DIR - global INT_DIR - - short_options = 'iog:s:x:b:h' - long_options = 'help' - - print_inputs = False - print_outputs = False - usage_msg = '' - - helpstr = """\ -Usage: %s [-h] [-i | -o] -g -x -s [...] - -h, --help Print this help, then exit. - -i Print the expected input file list, then exit. - -o Print the expected output file list, then exit. - -g DIR GRIT build files output directory. - -x DIR Intermediate build files output directory. - -s DIR Shared intermediate build files output directory. - locale [...] One or more locales to repack.""" % ( - os.path.basename(__file__)) - - try: - opts, locales = getopt.getopt(argv, short_options, long_options) - except getopt.GetoptError, msg: - raise Usage(str(msg)) - - if not locales: - usage_msg = 'Please specificy at least one locale to process.\n' - - for o, a in opts: - if o in ('-i'): - print_inputs = True - elif o in ('-o'): - print_outputs = True - elif o in ('-g'): - GRIT_DIR = a - elif o in ('-s'): - SHARE_INT_DIR = a - elif o in ('-x'): - INT_DIR = a - elif o in ('-h', '--help'): - raise Usage(helpstr) - - if not (GRIT_DIR and INT_DIR and SHARE_INT_DIR): - usage_msg += 'Please specify all of "-g" and "-x" and "-s".\n' - if print_inputs and print_outputs: - usage_msg += 'Please specify only one of "-i" or "-o".\n' - - if usage_msg: - raise Usage(usage_msg) - - if print_inputs: - return list_inputs(locales) - - if print_outputs: - return list_outputs(locales) - - if not os.path.exists(INT_DIR): - os.makedirs(INT_DIR) - - return repack_locales(locales) - -if __name__ == '__main__': - results = DoMain(sys.argv[1:]) - if results: - print results diff --git a/tools/setup_toolchain.py b/tools/setup_toolchain.py deleted file mode 100644 index 9e0bb8dca..000000000 --- a/tools/setup_toolchain.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import errno -import os -import re -import subprocess -import sys - -""" -Copies the given "win tool" (which the toolchain uses to wrap compiler -invocations) and the environment blocks for the 32-bit and 64-bit builds on -Windows to the build directory. - -The arguments are the visual studio install location and the location of the -win tool. The script assumes that the root build directory is the current dir -and the files will be written to the current directory. -""" - - -def ExtractImportantEnvironment(): - """Extracts environment variables required for the toolchain from the - current environment.""" - # This list should be kept synchronized with _ExtractImportantEnvironment from - # tools/gyp/pylib/gyp/msvs_emulation.py. - envvars_to_save = ( - 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. - 'include', # Needed by midl compiler. - 'lib', - 'libpath', - 'path', - 'pathext', - 'systemroot', - 'temp', - 'tmp', - ) - result = {} - for envvar in envvars_to_save: - if envvar in os.environ: - envvar = envvar.lower() - if envvar == 'path': - # Our own rules (for running gyp-win-tool) and other actions in - # Chromium rely on python being in the path. Add the path to this - # python here so that if it's not in the path when ninja is run - # later, python will still be found. - result[envvar.upper()] = os.path.dirname(sys.executable) + \ - os.pathsep + os.environ[envvar] - else: - result[envvar.upper()] = os.environ[envvar] - for required in ('SYSTEMROOT', 'TEMP', 'TMP'): - if required not in result: - raise Exception('Environment variable "%s" ' - 'required to be set to valid path' % required) - return result - - -def FormatAsEnvironmentBlock(envvar_dict): - """Format as an 'environment block' directly suitable for CreateProcess. - Briefly this is a list of key=value\0, terminated by an additional \0. See - CreateProcess documentation for more details.""" - block = '' - nul = '\0' - for key, value in envvar_dict.iteritems(): - block += key + '=' + value + nul - block += nul - return block - - -def CopyTool(source_path): - """Copies the given tool to the current directory, including a warning not - to edit it.""" - with open(source_path) as source_file: - tool_source = source_file.readlines() - - # Add header and write it out to the current directory (which should be the - # root build dir). - with open("gyp-win-tool", 'w') as tool_file: - tool_file.write(''.join([tool_source[0], - '# Generated by setup_toolchain.py do not edit.\n'] - + tool_source[1:])) - -if len(sys.argv) != 4: - print('Usage setup_toolchain.py ' - ' ') - sys.exit(2) -vs_path = sys.argv[1] -tool_source = sys.argv[2] -win_sdk_path = sys.argv[3] - -CopyTool(tool_source) - -important_env_vars = ExtractImportantEnvironment() -path = important_env_vars["PATH"].split(";") - -# Add 32-bit compiler path to the beginning and write the block. -path32 = [os.path.join(vs_path, "VC\\BIN\\amd64_x86")] + \ - [os.path.join(win_sdk_path, "bin\\x86")] + \ - path -important_env_vars["PATH"] = ";".join(path32) -environ = FormatAsEnvironmentBlock(important_env_vars) -with open('environment.x86', 'wb') as env_file: - env_file.write(environ) - -# Add 64-bit compiler path to the beginning and write the block. -path64 = [os.path.join(vs_path, "VC\\BIN\\amd64")] + \ - [os.path.join(win_sdk_path, "bin\\x64")] + \ - path -important_env_vars["PATH"] = ";".join(path64) -environ = FormatAsEnvironmentBlock(important_env_vars) -with open('environment.x64', 'wb') as env_file: - env_file.write(environ)