and linux distributions chromium · chromium: why it isn't in fedora yet as a proper package...

27
Chromium and Linux Distributions Paweł Hajdan, Jr.

Upload: others

Post on 05-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

Chromiumand Linux Distributions

Paweł Hajdan, Jr.

Page 2: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

https://www.flickr.com/photos/mtaphotos/6483098881

Page 3: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries
Page 4: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

Chromium: Why it isn't in Fedora yet as a proper package (2009)

● not stable● forked libraries

Page 5: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

not stable

● no releases○ first one in May 2010

● code pulled from SVN○ source tarballs on GS since 2011 (190 - 250 MB)

● remerging patches○ upstream your patches

● two days of work○ ~ half an hour with almost no patches

Page 6: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

forked libraries (1 / 3)

● no “system libraries” on Windows or Mac

● diligent about third_party directories○ compare to e.g. media/libopus in Firefox○ allows whitelist-based removal of third party code

Page 7: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

forked libraries (2 / 3)

● system libraries not supported by upstream○ not a problem in practice

● rebuttals Tom heard are just opinions○ “we move too fast”○ “we need specific version”○ also, e.g. sandbox support

Page 8: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

forked libraries (3 / 3)package Chrome Gentoo stable

jinja 2.7.1 2.7.3

libevent 1.4.13 2.0.21

libpng 1.2.45 1.2.51 / 1.6.12

libxml 2.7.7 2.9.1

zlib 1.2.5 1.2.8

Page 9: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

notable bundled libraries

● ffmpeg● hunspell● mesa● sqlite

Page 10: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

ffmpeg

● moves too fast● Chromium developers work with upstream● technically could work

Page 11: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

hunspell

● incompatible fork● changed dictionary format (bdict)● other changes, some upstreamed● upstream somewhat slow to respond● why CVS?

Page 12: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

mesa

● incompatible fork● type mismatch on 32-bit

○ typedef ptrdiff_t GLsizeiptr; (GL/glext.h)○ typedef signed long int khronos_intptr_t; (khrplatform.h)

● why not glew?○ no support for GLES2○ no support for Chromium extensions○ was in fact using glew, although patched

Page 13: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

sqlite

● incompatible fork● changed os_unix.c for sandboxed WebSQL● Chromium unlikely to do specific VFS● sqlite unlikely to make changes● WebSQL deprecated but still used

Page 14: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

libraries not designed for reuse

● JS libraries like polymer, jszip● ASM bits e.g. x86inc● libyuv, skia, qcms, webrtc● libwebm

Page 15: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

libraries that need more work (1 / 2)

● iccjpeg○ lcms and libjpeg-turbo don’t want it

● libsrtp○ need to update upstream copy, release & test

● libvpx○ needs to make a release

Page 16: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

libraries that need more work (2 / 2)

● libusb○ discussion on upstream ML

● opus○ audio classifier not part of public API

Page 17: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

notable unbundled libraries● bzip2● flac● harfbuzz● icu● jsoncpp● libevent● libjpeg● libpng● libwebp

● libxml● libsxlt● minizip● protobuf● re2● snappy● speex● zlib

Page 18: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

enter build/linux/unbundle

● created in 2013● used by Arch, Gentoo, BSDs● easy to make changes

Page 19: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

remove_bundled_libraries.pybuild/linux/unbundle/remove_bundled_libraries.py \

'third_party/ffmpeg' \'third_party/hunspell' \'third_party/leveldatabase' \'third_party/mesa' \'third_party/trace-viewer/third_party/jszip' \'third_party/trace-viewer/third_party/tvcm/third_party/polymer' \

--do-remove || die

FYI in Gentoo this has almost 100 lines.

Page 20: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

generate_shim_headers.py (1 / 3)

#include "third_party/libpng/png.h"

can’t change that line!

what now?

Page 21: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

generate_shim_headers.py (2 / 3)out/Release/gen/shim_headers/libpng/target

└── third_party

└── libpng

├── pngconf.h

└── png.h

#include <png.h>

Page 22: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

generate_shim_headers.py (3 / 3)

● can use #pragma push_macro○ e.g. POSIX -> POSIX_SYNTAX in re2

● can use #include_next○ was used for system mesa (infinite recursion)

● can include additional headers before / after○ keep additions separate, e.g. Chromium extensions

Page 23: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

replace_gyp_files.py{ 'targets': [ {

'target_name': 'libpng', 'type': 'none',

'dependencies': [ '../zlib/zlib.gyp:zlib', ],

'direct_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags libpng)', ], },

'link_settings': {

'ldflags': [ '<!@(pkg-config --libs-only-L --libs-only-other libpng)', ],

'libraries': [ '<!@(pkg-config --libs-only-l libpng)', ],

},

'variables': {

'headers_root_path': '.',

'header_filenames': [ 'png.h', 'pngconf.h', ],

},

'includes': [ '../../build/shim_headers.gypi', ],

}, ], }

Page 24: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

contributions are welcome

● 2382 unique committers, 53 unique domains○ 1806 @chromium.org○ 638 @google.com○ 157 @gmail.com○ 123 @samsung.com○ 64 @intel.com○ 63 @opera.com○ 28 @yandex-team.ru○ 13 @motorola.com

Page 25: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

contributions are welcome

● Google CLA is not a copyright assignment○ Compare to Fedora Project Contributor Agreement

● some FreeBSD / OpenBSD bits upstreamed● MIPS bits upstreamed● Wayland/Ozone using a hybrid approach● often just need bandwidth

Page 26: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

https://www.flickr.com/photos/mtaphotos/6483098041

Page 27: and Linux Distributions Chromium · Chromium: Why it isn't in Fedora yet as a proper package (2009) not stable forked libraries

Q & A

[email protected]

[email protected]

Thank you!