Commit Graph

20 Commits

Author SHA1 Message Date
Joey Parrish 68b50f656d build: Stop using hermetic clang, libc++, etc
This brings our default build config more in line with what is
necessary for some platforms anyway: using the system-installed
toolchain and sysroot to build everything.

We will no longer fetch source or binaries for any specific build
tools, such as libc++, clang, gold, binutils, or valgrind.

The main part of this change is the changing of default gyp settings
in gyp_packager.py.  For this, a bug in gyp_packager.py had to be
fixed, in which similar GYP_DEFINE key names (such as clang and
host_clang) would conflict, causing some defaults not to be installed
properly.

In order to enable clang=0 by default, some changes had to be made in
common.gypi:
  - compiler macros added to fix a compatibility issue between
    Chromium's base/mac/ folder and the actual OSX SDK
	- replaced clang_warning_flags variables with standard cflags
	  settings, plus xcode_settings for OSX
  - turned off warnings-as-errors for non-shaka code, rather than
		allow-listing specific warning types, since we can't actually fix
    those warnings on any platform
  - disabled two specific warnings in shaka code, both of which are
    caused by headers from our non-shaka dependencies

Also, one warning (missing "override" keyword) has been fixed in
vod_media_info_dump_muxer_listener.h.

Although these changes were done to make building simpler on a wider
array of platforms (arm64, for example), it seems to make the build a
bit faster, too.  For me, at least, on my main Linux workstation:
  - "gclient sync" now runs 20-30% faster
  - "ninja -C out/Release" now runs 5-13% faster

The following environment variables are no longer required:
  - DEPOT_TOOLS_WIN_TOOLCHAIN
  - MACOSX_DEPLOYMENT_TARGET
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.

The following GYP_DEFINES are no longer required for anyone:
  - clang=0
  - host_clang=0
  - clang_xcode=1
  - use_allocator=none
  - use_experimental_allocator_shim=0
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.

The following repos are no longer dependencies in gclient:
  - binutils
  - clang
  - gold
  - libc++
  - libc++abi
  - valgrind

The following gclient hooks have been removed:
  - clang
  - mac_toolchain
  - sysroot

Change-Id: Ie94ccbeec722ab73c291cb7df897d20761a09a70
2021-07-29 13:54:44 -07:00
Joey Parrish 56e227267c Fix python linter errors and add linter checks to CI
Internal CI systems and the new GitHub CI system were out of sync,
with the external system not doing any linting.  Further, the internal
system was using an internal-only linter for Python.

This creates a script for Python linting based on the open-source
pylint tool, checks in the Google Style Guide's pylintrc file, creates
a custom action for linting and adds it to the existing workflows,
fixes pre-existing linter errors in Python scripts, and updates pylint
overrides.

b/190743862

Change-Id: Iff1f5d4690b32479af777ded0834c31c2161bd10
2021-06-21 21:46:48 +00:00
Jacob Trimble 4c0d38bde3 Don't use Chromium sysroot.
The Chromium sysroot has a broken C++11 implementation that doesn't
allow us to use <condition_variable> or <chrono>.  So we need to use the
system sysroot to use all C++11 features.

Change-Id: I41bec7ebddf598e1bf0494ee8bb2844e67bc8acf
2020-09-01 17:59:52 +00:00
Jacob Trimble 8c604f38fb Fix style of gyp_packager.py.
Change-Id: I5668da965775d9f42cf070b3c2ca23888932f1bd
2020-08-26 14:24:20 -07:00
KongQun Yang 1b262b5784 Fix failures with latest gpylint
Change-Id: Id80000b530b0582b907730db9311075a7f5307fa
2020-06-03 22:59:22 +00:00
KongQun Yang 9b655189cf 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
2018-08-24 21:14:19 +00:00
KongQun Yang 8e96dd3b37 Address gcc build failures in some platforms
Seeing some failures on some platforms when compiled with clang
disabled:
  GYP_DEFINES="clang=0" gclient runhooks

Several changes to make it work:
1. Mark packager code with packager_code=1 in GYP definitions.
2. Disable a few checks in non-packager code, which we do not have
   direct control: dangling-else, deprecated-declarations,
                   unused-function
3. Fix the relevant errors in packager code.
4. Revert HAVE_STROPTS_H in curl config which is not available in
   all linux distributions.

Fixes #286
Fixes #293

Change-Id: I729b41f99403c5ad9487c6cc4a7dc06f6323cef8
2017-12-07 11:45:26 -08:00
Kongqun Yang 23f2913248 Update DEPS to fix mac build failure
Change-Id: I1cf95d5da8e3b950300cd61cd9286e957ef653ce
2016-08-19 13:49:41 -07:00
KongQun Yang 810f5b3ab5 Disable clang on 32bit systems by default
Fixes #51

Change-Id: I7ae81055b30ce11cd12080f7d8ee9e6f899d07cd
2016-01-25 13:39:49 -08:00
Anders Hasselqvist 30bd227162 MacOSX: Skip --no-circular-check when generating Xcode projects
When gyp is generating the ninja files a circular dependency error is reported:
packager/media/file/file.gyp -> packager/media/base/media_base.gyp -> packager/media/file/file.gyp

