From 5f48cbb0c171c886aeaa564743b4ffbcc6d24abc Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Wed, 3 Jan 2018 22:02:19 -0800 Subject: [PATCH] Fix build failures in MacOS 10.12.6 with XCode 9.0 - Update curl to 7.57.0 - Roll clang, which is needed due to MacOS / XCode update - Fixes and suppress compilation errors due to clang update Fixes #285 Change-Id: Ibac3288c641861605c3c0500d34d27373e6eecfe --- DEPS | 5 +-- appveyor.yml | 1 + kokoro/windows/build.bat | 4 ++ packager/common.gypi | 40 +++++++++++-------- .../formats/webvtt/webvtt_to_mp4_handler.cc | 2 + packager/mpd/base/period.h | 2 + packager/third_party/curl/curl.gyp | 6 ++- packager/third_party/libxml/libxml.gyp | 2 + packager/third_party/protobuf/protobuf.gyp | 6 +++ 9 files changed, 46 insertions(+), 22 deletions(-) diff --git a/DEPS b/DEPS index b48e09beac..2da0e94f2d 100644 --- a/DEPS +++ b/DEPS @@ -39,7 +39,7 @@ deps = { Var("github") + "/google/boringssl@fc9c67599d9bdeb2e0467085133b81a8e28f77a4", "src/packager/third_party/curl/source": - Var("github") + "/curl/curl@c514af5a4f5ac3ce724065cc6a8e009373436f78", #7.56.1 + Var("github") + "/curl/curl@62c07b5743490ce373910f469abc8cdc759bec2b", #7.57.0 "src/packager/third_party/gflags/src": Var("chromium_git") + "/external/github.com/gflags/gflags@03bebcb065c83beff83d50ae025a55a4bf94dfca", @@ -61,7 +61,7 @@ deps = { Var("chromium_git") + "/chromium/src/third_party/zlib@830b5c25b5fbe37e032ea09dd011d57042dd94df", #408157 "src/packager/tools/clang": - Var("chromium_git") + "/chromium/src/tools/clang@0b06ba9e49a0cba97f6accd71a974c1623d69e16", #409802 + Var("chromium_git") + "/chromium/src/tools/clang@723b25997f0aab45fe1776a0f74a14782e350f8f", #513983 "src/packager/tools/gyp": Var("chromium_git") + "/external/gyp@e7079f0e0e14108ab0dba58728ff219637458563", @@ -109,7 +109,6 @@ hooks = [ }, { # Pull clang if needed or requested via GYP_DEFINES (GYP_DEFINES="clang=1"). - # Note: On Win, this should run after win_toolchain, as it may use it. "name": "clang", "pattern": ".", "action": ["python", "src/packager/tools/clang/scripts/update.py", "--if-needed"], diff --git a/appveyor.yml b/appveyor.yml index f695849294..cfdf1e5826 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,7 @@ install: before_build: - cd .. - depot_tools\gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged + - set DEPOT_TOOLS_WIN_TOOLCHAIN=0 - set GYP_DEFINES="target_arch=%PLATFORM% libpackager_type=%LIBPACKAGER_TYPE%" - depot_tools\gclient sync - if [%PLATFORM%] == [x64] ( diff --git a/kokoro/windows/build.bat b/kokoro/windows/build.bat index 25e14fc4fd..7d3bcb8fba 100644 --- a/kokoro/windows/build.bat +++ b/kokoro/windows/build.bat @@ -18,6 +18,10 @@ python %PACKAGERDIR%\kokoro\deps_replacer.py "https://github.com" "https://githu cd %PACKAGERDIR%\.. +:: Disable downloading google-internal version of WIN TOOLCHAIN. Use locally +:: installed version instead. +set DEPOT_TOOLS_WIN_TOOLCHAIN=0 + :: Note that gclient file is a batch script, so 'call' must be used to wait for :: the result. :: Also gclient turns off echo, so echo is re-enabled after the command. diff --git a/packager/common.gypi b/packager/common.gypi index a5d37e080c..6f61d74ec5 100644 --- a/packager/common.gypi +++ b/packager/common.gypi @@ -27,22 +27,22 @@ '.', '..', ], - 'conditions': [ - ['clang==1', { - 'cflags': [ - '-Wimplicit-fallthrough', - ], - # Revert the relevant settings in Chromium's common.gypi. - 'cflags!': [ - '-Wno-char-subscripts', - '-Wno-unneeded-internal-declaration', - '-Wno-covered-switch-default', + 'variables': { + 'clang_warning_flags': [ + '-Wimplicit-fallthrough', + ], + # Revert the relevant settings in Chromium's common.gypi. + 'clang_warning_flags_unset': [ + '-Wno-char-subscripts', + '-Wno-unneeded-internal-declaration', + '-Wno-covered-switch-default', - # C++11-related flags: - '-Wno-c++11-narrowing', - '-Wno-reserved-user-defined-literal', - ], - }], + # C++11-related flags: + '-Wno-c++11-narrowing', + '-Wno-reserved-user-defined-literal', + ], + }, + 'conditions': [ ['OS == "win"', { 'msvs_settings': { 'VCCLCompilerTool': { @@ -53,9 +53,15 @@ }], ], }, { + # We do not have control over non-shaka code. Disable some warnings to + # make build pass. + 'variables': { + 'clang_warning_flags': [ + '-Wno-tautological-constant-compare', + '-Wno-unguarded-availability', + ], + }, 'conditions': [ - # We do not have control over non-shaka code. Disable some warnings to - # make build pass. ['clang==0', { 'cflags': [ '-Wno-dangling-else', diff --git a/packager/media/formats/webvtt/webvtt_to_mp4_handler.cc b/packager/media/formats/webvtt/webvtt_to_mp4_handler.cc index 5366e7bd10..450feaf934 100644 --- a/packager/media/formats/webvtt/webvtt_to_mp4_handler.cc +++ b/packager/media/formats/webvtt/webvtt_to_mp4_handler.cc @@ -18,6 +18,8 @@ namespace media { class DisplayAction { public: DisplayAction(uint64_t id, uint64_t time) : id_(id), time_(time) {} + virtual ~DisplayAction() = default; + uint64_t id() const { return id_; } uint64_t time() const { return time_; } virtual void ActOn(std::list* display) const = 0; diff --git a/packager/mpd/base/period.h b/packager/mpd/base/period.h index 6634267978..340460a53d 100644 --- a/packager/mpd/base/period.h +++ b/packager/mpd/base/period.h @@ -29,6 +29,8 @@ class XmlNode; /// AdaptationSets. class Period { public: + virtual ~Period() = default; + /// Check the existing AdaptationSets, if there is one matching the provided /// @a media_info, return it; otherwise a new AdaptationSet is created and /// returned. diff --git a/packager/third_party/curl/curl.gyp b/packager/third_party/curl/curl.gyp index 1843982a13..27afa68dfb 100644 --- a/packager/third_party/curl/curl.gyp +++ b/packager/third_party/curl/curl.gyp @@ -162,12 +162,12 @@ 'source/lib/hmac.c', 'source/lib/hostasyn.c', 'source/lib/hostcheck.c', + 'source/lib/hostip.c', 'source/lib/hostip4.c', 'source/lib/hostip6.c', - 'source/lib/hostip.c', 'source/lib/hostsyn.c', - 'source/lib/http2.c', 'source/lib/http.c', + 'source/lib/http2.c', 'source/lib/http_chunks.c', 'source/lib/http_digest.c', 'source/lib/http_negotiate.c', @@ -203,6 +203,8 @@ 'source/lib/security.c', 'source/lib/select.c', 'source/lib/sendf.c', + 'source/lib/setopt.c', + 'source/lib/sha256.c', 'source/lib/share.c', 'source/lib/slist.c', 'source/lib/smb.c', diff --git a/packager/third_party/libxml/libxml.gyp b/packager/third_party/libxml/libxml.gyp index 54790f6cec..fcc049756f 100644 --- a/packager/third_party/libxml/libxml.gyp +++ b/packager/third_party/libxml/libxml.gyp @@ -220,6 +220,8 @@ # trio_is_special_quantity and trio_is_negative are only # used with certain preprocessor defines set. '-Wno-unused-function', + # Comparison between xmlElementType and xmlXPathTypeVal. + '-Wno-enum-compare', ], }, 'include_dirs': [ diff --git a/packager/third_party/protobuf/protobuf.gyp b/packager/third_party/protobuf/protobuf.gyp index e985836507..118baa58f9 100644 --- a/packager/third_party/protobuf/protobuf.gyp +++ b/packager/third_party/protobuf/protobuf.gyp @@ -46,6 +46,8 @@ 'clang_warning_flags': [ # protobuf-3 contains a few functions that are unused. '-Wno-unused-function', + '-Wno-enum-compare', + '-Wno-user-defined-warnings', ], }, # Required for component builds. See http://crbug.com/172800. @@ -75,6 +77,8 @@ 'clang_warning_flags': [ # protobuf-3 contains a few functions that are unused. '-Wno-unused-function', + '-Wno-enum-compare', + '-Wno-user-defined-warnings', ], }, 'sources': [ @@ -399,6 +403,8 @@ 'clang_warning_flags': [ # protobuf-3 contains a few functions that are unused. '-Wno-unused-function', + '-Wno-enum-compare', + '-Wno-user-defined-warnings', ], }, 'dependencies': [