Explorar el Código

For Travis CI - attempt to fix iOS 64-bit packaging build.
Fix #1079.

Yao Wei Tjong 姚伟忠 hace 10 años
padre
commit
3732d7f341
Se han modificado 2 ficheros con 7 adiciones y 12 borrados
  1. 2 2
      .travis.yml
  2. 5 10
      Rakefile

+ 2 - 2
.travis.yml

@@ -325,7 +325,7 @@ env:
 matrix:
   fast_finish: true
 before_script:
-  - if [ $IOS ]; then export CI_START_TIME=$(date +%s); fi
+  - SECONDS=0
   - export TRAVIS_COMMIT=$TRAVIS_COMMIT~
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT)
@@ -337,7 +337,7 @@ before_script:
   - export PATH=$(brew info ccache |grep -o '\S*lib\S*'):$PATH
   - if [ $XCODE ]; then sudo cp -p $(which ccache) $(dirname $(xcodebuild -find-executable clang)) && for compiler in clang clang++; do path=$(xcodebuild -find-executable $compiler); sudo mv $path{,.orig} && sudo ln -sf $(dirname $path)/clang.orig /usr/bin/$compiler && sudo ln -sf ccache $path; done; fi
   - rake ci_setup_cache
-script: rake ci && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi
+script: rake ci && if [ $PACKAGE_UPLOAD ] && (($SECONDS / 60 < 40)); then rake ci_package_upload; fi
 after_script: rake ci_teardown_cache
 
 ---

+ 5 - 10
Rakefile

@@ -403,16 +403,6 @@ task :ci_package_upload do
   end
   # Make the package
   if ENV['IOS']
-    # Skip Mach-O universal binary build if Travis-CI VM took too long to get here, as otherwise overall build time may exceed 50 minutes time limit
-    if ENV['CI_START_TIME'] then
-      elapsed_time = (Time.now - Time.at(ENV['CI_START_TIME'].to_i)) / 60
-      puts "\niOS checkpoint reached, elapsed time: #{elapsed_time}\n\n"
-    end
-    if !ENV['CI_START_TIME'] || elapsed_time < 20 # minutes
-      # Build Mach-O universal binary consisting of iphoneos (universal ARM archs including 'arm64' if 64-bit is enabled) and iphonesimulator (i386 arch and also x86_64 arch if 64-bit is enabled)
-      system 'echo Rebuilding Urho3D library as Mach-O universal binary...'
-      xcode_build(0, '../Build/Urho3D.xcodeproj', 'Urho3D_universal') or abort 'Failed to build Mach-O universal binary'
-    end
     # There is a bug in CMake/CPack that causes the 'package' target failed to build for IOS platform, workaround by calling cpack directly
     system 'cd ../Build && cpack -G TGZ 2>/dev/null' or abort 'Failed to make binary package'
   elsif ENV['XCODE']
@@ -729,6 +719,11 @@ def xcode_ci
     amalg = '-DURHO3D_LUAJIT_AMALG=1'
   end
   system "./cmake_macosx.sh ../Build -DIOS=$IOS #{$build_options} -DURHO3D_DATABASE_SQLITE=1 -DURHO3D_LUA#{jit}=1 #{amalg} -DURHO3D_SAMPLES=1 -DURHO3D_TOOLS=1 -DURHO3D_EXTRAS=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure Urho3D library build'
+  if ENV['IOS']
+    # Build Mach-O universal binary consisting of iphoneos (universal ARM archs including 'arm64' if 64-bit is enabled) and iphonesimulator (i386 arch and also x86_64 arch if 64-bit is enabled)
+    system 'echo Rebuilding Urho3D library as Mach-O universal binary...'
+    xcode_build(0, '../Build/Urho3D.xcodeproj', 'Urho3D_universal') or abort 'Failed to build Mach-O universal binary'
+  end
   xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj') or abort 'Failed to build or test Urho3D library'
   unless ENV['CI'] && ENV['IOS'] && ENV['PACKAGE_UPLOAD']   # Skip scaffolding test when packaging for iOS
     # Create a new project on the fly that uses newly built Urho3D library in the build tree