maximbaz / pkgbuild-brave-vaapi

2 stars 0 forks source link

Packaging Brave with VA-API for Arch Linux #1

Closed maximbaz closed 5 years ago

maximbaz commented 5 years ago

@akarshanbiswas you asked to extract discussion out of https://github.com/brave/brave-browser/pull/4039, so here's a new thread and a new repo.

The PKGBUILD you see in here was the one I used to test your PR :)

My main objective is to find out how much more difficult it would be to maintain brave-vaapi comparing to chromium-vaapi, in particular what if community comes up with a Chromium patch that Chromium refuses to merge upstream, how to apply this patch to Brave during the packaging phase? We could use your latest vaapi-fix.patch as an example of a patch that needs to be applied.

By the way, are you the Fedora maintainer of Chromium and/or Brave package? If so, I imagine you'd need to find answers to the same questions for Fedora?

qnixsynapse commented 5 years ago

Yes. I'm a maintainer of chromium on Fedora (RPMFUSION).

I will work on it either tomorrow or this weekend. Thanks for settling up this repository :)

qnixsynapse commented 5 years ago

@maximbaz Can you help me with the second patch, I'm running out of disk space trying to download the entire chromium source.

maximbaz commented 5 years ago

Done @akarshanbiswas, the patches are being successfully applied. Our next and final problem is actually getting the build command to succeed: https://github.com/brave/brave-browser/issues/305#issuecomment-504222028

I assume npm run create_dist Release --debug_build=false --official_build=true is the right command, but I've never seen what it actually produces, as the compilation fails.

npm run build Release seems to produce something, but there's waay to much stuff in src/out/Release folder. I guess we could just try to pick the files that are necessary and package only them, it seems our extra/chromium is doing exactly this...

What's your suggestion?

qnixsynapse commented 5 years ago

@maximbaz We need to disable distro check. Please refer this patch

maximbaz commented 5 years ago

I see, yeah makes sense... Let me know if you have time to prepare the patch, otherwise I'll try to get it later myself.

I also realized that we'd probably want to replace bundled dependencies with system ones, isn't that right?

qnixsynapse commented 5 years ago

@maximbaz To get the patch, wget -O fixbuild.patch "https://github.com/brave/brave-core/pull/149/commits/248fd148b5aa589281ee099f461c7b16dd480d31.patch"

I also realized that we'd probably want to replace bundled dependencies with system ones, isn't that right?

Way too much work. Have to do some serious modification in brave's npm build system.

Edit: I think we should ask brave devs for the easy command line arguments or something,

maximbaz commented 5 years ago

ok I see, it's a patch over a patch in brave-core repo, I pushed something that might work, will kick off a build to test.

Way too much work. Have to do some serious modification in brave's npm build system.

Makes sense.

Edit: I think we should ask brave devs for the easy command line arguments or something,

To specify which libs not to bundle, or what do you have in mind?

qnixsynapse commented 5 years ago

@maximbaz Please do not start the build yet. There is some confusion over the patch.

Edit: sigh They added the patch for the toggle and then removed it. I have to add and recreate the patch.

maximbaz commented 5 years ago

Ideally we should create patch for chromium itself, not for brave-core, or it becomes a bit complicated to apply it.

Because the npm run init first clones brave-core and then immediately applies all patches from that repo, so we have no time to add or change anything in brave-core repo.

qnixsynapse commented 5 years ago

@maximbaz There should be a patch for brave-browser in config.js which will add a toggle to disable/enable chromium distro check flag.

Edit: Will push it within an hour.

maximbaz commented 5 years ago

In case it's helpful, I ran build on the latest master, just to see how far we have progressed, and the build failed with the following:

