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

Commit bac69c54 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I3ccf85d5,I731adcff,I6f5f9cec,I9f773287,Iabf796dc, ...

* changes:
  Update gitignore for Cargo.lock and tags
  Use local rules for flex/bison
  Specify bt_shim_ffi dependency to bluetoothtbd
  Fix rust build in build.py
  Avoid const value_type of vector
  Guard printing PKG_CONFIG_PATH in build.py
  Add missing #include <string.h> for memcpy
  Fix packetgen outputs
parents b051c7eb 9786447b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
buildtools
out
third_party
third_party/
target/
Cargo.lock
tags
+12 −4
Original line number Diff line number Diff line
@@ -288,6 +288,7 @@ class HostBuild():
            self._gn_default_output(),
        ]

        if 'PKG_CONFIG_PATH' in self.env:
            print('DEBUG: PKG_CONFIG_PATH is', self.env['PKG_CONFIG_PATH'])

        self.run_command('configure', gn_args)
@@ -317,6 +318,8 @@ class HostBuild():
        replace-with = "systembt"
        local-registry = "/nonexistent"
        """

        if self.args.vendored_rust:
            contents = template.format(self.platform_dir)
            with open(os.path.join(self.env['CARGO_HOME'], 'config'), 'w') as f:
                f.write(contents)
@@ -348,6 +351,10 @@ class HostBuild():
        """ Build rust artifacts in an already prepared environment.
        """
        self._rust_build()
        rust_dir = os.path.join(self._gn_default_output(), 'rust')
        if os.path.exists(rust_dir):
            shutil.rmtree(rust_dir)
        shutil.copytree(os.path.join(self.output_dir, 'debug'), rust_dir)

    def _target_main(self):
        """ Build the main GN artifacts in an already prepared environment.
@@ -406,6 +413,7 @@ if __name__ == '__main__':
    parser.add_argument('--libdir', help='Libdir - default = usr/lib64', default='usr/lib64')
    parser.add_argument('--use-board', help='Use a built x86 board for dependencies. Provide path.')
    parser.add_argument('--jobs', help='Number of jobs to run', default=0, type=int)
    parser.add_argument('--vendored-rust', help='Use vendored rust crates', default=False, action="store_true")
    parser.add_argument('--verbose', help='Verbose logs for build.')

    args = parser.parse_args()
+2 −2
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ bool LoadBinarySchema(const char* filename, std::string* binary_schema) {
 *
 * @return: True if operation successful, false otherwise.
 */
bool VerifyBinarySchema(const std::vector<const uint8_t>& raw_schema) {
bool VerifyBinarySchema(const std::vector<uint8_t>& raw_schema) {
  flatbuffers::Verifier verifier(raw_schema.data(), raw_schema.size());
  if (!reflection::VerifySchemaBuffer(verifier)) {
    return false;
@@ -89,7 +89,7 @@ bool CreateBinarySchemaBundle(
      fprintf(stderr, "Unable to load binary schema from filename:%s\n", filename.c_str());
      return false;
    }
    std::vector<const uint8_t> raw_schema(string_schema.begin(), string_schema.end());
    std::vector<uint8_t> raw_schema(string_schema.begin(), string_schema.end());
    if (!VerifyBinarySchema(raw_schema)) {
      fprintf(stderr, "Failed verification on binary schema filename:%s\n", filename.c_str());
      return false;
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include "flatbuffers/flatbuffers.h"

bool LoadBinarySchema(const char* filename, std::string* binary_schema);
bool VerifyBinarySchema(const std::vector<const uint8_t>& raw_schema);
bool VerifyBinarySchema(const std::vector<uint8_t>& raw_schema);
bool CreateBinarySchemaBundle(
    flatbuffers::FlatBufferBuilder* builder,
    const std::vector<std::string>& filenames,
@@ -48,10 +48,10 @@ TEST_F(BundlerTest, LoadBinarySchema) {
TEST_F(BundlerTest, VerifyBinarySchema) {
  std::string string_schema;
  ASSERT_TRUE(LoadBinarySchema("test.bfbs", &string_schema));
  std::vector<const uint8_t> raw_schema(string_schema.begin(), string_schema.end());
  std::vector<uint8_t> raw_schema(string_schema.begin(), string_schema.end());
  ASSERT_TRUE(VerifyBinarySchema(raw_schema));

  std::vector<const uint8_t> bogus_raw_schema(string_schema.begin() + 1, string_schema.end());
  std::vector<uint8_t> bogus_raw_schema(string_schema.begin() + 1, string_schema.end());
  ASSERT_FALSE(VerifyBinarySchema(bogus_raw_schema));
}

+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@
#  limitations under the License.
#

import("//common-mk/bison.gni")
import("//common-mk/flex.gni")
import("flex.gni")
import("bison.gni")

config("pktgen_configs") {
  include_dirs = [ "//bt/gd/packet/parser" ]
Loading