From dadfe2c8dc9a0622a21fc62da29d62bd4af94619 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 13 May 2025 18:16:59 -0400 Subject: [PATCH] bazel: win: Remove cef_sandbox.lib linking (see #3824) Support for bootstrap executables will be added later. --- bazel/win/exe_helpers.bzl | 1 - bazel/win/variables.bzl | 30 +------------------ tools/distrib/bazel/BUILD.bazel | 10 ++----- .../bazel/tests-cefclient-win-BUILD.bazel | 1 + 4 files changed, 4 insertions(+), 38 deletions(-) diff --git a/bazel/win/exe_helpers.bzl b/bazel/win/exe_helpers.bzl index 23da465ab..f55d68540 100644 --- a/bazel/win/exe_helpers.bzl +++ b/bazel/win/exe_helpers.bzl @@ -47,7 +47,6 @@ def declare_exe(name, srcs, manifest_srcs, rc_file, resources_srcs, resources_de srcs = srcs, deps = [ "@cef//:cef_wrapper", - "@cef//:cef_sandbox", ] + deps, linkopts = [ "$(location @cef//:cef_lib)", diff --git a/bazel/win/variables.bzl b/bazel/win/variables.bzl index d9f136078..dda74ea8e 100644 --- a/bazel/win/variables.bzl +++ b/bazel/win/variables.bzl @@ -81,6 +81,7 @@ DELAYLOAD_DLLS = [ # Standard link libraries. STANDARD_LIBS = [ "comctl32.lib", + "delayimp.lib", "gdi32.lib", "rpcrt4.lib", "shlwapi.lib", @@ -88,26 +89,6 @@ STANDARD_LIBS = [ "ws2_32.lib", ] -# Sandbox link libraries. -SANDBOX_LIBS = [ - "Advapi32.lib", - "dbghelp.lib", - "Delayimp.lib", - "ntdll.lib", - "OleAut32.lib", - "PowrProf.lib", - "Propsys.lib", - "psapi.lib", - "SetupAPI.lib", - "Shcore.lib", - "Shell32.lib", - "Userenv.lib", - "version.lib", - "wbemuuid.lib", - "WindowsApp.lib", - "winmm.lib", -] - COMMON_LINKOPTS_DEBUG = [ ] @@ -178,18 +159,9 @@ COMMON_DEFINES = [ "WIN32_LEAN_AND_MEAN", # Disable exceptions "_HAS_EXCEPTIONS=0", - - # Required by cef_sandbox.lib - "PSAPI_VERSION=1", - # Used by apps to test if the sandbox is enabled - "CEF_USE_SANDBOX", ] COMMON_DEFINES_DEBUG = [ - # Required by cef_sandbox.lib - # Disable iterator debugging - "HAS_ITERATOR_DEBUGGING=0", - "_ITERATOR_DEBUG_LEVEL=0", ] COMMON_DEFINES_RELEASE = [ diff --git a/tools/distrib/bazel/BUILD.bazel b/tools/distrib/bazel/BUILD.bazel index 91399901a..62d9411b6 100755 --- a/tools/distrib/bazel/BUILD.bazel +++ b/tools/distrib/bazel/BUILD.bazel @@ -12,8 +12,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("//bazel:library_helpers.bzl", "declare_cc_library", "declare_objc_library") load("//bazel/win:variables.bzl", WIN_DLLS="DLLS", - WIN_DLLS_X64="DLLS_X64", - WIN_SANDBOX_LIBS="SANDBOX_LIBS") + WIN_DLLS_X64="DLLS_X64") load("//bazel/linux:variables.bzl", LINUX_SOS="SOS") load("//bazel/mac:variables.bzl", @@ -153,14 +152,11 @@ declare_cc_library( }), ) -# Only available on MacOS/Windows. +# Only available on MacOS. declare_cc_library( name = "cef_sandbox_linkflags", linkopts = select({ "@platforms//os:macos": ["-lsandbox"], - "@platforms//os:windows": [ - "/DEFAULTLIB:{}".format(lib) for lib in WIN_SANDBOX_LIBS - ], "//conditions:default": [], }), ) @@ -169,7 +165,6 @@ cc_import( name = "cef_sandbox_debug", static_library = select({ "@platforms//os:macos": "Debug/cef_sandbox.a", - "@platforms//os:windows": "Debug/cef_sandbox.lib", "//conditions:default": None, }), deps = [":cef_sandbox_linkflags"], @@ -179,7 +174,6 @@ cc_import( name = "cef_sandbox_release", static_library = select({ "@platforms//os:macos": "Release/cef_sandbox.a", - "@platforms//os:windows": "Release/cef_sandbox.lib", "//conditions:default": None, }), deps = [":cef_sandbox_linkflags"], diff --git a/tools/distrib/bazel/tests-cefclient-win-BUILD.bazel b/tools/distrib/bazel/tests-cefclient-win-BUILD.bazel index d27b262a5..480af33fd 100644 --- a/tools/distrib/bazel/tests-cefclient-win-BUILD.bazel +++ b/tools/distrib/bazel/tests-cefclient-win-BUILD.bazel @@ -22,6 +22,7 @@ LINK_LIBS = [ "glu32.lib", "imm32.lib", "opengl32.lib", + "shell32.lib", ] DELAYLOAD_DLLS = [