Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chromium: Depend on libstd-rs instead of rust #809

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require gn-utils.inc

GTKIC_VERSION = "${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '4', '3',d)}"

inherit features_check gtk-icon-cache qemu
inherit features_check gtk-icon-cache qemu rust-common

# The actual directory name in out/ is irrelevant for GN.
OUTPUT_DIR = "out/Release"
Expand Down Expand Up @@ -72,6 +72,7 @@ DEPENDS += " \
jpeg \
libdrm \
libffi \
libstd-rs \
libwebp \
libxkbcommon \
libxslt \
Expand All @@ -86,7 +87,6 @@ DEPENDS += " \
pkgconfig-native \
${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
qemu-native \
rust \
rust-native \
virtual/libgl \
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Signed-off-by: Max Ihlenfeldt <[email protected]>
build/config/rust.gni | 24 +++++++++++++++++------
build/rust/rustc_wrapper.py | 1 +
build/rust/std/BUILD.gn | 33 ++++++++++++++++++++++++--------
build/rust/std/find_std_rlibs.py | 13 ++++++++++---
4 files changed, 54 insertions(+), 17 deletions(-)
build/rust/std/find_std_rlibs.py | 16 +++++++++++-----
4 files changed, 55 insertions(+), 19 deletions(-)

diff --git a/build/config/rust.gni b/build/config/rust.gni
index e98d913..6213b72 100644
Expand Down Expand Up @@ -166,9 +166,18 @@ index 77f4b8c..8a25798 100644
# The host builds tools toolchain supports Rust only and does not use
# the allocator remapping to point it to PartitionAlloc.
diff --git a/build/rust/std/find_std_rlibs.py b/build/rust/std/find_std_rlibs.py
index 386258f..25fdedc 100755
index 386258f..3bb6a41 100755
--- a/build/rust/std/find_std_rlibs.py
+++ b/build/rust/std/find_std_rlibs.py
@@ -17,7 +17,7 @@ import re
from collections import defaultdict

EXPECTED_STDLIB_INPUT_REGEX = re.compile(r"([0-9a-z_]+)(?:-([0-9]+))?$")
-RLIB_NAME_REGEX = re.compile(r"lib([0-9a-z_]+)-([0-9a-f]+)\.rlib$")
+RLIB_NAME_REGEX = re.compile(r"lib([0-9a-z_]+)(-([0-9a-f]+))?\.rlib$")


def main():
@@ -52,6 +52,8 @@ def main():
rustc_args.extend(["--target", args.target])
rustlib_dir = subprocess.check_output(rustc_args).rstrip().decode()
Expand All @@ -187,7 +196,16 @@ index 386258f..25fdedc 100755

def copy_file(infile, outfile):
depfile.write(f" {infile}")
@@ -117,14 +119,19 @@ def main():
@@ -99,7 +101,7 @@ def main():
# the correct file path to our linker invocations, we don't need
# that, and it would prevent us having the predictable filenames
# which we need for statically computable gn dependency rules.
- (crate_name, metadata) = RLIB_NAME_REGEX.match(f).group(1, 2)
+ (crate_name, metadata) = RLIB_NAME_REGEX.match(f).group(1, 3)

# Use the number of times we've seen this name to disambiguate the output
# filenames. Since we sort the input filenames including the metadata,
@@ -117,14 +119,18 @@ def main():
output_filename = f"lib{concise_name}.rlib"

infile = os.path.join(rustlib_dir, f)
Expand All @@ -201,9 +219,8 @@ index 386258f..25fdedc 100755
+ outfile = os.path.join(lib_output_dir, f)
copy_file(infile, outfile)

+ f = 'target.json'
+ infile = os.path.join(rustlib_dir, '..', f)
+ outfile = os.path.join(args.output, f)
+ infile = os.path.join(os.environ['RUST_TARGET_PATH'], f'{args.target}.json')
+ outfile = os.path.join(args.output, 'target.json')
+ copy_file(infile, outfile)
+
depfile.write("\n")
Expand Down
26 changes: 0 additions & 26 deletions meta-chromium/recipes-browser/chromium/rust_%.bbappend

This file was deleted.