[18129/38145] CXX obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o
FAILED: obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o 
/build/brave-vaapi/src/brave-browser/src/brave/script/redirect-cc.py ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o.d -DMEDIA_GPU_IMPLEMENTATION -DBRAVE_CHROMIUM_
BUILD -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D
_GNU_SOURCE -DCR_CLANG_REVISION=\"351477-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NO
DISCARD -DCR_LIBCXX_REVISION=358423 -DCR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -
DWEBP_EXTERN=extern -DVK_NO_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DS
K_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE
=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -I../../brave/chromium_src -I../.. -Igen -I../../third_party/libyuv/include -I../../third
_party/libwebp/src -I../../third_party/khronos -I../../gpu -I../../third_party/vulkan/include -Igen/third_party/dawn -I../../third_party/dawn/src/include -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_
party/skia/include/codec -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/docs -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_part
y/skia/include/gpu -I../../third_party/skia/include/pathops -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/vulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../
third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/skia/modules/skottie/include -I../../third_party/vulkan/include -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/
i18n -I../../third_party/protobuf/src -I../../third_party/mesa_headers -I../../third_party/libwebm/source -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../thir
d_party/leveldatabase/src/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthrea
d -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -m64 -
march=x86-64 -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded
-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g2 -ggnu-pubnames -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/blacklist
.txt -fsanitize=cfi-icall -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -isystem../../build/
linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-shorten-64-to-32 -std=c++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools
/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -c ../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc -o ob
j/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o
../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc:70:6: error: unused function 'IsGeminiLakeOrLater' [-Werror,-Wunused-function]
bool IsGeminiLakeOrLater() {   
     ^
1 error generated.
qnixsynapse commented 5 years ago

@maximbaz hmm. It shouldn't have failed here. I have to fix the "vaapi-fix" patch again! :(

Or not. Treat warnings as errors must be on,. sigh

maximbaz commented 5 years ago

Or not. Treat warnings as errors must be on,. sigh

Time for another #Hack it, heh 😉

qnixsynapse commented 5 years ago

I don't think even chromium maintainers properly test vaapi code even on chromeos.

maximbaz commented 5 years ago

Think so too

This is not the best way to set chrome gyp flags imo

😂

Scheduled another build.

qnixsynapse commented 5 years ago

Notify me if it fails again.

maximbaz commented 5 years ago

It failed almost at the very end 😞 Looks like it tried to compile .deb and .rpm and failed because of something missing?

[38119/38145] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)                                                                                                                           [15/39537]
FAILED: deb_brave.deps 
python ../../chrome/installer/linux/debian/calculate_package_deps.py brave ../../build/linux/debian_sid_amd64-sysroot x64 deb_brave.deps
Traceback (most recent call last):
  File "../../chrome/installer/linux/debian/calculate_package_deps.py", line 59, in <module>
    cwd=sysroot)                                                                                                        
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception                                                                                               
OSError: [Errno 2] No such file or directory
[38120/38145] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)
FAILED: rpm_libwidevinecdm.deps                                                                                         
python ../../chrome/installer/linux/rpm/calculate_package_deps.py libwidevinecdm.so rpm_libwidevinecdm.deps libwidevinecdm.so
Traceback (most recent call last):
  File "../../chrome/installer/linux/rpm/calculate_package_deps.py", line 34, in <module>
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[38121/38145] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)
FAILED: deb_brave_sandbox.deps 
python ../../chrome/installer/linux/debian/calculate_package_deps.py brave_sandbox ../../build/linux/debian_sid_amd64-sysroot x64 deb_brave_sandbox.deps
Traceback (most recent call last):
  File "../../chrome/installer/linux/debian/calculate_package_deps.py", line 59, in <module>
    cwd=sysroot)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[38122/38145] ACTION //chrome/installer/linux:calculate_deb_dependencies(//build/toolchain/linux:clang_x64)
FAILED: deb_libwidevinecdm.deps 
python ../../chrome/installer/linux/debian/calculate_package_deps.py libwidevinecdm.so ../../build/linux/debian_sid_amd64-sysroot x64 deb_libwidevinecdm.deps
Traceback (most recent call last):
  File "../../chrome/installer/linux/debian/calculate_package_deps.py", line 59, in <module>
    cwd=sysroot)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[38123/38145] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)
FAILED: rpm_brave_sandbox.deps 
python ../../chrome/installer/linux/rpm/calculate_package_deps.py brave_sandbox rpm_brave_sandbox.deps libwidevinecdm.so 
Traceback (most recent call last):
  File "../../chrome/installer/linux/rpm/calculate_package_deps.py", line 34, in <module>
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[38124/38145] ACTION //chrome/installer/linux:calculate_rpm_dependencies(//build/toolchain/linux:clang_x64)
FAILED: rpm_brave.deps 
python ../../chrome/installer/linux/rpm/calculate_package_deps.py brave rpm_brave.deps libwidevinecdm.so
Traceback (most recent call last):
  File "../../chrome/installer/linux/rpm/calculate_package_deps.py", line 34, in <module>
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

