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
This commit is contained in:
KongQun Yang 2018-08-24 12:52:14 -07:00
parent e5b8b3ec64
commit 9b655189cf
5 changed files with 16 additions and 12 deletions

View File

@ -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 ## [2.2.0] - 2018-08-16
### Added ### Added
- EditList support in ISO-BMFF in both input and output (#112). - EditList support in ISO-BMFF in both input and output (#112).

16
DEPS
View File

@ -30,6 +30,13 @@ deps = {
"src/packager/testing/gtest": "src/packager/testing/gtest":
Var("chromium_git") + "/external/github.com/google/googletest@6f8a66431cb592dad629028a50b3dd418a408c87", 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": "src/packager/third_party/binutils":
Var("chromium_git") + "/chromium/src/third_party/binutils@8d77853bc9415bcb7bb4206fa2901de7603387db", Var("chromium_git") + "/chromium/src/third_party/binutils@8d77853bc9415bcb7bb4206fa2901de7603387db",
@ -98,15 +105,6 @@ hooks = [
'pattern': '.', 'pattern': '.',
'action': ['python', 'src/packager/build/mac_toolchain.py'], '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"). # Pull clang if needed or requested via GYP_DEFINES (GYP_DEFINES="clang=1").
"name": "clang", "name": "clang",

View File

@ -254,7 +254,7 @@ $ sed -i \
We also need to disable clang and some other features to make it work with musl: We also need to disable clang and some other features to make it work with musl:
```shell ```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 ### Arch Linux

View File

@ -67,7 +67,8 @@ if __name__ == '__main__':
'use_glib': 0, 'use_glib': 0,
'use_openssl': 1, 'use_openssl': 1,
'use_x11': 0, 'use_x11': 0,
'linux_use_gold_binary': 0, 'linux_use_bundled_binutils': 0,
'linux_use_bundled_gold': 0,
'linux_use_gold_flags': 0, 'linux_use_gold_flags': 0,
'clang_use_chrome_plugins': 0} 'clang_use_chrome_plugins': 0}

View File

@ -15,7 +15,7 @@ RUN sed -i \
'/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \ '/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \
/usr/include/malloc.h /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 # Build and run this docker by mapping shaka-packager with
# -v "shaka-packager:/shaka-packager". # -v "shaka-packager:/shaka-packager".