Skip to content

Commit

Permalink
Update filecoin-cxx deps, mainly multihash reland (#25666)
Browse files Browse the repository at this point in the history
Update `filecoin-cxx` deps, mainly `multihash`

This change is a first pass in getting the dependecies for
`filecoin-cxx` updated, to eventually be able to drop the unmaintained
crate `proc-macro-error`.

This change updates `multihash` to `v0.16.3`->`v0.18.1`. In a follow up
PR, the goal will be to deploy `v0.19.1`, which drops the unwanted crate
as a transient dependency.

---------

Co-authored-by: Ralph Giles <rgiles@brave.com>
Co-authored-by: Claudio DeSouza <cdesouza@brave.com>
  • Loading branch information
3 people committed Sep 20, 2024
1 parent c018fc3 commit cf10198
Show file tree
Hide file tree
Showing 320 changed files with 1,706 additions and 8,563 deletions.
6 changes: 3 additions & 3 deletions components/filecoin/rs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ rust_static_library("rust_lib") {
deps = [
"//brave/third_party/rust/blake2b_simd/v1:lib",
"//brave/third_party/rust/bls_signatures/v0_12:lib",
"//brave/third_party/rust/cid/v0_8:lib",
"//brave/third_party/rust/cid/v0_10:lib",
"//brave/third_party/rust/forest_bigint/v0_1:lib",
"//brave/third_party/rust/fvm_ipld_encoding/v0_3:lib",
"//brave/third_party/rust/fvm_ipld_encoding/v0_4:lib",
"//brave/third_party/rust/fvm_shared/v3:lib",
"//brave/third_party/rust/libsecp256k1/v0_7:lib",
"//brave/third_party/rust/multihash/v0_16:lib",
"//brave/third_party/rust/multihash/v0_18:lib",
"//brave/third_party/rust/thiserror/v1:lib",
"//third_party/rust/base64/v0_13:lib",
"//third_party/rust/serde/v1:lib",
Expand Down
8 changes: 4 additions & 4 deletions components/filecoin/rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ license = "MPL-2.0"
base64 = "0.13.0"
bls-signatures = { version = "0.12", default-features = false, features = ["pairing"] }
cxx = "1"
fvm_shared = { version = "3.3.0" }
fvm_shared = { version = "3.10.0" }
libsecp256k1 = "0.7"
num_bigint_chainsafe = { package = "forest_bigint", version = "0.1.2"}
serde = { version = "^1.0.117", features = ["derive"] }
serde_json = "^1.0.59"
thiserror = "^1.0.30"
blake2b_simd = "1"
cid = { version = "0.8.5", default-features = false }
multihash = { version="0.16.3", default-features = false, features = [ "multihash-impl", "blake2b"] }
fvm_ipld_encoding = "0.3"
cid = { version = "0.10", default-features = false }
multihash = { version = "0.18.0", default-features = false, features = [ "multihash-impl", "blake2b"] }
fvm_ipld_encoding = "0.4"

[lib]
name = "filecoin_cxx"
Expand Down
10 changes: 10 additions & 0 deletions patches/third_party-rust-bitflags-v2-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/third_party/rust/bitflags/v2/BUILD.gn b/third_party/rust/bitflags/v2/BUILD.gn
index f52c4678d14fa0b3b50610f1ee0fb59338189c7e..f5140efd3848d6ad55693edc295de074b44caf22 100644
--- a/third_party/rust/bitflags/v2/BUILD.gn
+++ b/third_party/rust/bitflags/v2/BUILD.gn
@@ -67,4 +67,5 @@ cargo_crate("lib") {
executable_configs += [ "//build/config/compiler:no_chromium_code" ]
proc_macro_configs -= [ "//build/config/compiler:chromium_code" ]
proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ]
+ deps = [ "//third_party/rust/serde/v1:lib" ] features = [ "serde" ]
}
1 change: 1 addition & 0 deletions script/brave_license_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def AddBraveCredits(root, prune_paths, special_cases, prune_dirs,
os.path.join('brave', 'third_party', 'rust', 'aho_corasick'),
os.path.join('brave', 'third_party', 'rust', 'anyhow'),
os.path.join('brave', 'third_party', 'rust', 'base64'),
os.path.join('brave', 'third_party', 'rust', 'bitflags'),
os.path.join('brave', 'third_party', 'rust', 'cfg_if'),
os.path.join('brave', 'third_party', 'rust', 'cxx'),
os.path.join('brave', 'third_party', 'rust', 'cxxbridge_flags'),
Expand Down
32 changes: 2 additions & 30 deletions third_party/rust/bitflags/v1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.

# @generated from third_party/rust/chromium_crates_io/BUILD.gn.hbs by
# tools/crates/gnrt.
# Do not edit!

import("//build/rust/cargo_crate.gni")

cargo_crate("lib") {
crate_name = "bitflags"
epoch = "1"
crate_type = "rlib"
crate_root = "//brave/third_party/rust/chromium_crates_io/vendor/bitflags-1.3.2/src/lib.rs"
sources = [
"//brave/third_party/rust/chromium_crates_io/vendor/bitflags-1.3.2/src/example_generated.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/bitflags-1.3.2/src/lib.rs",
]
inputs = []

build_native_rust_unit_tests = false
edition = "2018"
cargo_pkg_version = "1.3.2"
cargo_pkg_authors = "The Rust Project Developers"
cargo_pkg_name = "bitflags"
cargo_pkg_description =
"A macro to generate structures which behave like bitflags."
library_configs -= [ "//build/config/compiler:chromium_code" ]
library_configs += [ "//build/config/compiler:no_chromium_code" ]
executable_configs -= [ "//build/config/compiler:chromium_code" ]
executable_configs += [ "//build/config/compiler:no_chromium_code" ]
proc_macro_configs -= [ "//build/config/compiler:chromium_code" ]
proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ]
group("lib") {
public_deps = [ "//third_party/rust/bitflags/v1:lib" ]
}
10 changes: 0 additions & 10 deletions third_party/rust/bitflags/v1/README.chromium

This file was deleted.

8 changes: 8 additions & 0 deletions third_party/rust/bitflags/v2/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 The Brave Authors. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.

group("lib") {
public_deps = [ "//third_party/rust/bitflags/v2:lib" ]
}
67 changes: 26 additions & 41 deletions third_party/rust/chromium_crates_io/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions third_party/rust/chromium_crates_io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ package = "anyhow"
path = "../../../../third_party/rust/chromium_crates_io/vendor/base64-0.13.1"
package = "base64"

[patch.crates-io.bitflags_v1]
path = "../../../../third_party/rust/chromium_crates_io/vendor/bitflags-1.3.2"
package = "bitflags"

[patch.crates-io.bitflags_v2]
path = "../../../../third_party/rust/chromium_crates_io/vendor/bitflags-2.6.0"
package = "bitflags"

[patch.crates-io.cfg-if_v1]
path = "../../../../third_party/rust/chromium_crates_io/vendor/cfg-if-1.0.0"
package = "cfg-if"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/chromium_crates_io/gnrt_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ extra_build_script_src_roots = [ "entities.rs" ]
build_script_outputs = [ "generated.rs", "named_entities.rs", ]

[crate.multihash]
extra_kv = { rustenv = [ "CARGO_MANIFEST_DIR=\" + rebase_path(\"//brave/third_party/rust/chromium_crates_io/vendor/multihash-0.16.3\") + \"" ]}
extra_kv = { rustenv = [ "CARGO_MANIFEST_DIR=\" + rebase_path(\"//brave/third_party/rust/chromium_crates_io/vendor/multihash-0.18.1\") + \"" ]}

[crate.num-bigint]
extra_input_roots = [ "../README.md" ]
Expand Down

This file was deleted.

Loading

0 comments on commit cf10198

Please sign in to comment.