-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
229 lines (186 loc) · 5.62 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
[workspace]
members = ["crates/kotlin-ffi", "crates/yttrium", "crates/yttrium_dart/rust"]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.79"
license = "Apache-2.0"
[workspace.dependencies]
# Errors/Result
eyre = { version = "0.6.12", features = ["default"], default-features = false }
thiserror = { version = "1.0", default-features = false }
# Async
tokio = { version = "1.17", default-features = false }
futures = { version = "0.3.31", default-features = false }
# Networking
reqwest = { version = "0.12.5", features = ["json"], default-features = false }
# Serialization
serde = { version = "1.0", features = ["derive"], default-features = false }
serde_json = { version = "1.0", default-features = false }
# Logging
oslog = { version = "0.2.0", default-features = false }
log = { version = "0.4.20", default-features = false }
alloy = { version = "0.9.2", default-features = false }
alloy-provider = { version = "0.9.2", default-features = false }
erc6492 = { git = "https://github.com/reown-com/erc6492.git", rev = "703016d", default-features = false }
relay_rpc = { git = "https://github.com/WalletConnect/WalletConnectRust.git", rev = "51e984e", default-features = false }
serial_test = { version = "3.2.0", default-features = false }
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "7cb2532", default-features = false }
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "7cb2532", default-features = false, features = ["tokio"] }
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "7cb2532", default-features = false }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
tsify-next = "0.5.4"
# Used by WASM ONLY, since wasm-pack doesn't support custom profiles
# https://github.com/rustwasm/wasm-pack/issues/1461
[profile.release]
lto = true # Seems to make it slightly larger actually
opt-level = 'z'
codegen-units = 1
strip = true
# Default according to https://doc.rust-lang.org/cargo/reference/profiles.html#release
# We would inherit from the real release profile, but wasm-pack needs to use this above and we need to customize it
[profile.release-base]
inherits = "release"
opt-level = 3
debug = false
# split-debuginfo = '...' # Platform-specific.
strip = "none"
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false
[profile.kotlin-release-next]
inherits = "profile10-nostrip"
[profile.swift-release-next]
inherits = "profile9"
# [profile.wasm-release-next]
# inherits = "profile10-nostrip"
# For building release-optimized binaries for UniFFI bindings
[profile.uniffi-release]
inherits = "uniffi-release-v1"
[profile.uniffi-release-v2] # Simply turns off debugging
inherits = "uniffi-release-v1"
debug = false
# TODO: consider more profiles for Kotlin vs Swift, and for Flutter, etc.
[profile.uniffi-release-v1]
# The values have been configured this way to prevent crashes in Swift debug builds with the default settings.
inherits = "release-base"
debug = true
lto = true
opt-level = 0
codegen-units = 1
# panic = "abort"
# strip = true - it removes kotlin-bindings
# What we should aim for short-term
[profile.uniffi-release-next]
inherits = "profile8"
# profile7-nightly-stdopt
[profile.uniffi-release-kotlin]
inherits = "profile11"
[profile.uniffi-release-iter1] # first iteration, changes opt-level to 3
inherits = "release-base"
debug = true
lto = true
opt-level = 3
codegen-units = 1
[profile.uniffi-release-iter2] # same as profile6
inherits = "release-base"
lto = true
opt-level = 3
codegen-units = 1
[profile.uniffi-release-iter3] # same as profile7
inherits = "release-base"
lto = true
opt-level = 3
codegen-units = 1
strip = true
[profile.uniffi-release-iter4]
inherits = "release-base"
lto = true
opt-level = 3
codegen-units = 1
strip = true
# profile7-nightly
[profile.uniffi-release-iter5]
inherits = "release-base"
lto = true
opt-level = 3
codegen-units = 1
strip = true
# profile7-nightly-stdopt
[profile.profile1]
inherits = "release-base"
debug = true
opt-level = 0
[profile.profile2]
inherits = "release-base"
opt-level = 0
[profile.profile21]
inherits = "release-base"
opt-level = 1
[profile.profile22]
inherits = "release-base"
opt-level = 2
[profile.profile3]
inherits = "release-base"
opt-level = 3
[profile.profile4]
inherits = "release-base"
opt-level = "z"
[profile.profile5]
inherits = "release-base"
opt-level = 3
codegen-units = 1
[profile.profile6]
inherits = "release-base"
opt-level = 3
codegen-units = 1
lto = true
[profile.profile7]
inherits = "release-base"
opt-level = 3
codegen-units = 1
lto = true
strip = true
[profile.profile8]
inherits = "release-base"
opt-level = 3
codegen-units = 1
lto = true
panic = "abort"
[profile.profile9]
inherits = "release-base"
opt-level = 3
codegen-units = 1
lto = true
strip = true
panic = "abort"
[profile.profile10]
inherits = "release-base"
opt-level = "z"
codegen-units = 1
lto = true
strip = true
panic = "abort"
[profile.profile11]
inherits = "release-base"
opt-level = "z"
codegen-units = 1
lto = true
panic = "abort"
[profile.profile10-nostrip]
inherits = "profile10"
strip = false
# Optimise libstd: https://github.com/johnthagen/min-sized-rust?tab=readme-ov-file#optimize-libstd-with-build-std
# Compress the binary (not library?): https://github.com/johnthagen/min-sized-rust?tab=readme-ov-file#compress-the-binary
# Questions:
# What flags cause crash in prod Swift?
# Can we use strip=true? Kotlin previously removed
# Can we use panic=abort? I think for now we shouldn't due to incomplete error handling coverage, but we should in the future
# [patch."https://github.com/reown-com/erc6492.git"]
# erc6492 = { path = "../erc6492-rs" }