浏览代码

Remove -Werror in build script

Bo Yang 7 年之前
父节点
当前提交
b8654094b8

+ 1 - 0
kokoro/release/python/linux/build_artifacts.sh

@@ -32,6 +32,7 @@ build_artifact_version() {
 
 
   clean_code $REPO_DIR $BUILD_COMMIT
   clean_code $REPO_DIR $BUILD_COMMIT
   sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
   sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
+  sed -i '/Werror/d' $REPO_DIR/python/setup.py
   cat $REPO_DIR/python/setup.py
   cat $REPO_DIR/python/setup.py
 
 
   build_wheel $REPO_DIR/python $PLAT
   build_wheel $REPO_DIR/python $PLAT

+ 1 - 0
kokoro/release/python/macos/build_artifacts.sh

@@ -35,6 +35,7 @@ build_artifact_version() {
   before_install
   before_install
 
 
   clean_code $REPO_DIR $BUILD_COMMIT
   clean_code $REPO_DIR $BUILD_COMMIT
+  sed -i.bak '/Werror/d' $REPO_DIR/python/setup.py
 
 
   build_wheel $REPO_DIR/python $PLAT
   build_wheel $REPO_DIR/python $PLAT
 
 

+ 1 - 0
kokoro/release/python/windows/build_single_artifact.bat

@@ -54,6 +54,7 @@ REM ======================
 cd python
 cd python
 
 
 REM sed -i 's/\ extra_compile_args\ =\ \[\]/\ extra_compile_args\ =\ \[\'\/MT\'\]/g' setup.py
 REM sed -i 's/\ extra_compile_args\ =\ \[\]/\ extra_compile_args\ =\ \[\'\/MT\'\]/g' setup.py
+sed -i '/Werror/d' setup.py
 
 
 python setup.py bdist_wheel --cpp_implementation --compile_static_extension
 python setup.py bdist_wheel --cpp_implementation --compile_static_extension
 dir dist
 dir dist

+ 3 - 3
python/setup.py

@@ -207,9 +207,9 @@ if __name__ == '__main__':
     elif os.getenv('KOKORO_BUILD_NUMBER') or os.getenv('KOKORO_BUILD_ID'):
     elif os.getenv('KOKORO_BUILD_NUMBER') or os.getenv('KOKORO_BUILD_ID'):
       extra_compile_args.append('-std=c++11')
       extra_compile_args.append('-std=c++11')
 
 
-    # if warnings_as_errors in sys.argv:
-    #   extra_compile_args.append('-Werror')
-    #   sys.argv.remove(warnings_as_errors)
+    if warnings_as_errors in sys.argv:
+      extra_compile_args.append('-Werror')
+      sys.argv.remove(warnings_as_errors)
 
 
     # C++ implementation extension
     # C++ implementation extension
     ext_module_list.extend([
     ext_module_list.extend([