cbor: Adapt for ChromeOS build

The original BUILD.gn was taken from the chromium/src repo:
https://chromium.googlesource.com/chromium/src/+/242df8b64d2a0ab5f057d1d4c76ea8537fdbb789

Modify BUILD.gn to work with ChromeOS platform2 build system, so that
"emerge-<board> cbor" would work (see also the corresponding ebuild CL).
Also modify path of header files since these are no longer under
components/

Also change the copyright author field name to "Chromium OS Authors" but
keep the year, as advised by the opensource licensing team.

BUG=b:144861739
TEST=cros_workon-nocturne start cbor
    FEATURES=test emerge-nocturne cbor
TEST=USE="asan fuzzer" emerge-nocturne cbor
    cros_fuzz --board=nocturne shell
    /usr/libexec/fuzzers/reader_fuzzer
    cros_fuzz --board=nocturne cleanup

Cq-Depend: chromium:2045218
Change-Id: I03dcd6c21e533f414d579bc592126c3f41cff92d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/cbor/+/2045025
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
Commit-Queue: Yicheng Li <yichengli@chromium.org>
16 files changed
tree: a16e39e3ecc61684049081eacad0a2a67cda31e8
  1. reader_fuzzer_corpus/
  2. BUILD.gn
  3. cbor_export.h
  4. constants.h
  5. diagnostic_writer.cc
  6. diagnostic_writer.h
  7. diagnostic_writer_unittest.cc
  8. OWNERS
  9. reader.cc
  10. reader.h
  11. reader_fuzzer.cc
  12. reader_unittest.cc
  13. README.md
  14. values.cc
  15. values.h
  16. values_unittest.cc
  17. writer.cc
  18. writer.h
  19. writer_unittest.cc
README.md

cbor: Concise Binary Object Representation

This library is a partial implementation of the RFC 7049 Concise Binary Object Representation standard.

The source code was fetched from chromium/src (https://chromium.googlesource.com/chromium/src/+/242df8b64d2a0ab5f057d1d4c76ea8537fdbb789) in order to avoid code duplication.

How to update the source

To pull in updates from chromium/src, do the following:

  • git remote add upstream https://chromium.googlesource.com/chromium/src
  • git fetch upstream master
  • git checkout -b staging-branch upstream/master
  • git subtree split -P components/cbor -b synthetic-branch
    • This could take ~2 hours
  • git checkout master
  • git merge --allow-unrelated-histories -s subtree synthetic-branch
    • Resolve merge conflicts, if any.
    • In the commit message of the merge, describe what changes are added, with original commit hash in chromium/src. E.g. using “git checkout staging-branch && git log --oneline components/cbor”
  • git branch -D staging-branch synthetic-branch
  • git remote remove upstream