summaryrefslogtreecommitdiffstats
path: root/build/rust
diff options
context:
space:
mode:
Diffstat (limited to 'build/rust')
-rw-r--r--build/rust/goblin/Cargo.toml19
-rw-r--r--build/rust/mozbuild/generate_buildconfig.py34
-rw-r--r--build/rust/scroll/Cargo.toml17
-rw-r--r--build/rust/scroll/lib.rs11
4 files changed, 68 insertions, 13 deletions
diff --git a/build/rust/goblin/Cargo.toml b/build/rust/goblin/Cargo.toml
index 52e8dfe66d..4b6ea811e9 100644
--- a/build/rust/goblin/Cargo.toml
+++ b/build/rust/goblin/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "goblin"
-version = "0.6.999"
+version = "0.7.999"
edition = "2018"
license = "MIT/Apache-2.0"
@@ -8,4 +8,19 @@ license = "MIT/Apache-2.0"
path = "lib.rs"
[dependencies.goblin]
-version = "0.7.0"
+version = "0.8.0"
+
+default-features = false
+
+[features]
+alloc = ["goblin/alloc"]
+archive = ["goblin/archive"]
+default = ["goblin/default"]
+elf32 = ["goblin/elf32"]
+elf64 = ["goblin/elf64"]
+endian_fd = ["goblin/endian_fd"]
+mach32 = ["goblin/mach32"]
+mach64 = ["goblin/mach64"]
+pe32 = ["goblin/pe32"]
+pe64 = ["goblin/pe64"]
+std = ["goblin/std"]
diff --git a/build/rust/mozbuild/generate_buildconfig.py b/build/rust/mozbuild/generate_buildconfig.py
index 09c32c37fd..ace7db891a 100644
--- a/build/rust/mozbuild/generate_buildconfig.py
+++ b/build/rust/mozbuild/generate_buildconfig.py
@@ -13,6 +13,20 @@ def generate_bool(name):
return f"pub const {name}: bool = {'true' if value else 'false'};\n"
+def generate_string_array(name):
+ value = buildconfig.substs.get(name) or []
+ return (
+ f"pub const {name}: [&str; {len(value)}] = ["
+ + ",".join(map(escape_rust_string, value))
+ + "];\n"
+ )
+
+
+def generate_string(name):
+ value = buildconfig.substs.get(name) or ""
+ return f"pub const {name}: &str = {escape_rust_string(value)};\n"
+
+
def escape_rust_string(value):
"""escape the string into a Rust literal"""
# This could be more generous, but we're only escaping paths with it.
@@ -34,14 +48,6 @@ def escape_rust_string(value):
return '"%s"' % result
-def generate_string(buildvar, output):
- buildconfig_var = buildconfig.substs.get(buildvar)
- if buildconfig_var is not None:
- output.write(
- f"pub const {buildvar}: &str = {escape_rust_string(buildconfig_var)};\n"
- )
-
-
def generate(output):
# Write out a macro which can be used within `include!`-like methods to
# reference the topobjdir.
@@ -94,10 +100,10 @@ def generate(output):
)
# Write out some useful strings from the buildconfig.
- generate_string("MOZ_MACBUNDLE_ID", output)
- generate_string("MOZ_APP_NAME", output)
+ output.write(generate_string("MOZ_MACBUNDLE_ID"))
+ output.write(generate_string("MOZ_APP_NAME"))
- # Finally, write out some useful booleans from the buildconfig.
+ # Write out some useful booleans from the buildconfig.
output.write(generate_bool("MOZ_FOLD_LIBS"))
output.write(generate_bool("NIGHTLY_BUILD"))
output.write(generate_bool("RELEASE_OR_BETA"))
@@ -105,3 +111,9 @@ def generate(output):
output.write(generate_bool("MOZ_DEV_EDITION"))
output.write(generate_bool("MOZ_ESR"))
output.write(generate_bool("MOZ_DIAGNOSTIC_ASSERT_ENABLED"))
+
+ # Used by toolkit/crashreporter/client
+ output.write(generate_bool("MOZ_CRASHREPORTER_MOCK"))
+ output.write(generate_string_array("CC_BASE_FLAGS"))
+ output.write(generate_string_array("MOZ_GTK3_CFLAGS"))
+ output.write(generate_string_array("MOZ_GTK3_LIBS"))
diff --git a/build/rust/scroll/Cargo.toml b/build/rust/scroll/Cargo.toml
new file mode 100644
index 0000000000..dea2c21fd1
--- /dev/null
+++ b/build/rust/scroll/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "scroll"
+version = "0.11.999"
+edition = "2018"
+license = "MIT/Apache-2.0"
+
+[lib]
+path = "lib.rs"
+
+[dependencies.scroll]
+version = "0.12.0"
+default-features = false
+
+[features]
+default = ["scroll/default"]
+derive = ["scroll/derive"]
+std = ["scroll/std"]
diff --git a/build/rust/scroll/lib.rs b/build/rust/scroll/lib.rs
new file mode 100644
index 0000000000..f7d352d6d2
--- /dev/null
+++ b/build/rust/scroll/lib.rs
@@ -0,0 +1,11 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub use scroll::*;