Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be975c70 authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge changes from topic "pdl-rust-migration"

* changes:
  packetgen: Delete the rust generator
  gd/rust: Migrate to the new pdl rust generator
  floss: Add dependency on pdl-compiler
parents efdf0848 6339e596
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ REQUIRED_APT_PACKAGES = [
]

# List of cargo packages required for linux build
REQUIRED_CARGO_PACKAGES = ['cxxbridge-cmd']
REQUIRED_CARGO_PACKAGES = ['cxxbridge-cmd', 'pdl-compiler']

APT_PKG_LIST = ['apt', '-qq', 'list']
CARGO_PKG_LIST = ['cargo', 'install', '--list']
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ RUN /tmp/rustup.sh -y --default-toolchain 1.68.2
ENV PATH="/root/.cargo/bin:${PATH}"

# Install cargo packages required on build image.
RUN cargo install cxxbridge-cmd --version 1.0.94
RUN cargo install cxxbridge-cmd@1.0.94 pdl-compiler@0.1.1

# Rename llvm packages. By default, they are named 11vm-ar-13, etc. which won't
# work properly with the build.
+3 −47
Original line number Diff line number Diff line
@@ -575,16 +575,9 @@ genrule {

genrule {
    name: "BluetoothGeneratedPackets_rust",
    tools: [
        "bluetooth_packetgen",
    ],
    cmd: "$(location bluetooth_packetgen) --include=packages/modules/Bluetooth/system/gd --out=$(genDir) $(in) --rust",
    srcs: [
        "hci/hci_packets.pdl",
    ],
    out: [
        "hci/hci_packets.rs",
    ],
    defaults: ["pdl_rust_generator_defaults"],
    srcs: ["hci/hci_packets.pdl"],
    out: ["hci/hci_packets.rs"],
}

rust_library {
@@ -634,43 +627,6 @@ rust_test_host {
    ],
}

// Generate and run tests of rust pdl parser for tests packets
genrule {
    name: "TestGeneratedPackets_rust",
    tools: [
        "bluetooth_packetgen",
    ],
    cmd: "$(location bluetooth_packetgen) --include=packages/modules/Bluetooth/system/gd --out=$(genDir) $(in) --rust",
    srcs: [
        "packet/parser/test/rust_test_packets.pdl",
    ],
    out: [
        "packet/parser/test/rust_test_packets.rs",
    ],
}

rust_test_host {
    name: "packets_test_rust",
    defaults: [
        "gd_rust_defaults",
        "mts_defaults",
    ],
    srcs: [
        "rust/packets/test_lib.rs",

        ":TestGeneratedPackets_rust",
    ],
    test_suites: ["general-tests"],
    edition: "2018",
    proc_macros: ["libnum_derive"],
    rustlibs: [
        "libbytes",
        "liblog_rust",
        "libnum_traits",
        "libthiserror",
    ],
}

// Generates binary schema data to be bundled and source file generated
genrule {
    name: "BluetoothGeneratedDumpsysBinarySchema_bfbs",
+0 −7
Original line number Diff line number Diff line
@@ -132,10 +132,3 @@ packetgen_headers("BluetoothGeneratedPackets_h") {
  include = "system/gd"
  source_root = "../.."
}

packetgen_rust("BluetoothGeneratedPackets_rust") {
  sources = [ "hci/hci_packets.pdl" ]

  include = "system/gd"
  source_root = "../.."
}
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ cc_binary_host {
        "fields/variable_length_struct_field.cc",
        "fields/vector_field.cc",
        "gen_cpp.cc",
        "gen_rust.cc",
        "language_l.ll",
        "language_y.yy",
        "main.cc",
Loading