This isn't a problem with ninja, but presumably is a problem with Xcode.
Change gyp_packager.py to use "--no-circular-check" for all generators except xcode
2016-01-22 18:50:05 -08:00
Rintaro Kuroiwa 175606c88d gyp_packager should repsect output_dir
- Check if 'output_dir=' is already defined in GYP_GENERATOR_FLAGS
  before appending the one generated in the script.
- Reusing out/ with different GYP_DEFINES causes everything to rebuild.
- This change allows the user to use different directories for different
  GYP_DEFINES; it can make sanity checking faster for different
  GYP_DEFINES.

Change-Id: Iffa6880381dabdd80a3aa7777a1d20cc3900f3e3
2016-01-14 22:41:00 -08:00
KongQun Yang e0040a4910 Add version information in generated outputs
For mp4 outputs, a metadata box with version information is added to
moov box.

For mpd outputs, a text comment with version information is added in
the beginning of mpd file.

Issue #60

Change-Id: I783ba370781c0a8f77c910ff1172bad2e7edff75
2016-01-08 19:08:56 +00:00
KongQun Yang 35e033b838 Disable gold linker by default
The bundled gold (third_party/gold) does not work on Ubuntu 64bit server.

Did some benchmarking on some systems: the build is around 1% faster,
which is not significant.

"gold" tool will still be pulled in using gclient. It can be enabled via
GYP_DEFINES flag:
GYP_DEFINES="linux_use_gold_binary=1 linux_use_gold_flags=1" gclient runhooks

Issue: 7

Change-Id: Ic5a83368e0e475280f6722ddbd3f5cead2276712
2015-02-12 12:48:34 -08:00
KongQun Yang b8126bc9da Move source code into packager directory
Make it easier to be included and integrated into other code.

Change-Id: I609881688cc20f8fac676cbd91fde4753af32ee5
2014-10-02 12:32:14 -07:00
KongQun Yang 5d5750b405 Update gyp_packager to support earlier version of python
"{} {}" formatting in python is introduced in version 2.7. Replaced
with "{0} {1}" to support python 2.6 and below.

Change-Id: Ic20fdc5fce554a5a5cb57383d5587581f70de598
2014-06-23 15:25:51 -07:00
Kongqun Yang c8307c102e Update packager to work with gclient
Detail changes:
1. Add gclient DEPS (depenencies)
2. Update gyp_packager.py
3. Update .gitignore
4. Update third_party/happyhttp patch path
5. Add a new script in happyhttp to reset the patch before re-sync

Change-Id: I30f0beb94a56ae8aff3b25bb16fe76a7b07e3d54
2014-03-20 00:56:36 +00:00
Kongqun Yang 374324b042 Disable test_isolation_mode, glib, and x11 in GYP_DEFINES
This removes unnecessary library dependencies.

Change-Id: Id451766d1bedd7fbcd9cf9cf882de86ccb662486
2014-03-03 21:28:33 +00:00
Edwin Wong c5ca55c388 Workaround pylint warning F0401.
gyp and gyp_helper path are obtained dynamically. Pylint generates
format checker warning. The Workaround is recommended by:
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html.
Although the style guide prefers using symbolic names, which is
supported since pylint 0.25.3, the depot_tools/pylint is 0.25.1.

Change-Id: I6c9bc21a46102f38cab68c07c98339003cbd6991
2014-02-26 19:21:43 -08:00
Rintaro Kuroiwa b51f20d40c Use gyp_helper in gyp_packager.py
build/gyp_chromium uses gyp_helper to get variables for GYP from
chromium.gyp_env file.
More on chromium.gyp_env can be found here
http://www.chromium.org/developers/how-tos/component-build

This is useful if you want to override some GYP varibles to test
different flags, e.g. using clang to build.

Change-Id: I14fc76abdd6503bf66ef3e27fb9216b3fb8aaa02
2014-02-20 10:47:18 -08:00
Kongqun Yang 859da912fc Replace bash build script with python script.
This is for cross platform support. gyp_packager.py is modified
from build/gyp_chromium and adapted to packager code.

New build instructions:

1. Setup gyp: ./gyp_packager.py

clang is not enabled by default, which can be enabled by overriding
GYP_DEFINE environment variable, i.e. "GYP_DEFINES='clang=1
use_openssl=1' ./gyp_packager.py".

Ninja is the default build system. User can also change to make by
overriding GYP_GENERATORS to make, i.e. "GYP_GENERATORS='make'
./gyp_packager.py".

2. The first step generates the make files but does not start the
build process. Ninja is the default build system. Refer to Ninja
manual on how to do the build.

Common syntaxes: ninja -C out/{Debug/Release} [Module]
Module is optional. If not specified, build everything.

Step 1 is only required if there is any gyp file change. Otherwise, you
may just run ninja.

Change-Id: I89cade7278bfdd3992644457e896e5a10085568b
2014-02-19 22:42:07 +00:00