diff --git a/src/base/BUILD.gn b/src/base/BUILD.gn index 414919abd4..175c38d0f7 100644 --- a/src/base/BUILD.gn +++ b/src/base/BUILD.gn @@ -1028,12 +1028,6 @@ component("base") { if (!is_nacl) { # Used by metrics/crc32, except on NaCl builds. deps += [ "//third_party/zlib" ] - - # NaCl does not support Rust. - deps += [ - ":rust_logger", - "//third_party/rust/serde_json_lenient/v0_2/wrapper", - ] } # `raw_ptr` cannot be made a component due to CRT symbol issues. @@ -1070,17 +1064,6 @@ component("base") { "//third_party/abseil-cpp:absl", ] - if (!is_nacl) { - sources += [ - "containers/span_rust.h", - "strings/string_view_rust.h", - ] - - # Base provides conversions between CXX types and base types (e.g. - # std::string_view). - public_deps += [ "//build/rust:cxx_cppdeps" ] - } - # Needed for if using newer C++ library than sysroot, except if # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. @@ -2452,41 +2435,6 @@ component("base") { } } -rust_bindgen("logging_log_severity_bindgen") { - # TODO(danakj): Maybe combine all base bindgen targets, or all base/logging - # ones even) into a single GN target? But the GN rule needs to handle multiple - # headers then. - header = "logging/log_severity.h" - cpp = true - visibility = [ ":*" ] - - # Transitive generated header dependency. - deps = [ ":debugging_buildflags" ] -} - -rust_bindgen("logging_rust_log_integration_bindgen") { - header = "logging/rust_log_integration.h" - cpp = true - visibility = [ ":*" ] - - # Transitive generated header dependency. - deps = [ ":debugging_buildflags" ] -} - -rust_static_library("rust_logger") { - allow_unsafe = true # Unsafe needed for FFI. - deps = [ - ":logging_log_severity_bindgen", - ":logging_rust_log_integration_bindgen", - "//third_party/rust/log/v0_4:lib", - ] - visibility = [ ":base" ] - sources = [ "logging/rust_logger.rs" ] - crate_root = "logging/rust_logger.rs" - - cxx_bindings = [ "logging/rust_logger.rs" ] -} - if (is_linux || is_chromeos) { # Split out as a separate target for two reasons: # - the line number reader is 2x slower in debug builds if not optimized, diff --git a/src/base/json/json_reader.cc b/src/base/json/json_reader.cc index af1d4f46d0..88c13b9e29 100644 --- a/src/base/json/json_reader.cc +++ b/src/base/json/json_reader.cc @@ -13,7 +13,7 @@ #include "base/metrics/histogram_macros.h" #include "build/build_config.h" -#if !BUILDFLAG(IS_NACL) +#if 0 // Disables Rust #include "base/strings/string_view_rust.h" #include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h" #include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h" @@ -23,7 +23,7 @@ namespace base { // TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just // run in-process there. Don't compile base::JSONReader on NaCL at all. -#if !BUILDFLAG(IS_NACL) +#if 0 // Disables Rust namespace { using serde_json_lenient::ContextPointer; @@ -135,7 +135,7 @@ JSONReader::Result DecodeJSONInRust(std::string_view json, std::optional JSONReader::Read(std::string_view json, int options, size_t max_depth) { -#if BUILDFLAG(IS_NACL) +#if 1 // Disables Rust internal::JSONParser parser(options, max_depth); return parser.Parse(json); #else // BUILDFLAG(IS_NACL) @@ -168,7 +168,7 @@ std::optional JSONReader::ReadDict(std::string_view json, JSONReader::Result JSONReader::ReadAndReturnValueWithError( std::string_view json, int options) { -#if BUILDFLAG(IS_NACL) +#if 1 // Disables Rust internal::JSONParser parser(options); auto value = parser.Parse(json); if (!value) { @@ -208,7 +208,7 @@ bool JSONReader::UsingRust() { if (!base::FeatureList::GetInstance()) { return false; } -#if BUILDFLAG(IS_NACL) +#if 1 // Disables Rust return false; #else return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); diff --git a/src/base/logging.cc b/src/base/logging.cc index b67b6fbf7e..21ed59f40c 100644 --- a/src/base/logging.cc +++ b/src/base/logging.cc @@ -127,7 +127,7 @@ typedef FILE* FileHandle; #include "base/fuchsia/scoped_fx_logger.h" #endif -#if !BUILDFLAG(IS_NACL) +#if 0 // Disables Rust #include "base/logging/rust_logger.rs.h" #endif @@ -538,7 +538,7 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) { } #endif -#if !BUILDFLAG(IS_NACL) +#if 0 // Disables Rust // Connects Rust logging with the //base logging functionality. internal::init_rust_log_crate(); #endif