rakelib/compile.rake
changeset 94 61b2540acc91
parent 93 650412e81596
parent 91 76f23122e86a
child 97 33cf3197acb5
--- a/rakelib/compile.rake	Tue Nov 29 10:19:15 2016 +0000
+++ b/rakelib/compile.rake	Tue Dec 06 21:18:48 2016 +0000
@@ -14,15 +14,16 @@
   LIBRUN = STX_TOP_DIR / 'librun' / 'librun.so'
 end
 
+# Return true if stx:stc and stx:librun sources should be removed as soon 
+# as STC or librun is built. False otherwise (sources are not removed by 
+# rakefiles)
+#
+# Indeed this is a feeble protection as it's easy to trick this method. But 
+# the goal is not to protect sources but rather have a secondaty measure to
+# avoid sources to leak (for exaple, due to a bug in packaging scripts).
+# Unathorized subjects should not be able to checkout sources in first instance.
 def should_remove_librun_and_stc_sources
-    return ! core_developer?
-end
-
-def make_or_raise_error(args = '')
-  cmd = "#{MAKE} #{args}"
-  if not system cmd
-    raise Exception.new("make failed: #{cmd}");
-  end
+    return ! (core_developer? or ENV['RETAIN_STX_AND_LIBRUN_SOURCE'] = 'yespleaseretain!')
 end
 
 def rm_rf_all_in_except(directory, exceptions = [])
@@ -320,7 +321,7 @@
 
     chdir STX_TOP_DIR / 'stc' do      
       begin
-        make_or_raise_error stx_make_flags
+        make stx_make_flags
         cleanup_stc()
       rescue Exception => e
         cleanup_stc()
@@ -349,7 +350,7 @@
                 mkdir 'libffi' / 'build_win32' / 'objbc'
               end
             end
-          make_or_raise_error
+          make
           cleanup_librun()
         rescue Exception => e
           cleanup_stc()