Revert "partition_alloc: CMake and GN config."
This reverts commit c5f72f7a85aeeb21d7a9a12f28918970def41880.
Reason for revert:
1. An error with fetch_dawn_dependencies.py:
https://github.com/google/dawn/actions/runs/7034809858/job/19143713798
2. An error when importing Dawn in google3
I will reland with a fix for (1) and after having more understanding
of (2)
Original change's description:
> partition_alloc: CMake and GN config.
>
> Start using "partition_alloc" in Dawn using both GN and CMake.
> This is accompanied with a minimal usage to prove it works correctly.
>
> Next steps:
> - Enable BackupRefPtr and DanglingPointerDetector in tests (GN only).
> - Apply MiraclePtr rewrite.
> - (stretch) clang-tidy enforcement
>
> Bug:chromium:1464560
> Change-Id: I0b322f1e7351328287f9a14a4985c7792e2f4777
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/157860
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Ben Clayton <bclayton@google.com>
TBR=cwallez@chromium.org,bclayton@google.com,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com,arthursonzogni@chromium.org
Change-Id: I31e9eb33258fd0a1098a4433aeabb387f9b35702
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1464560
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/163720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a77a4c4..cd80185 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,9 +257,8 @@
set_if_not_defined(DAWN_ABSEIL_DIR "${DAWN_THIRD_PARTY_DIR}/abseil-cpp" "Directory in which to find Abseil")
set_if_not_defined(DAWN_GLFW_DIR "${DAWN_THIRD_PARTY_DIR}/glfw" "Directory in which to find GLFW")
set_if_not_defined(DAWN_JINJA2_DIR "${DAWN_THIRD_PARTY_DIR}/jinja2" "Directory in which to find Jinja2")
-set_if_not_defined(DAWN_KHRONOS_DIR "${DAWN_THIRD_PARTY_DIR}/khronos" "Directory in which to find Khronos GL headers")
set_if_not_defined(DAWN_MARKUPSAFE_DIR "${DAWN_THIRD_PARTY_DIR}/markupsafe" "Directory in which to find MarkupSafe")
-set_if_not_defined(DAWN_PARTITION_ALLOC_DIR "${DAWN_THIRD_PARTY_DIR}/partition_alloc" "Directory in which to find PartitionAlloc")
+set_if_not_defined(DAWN_KHRONOS_DIR "${DAWN_THIRD_PARTY_DIR}/khronos" "Directory in which to find Khronos GL headers")
set_if_not_defined(DAWN_SWIFTSHADER_DIR "${DAWN_THIRD_PARTY_DIR}/swiftshader" "Directory in which to find swiftshader")
set_if_not_defined(DAWN_PROTOBUF_DIR "${DAWN_THIRD_PARTY_DIR}/protobuf" "Directory in which to find protobuf")
@@ -452,7 +451,6 @@
"${DAWN_BUILD_GEN_DIR}/src"
)
target_link_libraries(dawn_internal_config INTERFACE dawn_public_config)
-target_link_libraries(dawn_internal_config INTERFACE partition_alloc)
# Compile definitions for the internal config
if (DAWN_ALWAYS_ASSERT OR IS_DEBUG_BUILD)
diff --git a/DEPS b/DEPS
index 14da7a8..910af72 100644
--- a/DEPS
+++ b/DEPS
@@ -287,7 +287,7 @@
# Dependencies for PartitionAlloc.
# Doc: https://docs.google.com/document/d/1wz45t0alQthsIU9P7_rQcfQyqnrBMXzrOjSzdQo-V-A
'third_party/partition_alloc': {
- 'url': '{chromium_git}/chromium/src/base/allocator/partition_allocator.git@ed0eea25ea60b0ebbee85e91022554d6f2d3dd79',
+ 'url': '{chromium_git}/chromium/src/base/allocator/partition_allocator.git@6f90cb04abb81942abaab7b63d34c02882208172',
'condition': 'dawn_standalone',
},
}
diff --git a/src/dawn/native/BUILD.gn b/src/dawn/native/BUILD.gn
index a194087..86dc55e 100644
--- a/src/dawn/native/BUILD.gn
+++ b/src/dawn/native/BUILD.gn
@@ -185,7 +185,6 @@
# dawn native target
public_deps = [
":abseil",
- "${dawn_partition_alloc_dir}:raw_ptr",
"${dawn_root}/src/dawn/platform",
]
diff --git a/src/dawn/native/CMakeLists.txt b/src/dawn/native/CMakeLists.txt
index 5051445..6090a17 100644
--- a/src/dawn/native/CMakeLists.txt
+++ b/src/dawn/native/CMakeLists.txt
@@ -247,7 +247,6 @@
)
target_link_libraries(dawn_native
PUBLIC dawncpp_headers
- partition_alloc
PRIVATE dawn_common
dawn_platform
dawn_internal_config
diff --git a/src/dawn/native/PipelineLayout.h b/src/dawn/native/PipelineLayout.h
index 5421372..8f7dcbd 100644
--- a/src/dawn/native/PipelineLayout.h
+++ b/src/dawn/native/PipelineLayout.h
@@ -42,8 +42,8 @@
#include "dawn/native/Error.h"
#include "dawn/native/Forward.h"
#include "dawn/native/ObjectBase.h"
+
#include "dawn/native/dawn_platform.h"
-#include "partition_alloc/pointers/raw_ptr.h"
namespace dawn::native {
@@ -63,7 +63,7 @@
ConstantEntry const* constants);
SingleShaderStage shaderStage;
- raw_ptr<ShaderModuleBase> module;
+ ShaderModuleBase* module;
std::string entryPoint;
size_t constantCount = 0u;
ConstantEntry const* constants = nullptr;
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index f2ce0a0..2a2cd68 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -104,130 +104,6 @@
add_subdirectory(${DAWN_ABSEIL_DIR} "${CMAKE_CURRENT_BINARY_DIR}/abseil")
endif()
-if (NOT TARGET partition_alloc)
- message(STATUS "Dawn: using partition_alloc at ${DAWN_PARTITION_ALLOC_DIR}")
-
- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(HAS_64_BIT_POINTERS 1)
- else()
- set(HAS_64_BIT_POINTERS 0)
- endif()
-
- # CMake counterpart of the GN action: "buildflag_header(...)"
- # See //build/buildflag_header.gni
- #
- # CMake usage:
- # BuildFlagHeader(
- # OUTPUT <output_filename>
- # FLAGS
- # <key1>=<value1>
- # <key2>=<value2>
- # )
- function(BuildFlagHeader)
- cmake_parse_arguments(ARGUMENT "" "OUTPUT" "FLAGS" "${ARGN}")
-
- # Create directory in the generated folder if doesn't exist yet.
- get_filename_component(GEN_DIR
- "${DAWN_BUILD_GEN_DIR}/include_partition_alloc/${ARGUMENT_OUTPUT}.h"
- DIRECTORY)
- file(MAKE_DIRECTORY "${GEN_DIR}")
-
- # Create the .definitions file used as input for
- # `write_buildflag_header.py"
- string(REPLACE ";" "\n" definitions "--flags;${ARGUMENT_FLAGS}")
- file(WRITE
- "${DAWN_BUILD_GEN_DIR}/include/partition_alloc/${ARGUMENT_OUTPUT}.definitions"
- "${definitions}"
- )
-
- # Generate the build flag header.
- execute_process(
- COMMAND
- ${PYTHON_EXECUTABLE}
- "${Dawn_SOURCE_DIR}/build/write_buildflag_header.py"
- "--definition" "${DAWN_BUILD_GEN_DIR}/include/partition_alloc/${ARGUMENT_OUTPUT}.definitions"
- "--rulename" "${ARGUMENT_OUTPUT}"
- "--gen-dir" "${DAWN_BUILD_GEN_DIR}"
- "--output" "${DAWN_BUILD_GEN_DIR}/include/partition_alloc/${ARGUMENT_OUTPUT}.h"
- )
- endfunction()
-
- BuildFlagHeader(
- OUTPUT "raw_ptr_buildflags"
- FLAGS
- RAW_PTR_ZERO_ON_CONSTRUCT=1
- RAW_PTR_ZERO_ON_MOVE=1
- RAW_PTR_ZERO_ON_DESTRUCT=0
- )
-
- BuildFlagHeader(
- OUTPUT "partition_alloc_buildflags"
- FLAGS
- BACKUP_REF_PTR_POISON_OOB_PTR=0
- ENABLE_BACKUP_REF_PTR_FEATURE_FLAG=0
- ENABLE_BACKUP_REF_PTR_SLOW_CHECKS=0
- ENABLE_BACKUP_REF_PTR_SUPPORT=0
- ENABLE_DANGLING_RAW_PTR_CHECKS=0
- ENABLE_DANGLING_RAW_PTR_FEATURE_FLAG=0
- ENABLE_DANGLING_RAW_PTR_PERF_EXPERIMENT=0
- ENABLE_GWP_ASAN_SUPPORT=0
- ENABLE_PKEYS=0
- ENABLE_POINTER_ARITHMETIC_TRAIT_CHECK=0
- ENABLE_POINTER_COMPRESSION=0
- ENABLE_POINTER_SUBTRACTION_CHECK=0
- ENABLE_SHADOW_METADATA_FOR_64_BITS_POINTERS=0
- ENABLE_THREAD_ISOLATION=0
- FORCE_ENABLE_RAW_PTR_EXCLUSION=0
- FORCIBLY_ENABLE_BACKUP_REF_PTR_IN_ALL_PROCESSES=0
- GLUE_CORE_POOLS=0
- HAS_64_BIT_POINTERS=${HAS_64_BIT_POINTERS}
- PCSCAN_STACK_SUPPORTED=0
- PUT_REF_COUNT_IN_PREVIOUS_SLOT=0
- RECORD_ALLOC_INFO=0
- USE_ALLOCATOR_SHIM=0
- USE_ASAN_BACKUP_REF_PTR=0
- USE_ASAN_UNOWNED_PTR=0
- USE_FREELIST_POOL_OFFSETS=0
- USE_FREESLOT_BITMAP=0
- USE_HOOKABLE_RAW_PTR=0
- USE_PARTITION_ALLOC=0
- USE_PARTITION_ALLOC_AS_MALLOC=0
- USE_STARSCAN=0
- )
-
- BuildFlagHeader(
- OUTPUT "partition_alloc_base/debug/debugging_buildflags"
- FLAGS
- PA_DCHECK_IS_ON=0
- PA_EXPENSIVE_DCHECKS_ARE_ON=0
- PA_DCHECK_IS_CONFIGURABLE=0
- PA_CAN_UNWIND_WITH_FRAME_POINTERS=0
- )
-
- BuildFlagHeader(
- OUTPUT "chromecast_buildflags"
- FLAGS
- PA_IS_CAST_ANDROID=0
- PA_IS_CASTOS=0
- )
-
- # This corresponds exactly to the "partition_alloc:raw_ptr" GN target with:
- # - enable_backup_ref_ptr_support=false
- # - use_asan_unowned_ptr=false
- # - use_hookable_raw_ptr=false
- # - use_partition_alloc=false
- #
- # This is a header only library. You can use the files:
- # - partition_alloc/pointers/raw_ptr.h
- # - partition_alloc/pointers/raw_ptr_cast.h"
- # - partition_alloc/pointers/raw_ptr_exclusion.h"
- # - partition_alloc/pointers/raw_ref.h"
- add_library(partition_alloc INTERFACE)
- target_include_directories(partition_alloc
- INTERFACE "${DAWN_PARTITION_ALLOC_DIR}/src"
- )
-endif()
-
if (NOT TARGET Vulkan-Headers)
message(STATUS "Dawn: using Vulkan-Headers at ${DAWN_VULKAN_HEADERS_DIR}")
add_subdirectory(${DAWN_VULKAN_HEADERS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/vulkan-headers")
diff --git a/third_party/partition_alloc b/third_party/partition_alloc
index ed0eea2..6f90cb0 160000
--- a/third_party/partition_alloc
+++ b/third_party/partition_alloc
@@ -1 +1 @@
-Subproject commit ed0eea25ea60b0ebbee85e91022554d6f2d3dd79
+Subproject commit 6f90cb04abb81942abaab7b63d34c02882208172
diff --git a/tools/fetch_dawn_dependencies.py b/tools/fetch_dawn_dependencies.py
index ae1ff4c..1190414 100644
--- a/tools/fetch_dawn_dependencies.py
+++ b/tools/fetch_dawn_dependencies.py
@@ -102,7 +102,6 @@
'third_party/khronos/EGL-Registry',
'third_party/khronos/OpenGL-Registry',
'third_party/markupsafe',
- 'third_party/partition_alloc',
'third_party/vulkan-deps',
'third_party/vulkan-deps/glslang/src',
'third_party/vulkan-deps/spirv-headers/src',