From 9b655189cfce4046785c5e75ca2baa521e7f37b1 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Fri, 24 Aug 2018 12:52:14 -0700 Subject: [PATCH] Disable bundled_binutils and bundled_gold on Linux Keep bundled binutil scripts but not downloading actual binaries by default. Automatic downloading of binutils has been causing problems for some users: see #164, #412, #440. Using bundled binutils helps reduce linking time, but packager codebase is relatively small, so the gain is not significant. Local testing shows that the full build time increases from 1m42s to 1m50s, i.e. an increase of about 8s, or ~8%. User can still enable the usage of bundled binutils by running 'python src/packager/third_party/binutils/download.py' and set 'linux_use_bundled_binutils' and 'linux_use_bundled_gold' to 1 in GYP_DEFINES. Change-Id: I7ecae2333861f41054f957d0a6081dae948167bd --- CHANGELOG.md | 5 +++++ DEPS | 16 +++++++--------- docs/source/build_instructions.md | 2 +- gyp_packager.py | 3 ++- packager/testing/dockers/Alpine_Dockerfile | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 409f41a57a..bad63032bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [2.3.0] - To be released +### Changed +- Disable bundled binutil and gold on Linux by default. There may be a slight + increase in binary link time. + ## [2.2.0] - 2018-08-16 ### Added - EditList support in ISO-BMFF in both input and output (#112). diff --git a/DEPS b/DEPS index 2da0e94f2d..21025f25e0 100644 --- a/DEPS +++ b/DEPS @@ -30,6 +30,13 @@ deps = { "src/packager/testing/gtest": Var("chromium_git") + "/external/github.com/google/googletest@6f8a66431cb592dad629028a50b3dd418a408c87", + # Keep bundled binutil scripts but not downloading actual binaries by default. + # Automatic downloading of binutils has been causing problems for some users: + # #164, #412, #440. Using bundled binutils helps reduce linking time, but + # packager codebase is relatively small, so the gain is not significant. + # User can still enable the usage of bundled binutils by running + # 'python src/packager/third_party/binutils/download.py' and set + # 'linux_use_bundled_binutils' and 'linux_use_bundled_gold' to 1 in GYP_DEFINES. "src/packager/third_party/binutils": Var("chromium_git") + "/chromium/src/third_party/binutils@8d77853bc9415bcb7bb4206fa2901de7603387db", @@ -98,15 +105,6 @@ hooks = [ 'pattern': '.', 'action': ['python', 'src/packager/build/mac_toolchain.py'], }, - # Pull binutils for linux. - { - 'name': 'binutils', - 'pattern': 'src/packager/third_party/binutils', - 'action': [ - 'python', - 'src/packager/third_party/binutils/download.py', - ], - }, { # Pull clang if needed or requested via GYP_DEFINES (GYP_DEFINES="clang=1"). "name": "clang", diff --git a/docs/source/build_instructions.md b/docs/source/build_instructions.md index 4b96a4554e..65999aaae1 100644 --- a/docs/source/build_instructions.md +++ b/docs/source/build_instructions.md @@ -254,7 +254,7 @@ $ sed -i \ We also need to disable clang and some other features to make it work with musl: ```shell -export GYP_DEFINES='linux_use_bundled_binutils=0 linux_use_bundled_gold=0 clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1' +export GYP_DEFINES='clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1' ``` ### Arch Linux diff --git a/gyp_packager.py b/gyp_packager.py index 0efe8ac6b1..bfd047c85f 100755 --- a/gyp_packager.py +++ b/gyp_packager.py @@ -67,7 +67,8 @@ if __name__ == '__main__': 'use_glib': 0, 'use_openssl': 1, 'use_x11': 0, - 'linux_use_gold_binary': 0, + 'linux_use_bundled_binutils': 0, + 'linux_use_bundled_gold': 0, 'linux_use_gold_flags': 0, 'clang_use_chrome_plugins': 0} diff --git a/packager/testing/dockers/Alpine_Dockerfile b/packager/testing/dockers/Alpine_Dockerfile index bfce90bab1..a4dcfd3386 100644 --- a/packager/testing/dockers/Alpine_Dockerfile +++ b/packager/testing/dockers/Alpine_Dockerfile @@ -15,7 +15,7 @@ RUN sed -i \ '/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \ /usr/include/malloc.h -ENV GYP_DEFINES='linux_use_bundled_binutils=0 linux_use_bundled_gold=0 clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1' +ENV GYP_DEFINES='clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1' # Build and run this docker by mapping shaka-packager with # -v "shaka-packager:/shaka-packager".