Skip to content

Commit b957547

Browse files
authored
[build] fix multi-config for VCPKG (microsoft#25585)
### Description This change fixes the problem when building Dawn monolith library, it failed to pick the correct imported abseil library. Now we separate the triplet files into per-config to avoid this problem.
1 parent c22f70d commit b957547

File tree

3 files changed

+375
-327
lines changed

3 files changed

+375
-327
lines changed

tools/ci_build/build.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -620,32 +620,29 @@ def generate_build_tree(
620620
)
621621
generate_vcpkg_triplets_for_emscripten(
622622
build_dir,
623+
configs,
623624
emscripten_root_path,
624625
not args.disable_rtti,
625626
not args.disable_wasm_exception_catching,
626627
args.minimal_build is not None,
627628
args.enable_address_sanitizer,
628629
)
629630
elif args.android:
630-
generate_android_triplets(build_dir, args.android_cpp_shared, args.android_api)
631+
generate_android_triplets(build_dir, configs, args.android_cpp_shared, args.android_api)
631632
elif is_windows():
632-
generate_windows_triplets(build_dir, args.msvc_toolset)
633+
generate_windows_triplets(build_dir, configs, args.msvc_toolset)
633634
elif is_macOS():
634635
osx_target = args.apple_deploy_target
635636
if args.apple_deploy_target is None:
636637
osx_target = os.environ.get("MACOSX_DEPLOYMENT_TARGET")
637638
if osx_target is not None:
638639
log.info(f"Setting VCPKG_OSX_DEPLOYMENT_TARGET to {osx_target}")
639-
generate_macos_triplets(build_dir, osx_target)
640+
generate_macos_triplets(build_dir, configs, osx_target)
640641
else:
641642
# Linux, *BSD, AIX or other platforms
642-
generate_linux_triplets(build_dir)
643+
generate_linux_triplets(build_dir, configs)
643644
add_default_definition(cmake_extra_defines, "CMAKE_TOOLCHAIN_FILE", str(vcpkg_toolchain_path))
644645

645-
vcpkg_install_options = generate_vcpkg_install_options(build_dir, args)
646-
# VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons
647-
# Therefore, if any of the option string contains a semicolon, it must be escaped
648-
add_default_definition(cmake_extra_defines, "VCPKG_INSTALL_OPTIONS", ";".join(vcpkg_install_options))
649646
# Choose the cmake triplet
650647
triplet = None
651648
if args.build_wasm:
@@ -1251,6 +1248,16 @@ def generate_build_tree(
12511248
]
12521249
env = {}
12531250
if args.use_vcpkg:
1251+
# append VCPKG_INSTALL_OPTIONS
1252+
#
1253+
# VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons
1254+
# Therefore, if any of the option string contains a semicolon, it must be escaped
1255+
temp_cmake_args += [
1256+
"-DVCPKG_INSTALL_OPTIONS={}".format(
1257+
";".join(generate_vcpkg_install_options(Path(build_dir) / config, args))
1258+
)
1259+
]
1260+
12541261
vcpkg_keep_env_vars = ["TRT_UPLOAD_AUTH_TOKEN"]
12551262

12561263
if args.build_wasm:

tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ jobs:
6565
clean: true
6666
submodules: none
6767

68+
- task: UsePythonVersion@0
69+
inputs:
70+
versionSpec: '3.12'
71+
addToPath: true
72+
architecture: 'x64'
73+
6874
- template: templates/get-docker-image-steps.yml
6975
parameters:
7076
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda

0 commit comments

Comments
 (0)