[38125/38145] ACTION //brave/app/linux:generate_breakpad_symbols(//build/toolchain/linux:clang_x64)
ninja: build stopped: subcommand failed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! brave@0.66.99 create_dist: `node ./scripts/commands.js create_dist "Release"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the brave@0.66.99 create_dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
qnixsynapse commented 5 years ago

@maximbaz I have to take look. Looks like it's using sysroot and many options that we don't want.

qnixsynapse commented 5 years ago

@maximbaz I just learnt that create_dist actually used to create final distribution packages. Here we don't want that since we are packaging ourselves.

Final test is to see if the build runs and package() part finishes properly without any errors.

Do we need official build?

maximbaz commented 5 years ago

Do you know what an "official" build means?

I am happy to schedule another build now 😉

qnixsynapse commented 5 years ago

It's depends on what the owner calls it Official, guess we can try removing that argument and schedule a build maybe? I am interested to see if it passes or fails.

maximbaz commented 5 years ago

I'll first schedule with "official", and then without, let's see what changes and which one will pass.

qnixsynapse commented 5 years ago

Okay.

Whooops! I always forget to update sums!

maximbaz commented 5 years ago

The "official" build has succeeded, but the current package() stage contains 56G of files when uncompressed. I guess we have to cherry-pick exactly those files and folders that we want to be part of the final package, but how to know which files are necessary, do you know?

Here's a view of ncdu sorted by file size:

image

And here's the full list of files in src/out/Release folder:

$ ls -alh
drwx------ 1 maximbaz users 3.0K Jul  9 18:06 .
drwxr-xr-x 1 maximbaz users   14 Jul  9 16:22 ..
drwxr-xr-x 1 maximbaz users  388 Jul  9 16:28 angledata
-rw-r--r-- 1 maximbaz users  922 Jul  9 16:22 args.gn
-rwxr-xr-x 2 maximbaz users 5.2G Jul  9 18:06 brave
-rw-r--r-- 1 maximbaz users 7.7K Jul  9 16:40 brave_100_percent.pak
-rw-r--r-- 1 maximbaz users  324 Jul  9 16:40 brave_100_percent.pak.info
-rw-r--r-- 1 maximbaz users  20K Jul  9 16:40 brave_200_percent.pak
-rw-r--r-- 1 maximbaz users  324 Jul  9 16:40 brave_200_percent.pak.info
-rw-r--r-- 1 maximbaz users  35M Jul  9 17:19 brave_resources.pak
-rw-r--r-- 1 maximbaz users  55K Jul  9 17:19 brave_resources.pak.info
-rwxr-xr-x 1 maximbaz users 4.3M Jul  9 16:30 brotli
-rw-r--r-- 1 maximbaz users  21K Jul  9 16:22 browser_tests_apprtc.runtime_deps
-rw-r--r-- 1 maximbaz users 2.8M Jul  9 16:22 build.ninja
-rw-r--r-- 1 maximbaz users 156K Jul  9 16:22 build.ninja.d
-rwxr-xr-x 1 maximbaz users 2.8M Jul  9 16:55 bytecode_builtins_list_generator
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:34 character_data_generator
-rwxr-xr-x 2 maximbaz users 5.2G Jul  9 18:06 chrome
-rw-r--r-- 1 maximbaz users 963K Jul  9 16:55 chrome_100_percent.pak
-rw-r--r-- 1 maximbaz users  35K Jul  9 16:55 chrome_100_percent.pak.info
-rw-r--r-- 1 maximbaz users 1.3M Jul  9 16:55 chrome_200_percent.pak
-rw-r--r-- 1 maximbaz users  35K Jul  9 16:55 chrome_200_percent.pak.info
-rwxr-xr-x 2 maximbaz users 5.0K Jul  9 15:44 chrome-wrapper
-rwxr-xr-x 1 maximbaz users  22M Jul  9 16:30 flatc
drwx------ 1 maximbaz users  550 Jul  9 16:41 gen
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:39 genmacro
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:39 genmodule
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:39 genperf
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:39 genstring
-rwxr-xr-x 1 maximbaz users 2.3M Jul  9 16:39 genversion
-rw-r--r-- 1 maximbaz users 8.4M Jul  9 16:55 headless_lib.pak
-rw-r--r-- 1 maximbaz users 217K Jul  9 16:55 headless_lib.pak.info
-rw-r--r-- 2 maximbaz users  10M Jul  9 15:44 icudtl.dat
-rw-r--r-- 1 maximbaz users 140M Jul  9 16:48 libbat-native-ads-standalone.a
-rw-r--r-- 1 maximbaz users 519M Jul  9 16:48 libbat-native-ledger-standalone.a
-rw-r--r-- 1 maximbaz users  77M Jul  9 16:35 libbat-native-usermodel-standalone.a
-rwxr-xr-x 1 maximbaz users 2.4M Jul  9 16:35 libEGL.so
-rw-r--r-- 1 maximbaz users 3.5K Jul  9 16:35 libEGL.so.TOC
-rwxr-xr-x 1 maximbaz users 170M Jul  9 16:35 libGLESv2.so
-rw-r--r-- 1 maximbaz users  99K Jul  9 16:35 libGLESv2.so.TOC
-rwxr-xr-x 1 maximbaz users 4.4M Jul  9 16:29 libVkICD_mock_icd.so
-rw-r--r-- 1 maximbaz users 2.1K Jul  9 16:29 libVkICD_mock_icd.so.TOC
-rwxr-xr-x 1 maximbaz users 144M Jul  9 16:34 libVkLayer_core_validation.so
-rw-r--r-- 1 maximbaz users 3.8K Jul  9 16:34 libVkLayer_core_validation.so.TOC
-rwxr-xr-x 1 maximbaz users  17M Jul  9 16:33 libVkLayer_object_lifetimes.so
-rw-r--r-- 1 maximbaz users 3.4K Jul  9 16:33 libVkLayer_object_lifetimes.so.TOC
-rwxr-xr-x 1 maximbaz users  22M Jul  9 16:33 libVkLayer_stateless_validation.so
-rw-r--r-- 1 maximbaz users 3.7K Jul  9 16:33 libVkLayer_stateless_validation.so.TOC
-rwxr-xr-x 1 maximbaz users  21M Jul  9 16:33 libVkLayer_thread_safety.so
-rw-r--r-- 1 maximbaz users 3.4K Jul  9 16:33 libVkLayer_thread_safety.so.TOC
-rwxr-xr-x 1 maximbaz users  13M Jul  9 16:33 libVkLayer_unique_objects.so
-rw-r--r-- 1 maximbaz users 3.4K Jul  9 16:33 libVkLayer_unique_objects.so.TOC
-rwxr-xr-x 2 maximbaz users    0 Jul  9 16:22 libwidevinecdm.so
drwxr-xr-x 1 maximbaz users 1.9K Jul  9 16:49 locales
-rwxr-xr-x 1 maximbaz users  75M Jul  9 16:48 make_top_domain_list_for_edit_distance
drwxr-xr-x 1 maximbaz users   60 Jul  9 16:24 MEIPreload
-rwxr-xr-x 1 maximbaz users 587M Jul  9 17:53 mksnapshot
-rwxr-xr-x 1 maximbaz users 5.1M Jul  9 16:35 nasm
-rw-r--r-- 1 maximbaz users  82K Jul  9 16:55 natives_blob.bin
-rw-r--r-- 1 maximbaz users  46M Jul  9 17:53 .ninja_deps
-rw-r--r-- 1 maximbaz users 5.9M Jul  9 18:06 .ninja_log
drwx------ 1 maximbaz users  446 Jul  9 16:26 obj
-rw-r--r-- 2 maximbaz users 2.7K Jul  9 16:22 product_logo_48.png
-rwxr-xr-x 1 maximbaz users  41M Jul  9 16:40 protoc
-rwxr-xr-x 1 maximbaz users  19M Jul  9 16:40 protoc_plugin
drwxr-xr-x 1 maximbaz users  162 Jul  9 16:41 pyproto
-rwxr-xr-x 1 maximbaz users 2.4M Jul  9 16:39 re2c
drwxr-xr-x 1 maximbaz users   74 Jul  9 16:24 resources
-rw-r--r-- 1 maximbaz users  12M Jul  9 16:55 resources.pak
-rw-r--r-- 1 maximbaz users 126K Jul  9 16:55 resources.pak.info
-rw-r--r-- 1 maximbaz users 289K Jul  9 17:53 snapshot_blob.bin
drwxr-xr-x 1 maximbaz users  100 Jul  9 16:38 swiftshader
drwxr-x--- 1 maximbaz users 3.5M Jul  9 18:05 thinlto-cache
-rw-r--r-- 1 maximbaz users  17M Jul  9 16:22 toolchain.ninja
-rwxr-xr-x 1 maximbaz users  21M Jul  9 16:35 top_domain_generator
-rwxr-xr-x 1 maximbaz users  19M Jul  9 17:19 torque
-rwxr-xr-x 1 maximbaz users  24M Jul  9 16:35 transport_security_state_generator
-rw-r--r-- 1 maximbaz users  561 Jul  9 16:48 v8_build_config.json
-rw-r--r-- 1 maximbaz users 693K Jul  9 17:58 v8_context_snapshot.bin
-rwxr-xr-x 1 maximbaz users 2.6G Jul  9 17:58 v8_context_snapshot_generator
-rw-r--r-- 1 maximbaz users  95K Jul  9 16:55 views_mus_resources.pak
-rw-r--r-- 1 maximbaz users  29K Jul  9 16:55 views_mus_resources.pak.info
-rwxr-xr-x 2 maximbaz users  37K Jul  9 15:44 xdg-mime
-rwxr-xr-x 2 maximbaz users  33K Jul  9 15:44 xdg-settings
-rw-r--r-- 1 maximbaz users 3.4K Jul  9 16:22 xr_browser_tests.runtime_deps
-rwxr-xr-x 1 maximbaz users 4.6M Jul  9 16:40 yasm
qnixsynapse commented 5 years ago

@maximbaz Add only these files and folders to the package:

-rwxrwxr-x  1 akarshan users 167846400 Jul  9 14:08 brave
-rw-rw-r--  1 akarshan users      7870 Jul  9 12:26 brave_100_percent.pak
-rw-rw-r--  1 akarshan users     19561 Jul  9 12:26 brave_200_percent.pak
-rw-rw-r--  1 akarshan users  35899143 Jul  9 13:01 brave_resources.pak
-rw-rw-r--  1 akarshan users    990667 Jul  9 12:54 chrome_100_percent.pak
-rw-rw-r--  1 akarshan users   1296011 Jul  9 12:54 chrome_200_percent.pak
-rw-rw-r--  1 akarshan users  10410272 Jul  9 12:11 icudtl.dat
-rw-rw-r--  1 akarshan users     17501 Jul  9 12:10 LICENSE
-rw-rw-r--  1 akarshan users   3984933 Jul  9 14:00 LICENSES.chromium.html
drwxr-xr-x  2 akarshan users      1100 Jul 10 00:04 locales
-rw-rw-r--  1 akarshan users     83237 Jul  9 12:32 natives_blob.bin
drwxr-xr-x  4 akarshan users        80 Jul 10 00:04 resources
-rw-rw-r--  1 akarshan users  12606404 Jul  9 13:00 resources.pak
-rw-rw-r--  1 akarshan users    709496 Jul  9 13:33 v8_context_snapshot.bin
-rw-rw-r--  1 akarshan users         9 Jul  9 13:52 version

version and license files are optional.

Edit: I see libwidevinecdm.so in the files. You can also ship that if you want. :stuck_out_tongue:

maximbaz commented 5 years ago

I see, a bit annoying that we'd have to monitor somehow BUILD.gn to catch the time when we will need to include additional files and folders to the package 😕

It seems for widevine chromium on Arch has a separate package, so I'll skip it for now 😉

I have a bigger concern for the moment... the brave binary is 5.2G! I didn't even notice myself at first...

image

qnixsynapse commented 5 years ago

WTH! Why? How can it be so big!!!!

Okay, I double checked. It should be around 168MB. We have turned off debug builds right? Does arch linux has symbol stripping? @maximbaz

maximbaz commented 5 years ago

Well the command contains --debug_build=false...

npm run build Release --debug_build=false --official_build=true
qnixsynapse commented 5 years ago

@maximbaz hmm. I am guessing it's the symbols.

We have to investigate this. I will check tomorrow. (Possibly the --debug_build=false didn't worked??)

maximbaz commented 5 years ago

I think that variable is false by default for Release builds, so I'm tending more to blame the "official build" flag, I have scheduled a non-official build, will report later the results :)

maximbaz commented 5 years ago

Turns out stripping happens after the compilation failed last time, this non-"official" build was the first one that completed until the very end, and it is correct, with a reasonable-sized binary. I've started yet another "official" build and I'll let it run until the very end, to make sure that my assumption is correct and the binary will be stripped regardless of "official" flag.

On the compiled package, HW decoding works as expected 🙂

qnixsynapse commented 5 years ago

Cool. :+1:

maximbaz commented 5 years ago

The "official" has also completed without errors and the final package size is exactly the same, so I don't see any difference with "official" set to true or false.

Shall we declare success, or there's something else you wanted to do? 😄

qnixsynapse commented 5 years ago

download