Skip to content

Fix d/copyright - refresh copyright and generate 3rd party lines

Ahmad Khalifa requested to merge ahmadkhalifa/chromium:fix-d-copyright into master

d/copyright is currently producing ~3000 lintian warnings/errors

This is an attempt to fix it by dividing upstream source into two categories:

  1. Chromium source: most dirs outside third_party/ (~166745 files)
    • Most of Chromium source is licensed as BSD-3-clause with few exceptions, so those can be managed manually with a few checks
    • Running lrc produces ~100 false-positives
    • This also accounts for 'third_party' dirs deep inside base source (e.g. base/third_party/*)
  2. Third-party (3P) embedded source: third_party/* (~218916 files)
    • Large variation in licenses used here.
    • Complicated by the updates done by the chromium team on top of 3P code where they either add files with their copyright or even update files and attach their copyright
    • To manage 218K files manually is impossible as every release brings large add/rm/mv changes
    • Leaving the option to automate the extraction of Copyright and Licenses for 3P files

This MR adds a template copyright (d/copyright.in) and a makefile (d/scripts/copyright.makefile) that can be used to generate the real d/copyright file combining manually-managed copyright headers (Files-Excluded, etc..) + manually-managed chromium source licenses + automatically generated 3P licenses.

Generating the Copyright and License is done using 'licensecheck' and the generated 3P license section is a single License/Copyright stanza covering all of third_party/* (with few manual exceptions).

The new copyright is referred to as Various-3P-Licenses and it lists all licenses together as it's not possible to be granular about the licenses without listing 218K files separately.

Why not use (decopy, licensecheck, licenserecon, ...) to generate the license accurately?

Several reasons: chromium source embedded in 3P source and 3P source embedded in 3P source. E.g.

  • third_party/afl/BUILD.gn (Chromium inside Apache-2.0 project)
  • third_party/webrtc/rtc_base/third_party/* (3P inside 3P)
  • BUILD.gn is a good example of same-name, different license. Sane person would expect it to always be BSD-3-clause, but:
    • third_party/perfetto/gn/BUILD.gn (Apache-2.0)

This makes globbing impossible and the only way is to list all files individually in their own stanzas (this would be a 30M+ file) or group them together as a single block 'Various-3P-Licenses' for debian and providing the source, the reader is responsible for narrowing down the license to only 1-2 out of the big block of Various-3P-Licenses based on file header.

Notes:

  • trixie licensecheck stopped recognising SGI-B* licenses for some reason. OpenGL headers are in several places, the ones in Chromium Source are manually added, but 3P ones are not recognised.
  • Further fine tuning might be needed or additional manual overrides

Merge request reports

Loading