Revert "Bump rust package to 1.1.0 (1.62.1)" (#15566)
This commit is contained in:
@@ -373,6 +373,26 @@ if (is_mac) {
|
||||
brave_chrome_framework_bundle_deps = [ "//brave:framework_bundle_data" ]
|
||||
brave_chrome_framework_contents = [ "Frameworks" ]
|
||||
brave_chrome_framework_ldflags = []
|
||||
|
||||
# this needs to match the guards on //chrome:verify_chrome_framework_order
|
||||
if (!is_component_build && chrome_pgo_phase != 1) {
|
||||
brave_chrome_framework_public_deps += [
|
||||
# TODO(bridiver) - this doesn't have to be a public dep
|
||||
"//brave/build/rust:generate_unexport_list",
|
||||
]
|
||||
brave_chrome_framework_ldflags += [
|
||||
# prevent export of all rust symbols
|
||||
"-Wl,-unexported_symbols_list," +
|
||||
rebase_path(unexport_list_path, root_build_dir),
|
||||
]
|
||||
}
|
||||
if (!is_component_build && !use_lld) {
|
||||
brave_chrome_framework_ldflags += [
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1188030#c14
|
||||
# Supposedly this bug was fixed, but it's still happening for us
|
||||
"-Wl,-no_compact_unwind",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
brave_chrome_browser_sources += brave_browser_autocomplete_sources
|
||||
|
||||
+1
-9
@@ -18,14 +18,9 @@ rust_lib_output_path =
|
||||
"$rust_lib_build_path/${cargo_lib_prefix}brave_rust${cargo_lib_suffix}"
|
||||
|
||||
template("rust_ffi") {
|
||||
static_library(target_name) {
|
||||
source_set(target_name) {
|
||||
libs = [ rust_lib_output_path ]
|
||||
|
||||
all_dependent_configs = [
|
||||
"//brave/build/rust:strip_rust_symbols",
|
||||
"//brave/build/rust:too_many_personalities_workaround",
|
||||
]
|
||||
|
||||
if (is_mac) {
|
||||
frameworks = [ "Security.framework" ]
|
||||
|
||||
@@ -37,9 +32,6 @@ template("rust_ffi") {
|
||||
}
|
||||
|
||||
deps = [ "//brave/build/rust:rust_lib" ]
|
||||
if (is_apple) {
|
||||
deps += [ "//brave/build/rust:generate_unexport_list" ]
|
||||
}
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
|
||||
@@ -509,12 +509,6 @@ Config.prototype.buildArgs = function () {
|
||||
delete args.gemini_client_secret
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin' || this.targetOS === 'mac' || this.targetOS === 'ios') {
|
||||
// Too many personalities workaround. Will be fixed in llvm
|
||||
// see https://reviews.llvm.org/D135728
|
||||
args.use_lld = false
|
||||
}
|
||||
|
||||
if (this.targetOS === 'ios') {
|
||||
if (this.targetEnvironment) {
|
||||
args.target_environment = this.targetEnvironment
|
||||
|
||||
@@ -4,28 +4,6 @@ if (is_mac) {
|
||||
import("//build/config/mac/mac_sdk.gni")
|
||||
}
|
||||
|
||||
if (is_apple) {
|
||||
unexport_list_path = "$root_build_dir/brave_rust/rust_lib.unexports"
|
||||
}
|
||||
|
||||
# Too many personalities workaround. Will be fixed in llvm see
|
||||
# https://reviews.llvm.org/D135728
|
||||
config("too_many_personalities_workaround") {
|
||||
if (is_apple && !is_component_build && !use_lld) {
|
||||
ldflags = [ "-Wl,-no_compact_unwind" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("strip_rust_symbols") {
|
||||
if (is_apple) {
|
||||
ldflags = [
|
||||
# prevent export of all rust symbols
|
||||
"-Wl,-unexported_symbols_list," +
|
||||
rebase_path(unexport_list_path, root_build_dir),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
cargo_build("rust_lib") {
|
||||
visibility = [ ":*" ]
|
||||
inputs = [
|
||||
|
||||
+18
-11
@@ -12,17 +12,18 @@ import("//build/config/sysroot.gni")
|
||||
declare_args() {
|
||||
rustup_path = rebase_path("//brave/build/rustup")
|
||||
cargo_profile = ""
|
||||
enable_rust_lto = false
|
||||
}
|
||||
|
||||
if (cargo_profile == "") {
|
||||
if (is_debug) {
|
||||
cargo_profile = "dev"
|
||||
} else {
|
||||
if (is_official_build) {
|
||||
cargo_profile = "release"
|
||||
} else {
|
||||
cargo_profile = "dev"
|
||||
}
|
||||
}
|
||||
|
||||
unexport_list_path = "$root_build_dir/brave_rust/rust_lib.unexports"
|
||||
|
||||
rustc_target = ""
|
||||
rustc_toolchain = ""
|
||||
cargo_lib_prefix = ""
|
||||
@@ -44,19 +45,25 @@ if (use_lld) {
|
||||
}
|
||||
}
|
||||
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1188030#c14
|
||||
# Supposedly this bug was fixed, but it's still happening for us.
|
||||
too_many_personality_profiles_workaround =
|
||||
is_apple && use_lld && !is_component_build
|
||||
|
||||
enable_rust_lto = too_many_personality_profiles_workaround
|
||||
|
||||
if (enable_rust_lto) {
|
||||
default_rustflags += [ "-Cembed-bitcode=yes" ]
|
||||
default_rustflags += [ "-Clto" ]
|
||||
} else {
|
||||
default_rustflags += [ "-Cembed-bitcode=no" ]
|
||||
}
|
||||
|
||||
if (is_official_build) {
|
||||
default_rustflags += [ "-Ccodegen-units=1" ]
|
||||
}
|
||||
|
||||
if (is_debug) {
|
||||
default_rustflags += [ "-Copt-level=0" ]
|
||||
if (too_many_personality_profiles_workaround) {
|
||||
# must always be optimized for too_many_personality_profiles_workaround to work
|
||||
default_rustflags += [ "-Copt-level=1" ]
|
||||
} else {
|
||||
default_rustflags += [ "-Copt-level=0" ]
|
||||
}
|
||||
} else if (optimize_for_size) {
|
||||
default_rustflags += [ "-Copt-level=s" ]
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import("//brave/build/rust/config.gni")
|
||||
import("//brave/ios/browser/api/ads/headers.gni")
|
||||
import("//brave/ios/browser/api/brave_shields/headers.gni")
|
||||
import("//brave/ios/browser/api/brave_stats/headers.gni")
|
||||
@@ -18,10 +19,23 @@ import("//brave/ios/browser/api/url/headers.gni")
|
||||
import("//build/config/compiler/compiler.gni")
|
||||
import("//build/config/ios/rules.gni")
|
||||
|
||||
# lld is required when building arm64 with optimization in order to avoid
|
||||
# runtime crashes
|
||||
assert(is_debug || current_cpu != "arm64" || use_lld,
|
||||
"Optimized arm64 iOS builds require lld")
|
||||
|
||||
config("internal_config") {
|
||||
visibility = [ ":*" ]
|
||||
ldflags =
|
||||
[ "-Wl,-rpath,/usr/lib/swift,-rpath,@executable_path/../Frameworks" ]
|
||||
if (!use_lld) {
|
||||
ldflags += [ "-Wl,-no_compact_unwind" ]
|
||||
}
|
||||
ldflags += [
|
||||
# prevent export of all rust symbols
|
||||
"-Wl,-unexported_symbols_list," +
|
||||
rebase_path(unexport_list_path, root_build_dir),
|
||||
]
|
||||
}
|
||||
|
||||
group("brave_ios") {
|
||||
@@ -93,6 +107,7 @@ ios_framework_bundle("brave_core_ios_framework") {
|
||||
|
||||
deps = [
|
||||
":brave_core_umbrella_header",
|
||||
"//brave/build/rust:generate_unexport_list",
|
||||
"//brave/ios/app",
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ def run_cargo(command, args):
|
||||
|
||||
if args.toolchain:
|
||||
toolchains_path = os.path.abspath(
|
||||
os.path.join(rustup_home, 'toolchains', args.toolchain, "bin"))
|
||||
os.path.join(rustup_path, 'toolchains', args.toolchain, "bin"))
|
||||
env['PATH'] = toolchains_path + os.pathsep + env['PATH']
|
||||
|
||||
if args.clang_bin_path is not None and not sys.platform.startswith('win'):
|
||||
|
||||
@@ -8,7 +8,7 @@ import os
|
||||
# Version number and URL for pre-configured rust dependency package
|
||||
# e.g. rust_deps_mac_0.1.0.gz
|
||||
DEPS_PACKAGES_URL = "https://brave-build-deps-public.s3.brave.com"
|
||||
RUST_DEPS_PACKAGE_VERSION = "1.1.0"
|
||||
RUST_DEPS_PACKAGE_VERSION = "1.0.0"
|
||||
MAC_TOOLCHAIN_ROOT = os.path.join(os.path.dirname(os.path.dirname(
|
||||
os.path.dirname(__file__))),
|
||||
'build', 'mac_files')
|
||||
|
||||
Reference in New Issue
Block a user