Hello,

- Icecream: 

 Attached patch implements icerun symlink. It seems to work fine for me. 
Coolo, if I remember well, the deal was I do patches and then you do a 
release, so here's also a patch for .spec, that should be all from my side I 
hope :).

- KDE:

 I'd like to commit attached FindKDE4Internal.cmake.patch to both trunk and 
4.4 branch. Just invoke cmake with -DKDE4_SERIALIZE_TOOL=icerun and meinproc 
invocations will be serialized. Objections?

 Feel free to wrap more calls using it, I myself consider only meinproc to be 
a problem.

-- 
 Lubos Lunak
 openSUSE Boosters team, KDE developer
 [email protected] , [email protected]
--- FindKDE4Internal.cmake.sav	2010-01-31 17:03:52.098102145 +0100
+++ FindKDE4Internal.cmake	2010-01-31 22:10:25.723380994 +0100
@@ -123,6 +123,8 @@
 #  KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE
 #                      If enabled, the package should install its <package>Config.cmake file to
 #                      lib/cmake/<package>/ instead to lib/<package>/cmake
+#  KDE4_SERIALIZE_TOOL - wrapper to serialize potentially resource-intensive commands during
+#                      parallel builds (set to 'icecc' when using icecream)
 #
 # It also adds the following macros and functions (from KDE4Macros.cmake)
 #  KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui)
@@ -612,6 +614,7 @@ endif(NOT PHONON_FOUND)
 option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation")
 option(KDE4_BUILD_TESTS  "Build the tests")
 option(KDE4_ENABLE_HTMLHANDBOOK  "Create targets htmlhandbook for creating the html versions of the docbook docs")
+set(KDE4_SERIALIZE_TOOL "" CACHE STRING "Tool to serialize resource-intensive commands in parallel builds")
 
 # if CMake 2.6.3 or above is used, provide an option which should be used by other KDE packages
 # whether to install a CMake FooConfig.cmake into lib/foo/cmake/ or /lib/cmake/foo/
@@ -651,6 +654,11 @@ if( KDE4_ENABLE_FINAL)
    add_definitions(-DKDE_USE_FINAL)
 endif(KDE4_ENABLE_FINAL)
 
+if(KDE4_SERIALIZE_TOOL)
+   # parallel build with many meinproc invocations can consume a huge amount of memory
+   set(KDE4_MEINPROC_EXECUTABLE ${KDE4_SERIALIZE_TOOL} ${KDE4_MEINPROC_EXECUTABLE})
+endif(KDE4_SERIALIZE_TOOL)
+
 # If we are building ! kdelibs, check where kdelibs are installed.
 # If they are installed in a directory which contains "lib64", we default to "64" for LIB_SUFFIX,
 # so the current project will by default also go into lib64.
--- icecream/client/client.h.sav	2010-01-11 22:00:40.000000000 +0100
+++ icecream/client/client.h	2010-01-31 21:17:06.254962565 +0100
@@ -40,7 +40,7 @@ extern std::string remote_daemon;
 extern std::string get_absfilename( const std::string &_file );
 
 /* In arg.cpp.  */
-extern bool analyse_argv (const char * const *argv, CompileJob &job);
+extern bool analyse_argv (const char * const *argv, CompileJob &job, bool icerun);
 
 /* In cpp.cpp.  */
 extern pid_t call_cpp (CompileJob &job, int fdwrite, int fdread = -1);
--- icecream/client/main.cpp.sav	2010-01-11 22:00:40.000000000 +0100
+++ icecream/client/main.cpp	2010-01-31 21:39:06.826874301 +0100
@@ -91,6 +91,23 @@ static void dcc_show_usage(void)
 "\n");
 }
 
+static void icerun_show_usage(void)
+{
+    printf(
+"Usage:\n"
+"   icerun [compile options] -o OBJECT -c SOURCE\n"
+"   icerun --help\n"
+"\n"
+"Options:\n"
+"   --help                     explain usage and exit\n"
+"   --version                  show version and exit\n"
+"Environment Variables:\n"
+"   ICECC                      if set to \"no\", just exec the real gcc\n"
+"   ICECC_DEBUG                [info | warnings | debug]\n"
+"                              sets verboseness of icecream client.\n"
+"   ICECC_LOGFILE              if set, additional debug information is logged to the specified file\n"
+"\n");
+}
 
 volatile bool local = false;
 
@@ -189,6 +206,7 @@ int main(int argc, char **argv)
     setup_debug(debug_level, logfile, "ICECC");
 
     CompileJob job;
+    bool icerun = false;
 
     string compiler_name = argv[0];
     dcc_client_catch_signals();
@@ -209,6 +227,28 @@ int main(int argc, char **argv)
             if ( arg.size() > 0 && arg.at(0) == '/' )
                 job.setCompilerName(arg);
         }
+    } else if ( find_basename( compiler_name ) == "icerun") {
+        icerun = true;
+        if ( argc > 1 ) {
+            string arg = argv[1];
+            if ( arg == "--help" ) {
+                icerun_show_usage();
+                return 0;
+            }
+            if ( arg == "--version" ) {
+                printf( "ICERUN " VERSION "\n" );
+                return 0;
+            }
+            if ( arg.size() > 0 )
+                job.setCompilerName(arg);
+        }
+    } else {
+        char buf[ PATH_MAX ];
+        buf[ PATH_MAX - 1 ] = '\0';
+        // check if it's a symlink to icerun
+        if( readlink( compiler_name.c_str(), buf, PATH_MAX - 1 ) >= 0 && find_basename( buf ) == "icerun" ) {
+            icerun = true;
+        }
     }
 
     int sg_level = dcc_recursion_safeguard();
@@ -222,7 +262,7 @@ int main(int argc, char **argv)
      * see the EPIPE. */
     dcc_ignore_sigpipe(1);
 
-    local |= analyse_argv( argv, job );
+    local |= analyse_argv( argv, job, icerun );
 
     /* if ICECC is set to no, then run job locally */
     char* icecc = getenv("ICECC");
--- icecream/client/arg.cpp.sav	2010-01-11 22:00:40.000000000 +0100
+++ icecream/client/arg.cpp	2010-01-31 21:36:19.575201724 +0100
@@ -82,6 +82,7 @@ static bool analyze_program(const char*
         job.setLanguage (CompileJob::Lang_C);
     else {
         job.setLanguage( CompileJob::Lang_Custom );
+        job.setCompilerName( name ); // keep path
         return true;
     }
 
@@ -89,7 +90,7 @@ static bool analyze_program(const char*
 }
 
 bool analyse_argv( const char * const *argv,
-                   CompileJob &job )
+                   CompileJob &job, bool icerun )
 {
     ArgumentsList args;
     string ofile;
@@ -105,11 +106,17 @@ bool analyse_argv( const char * const *a
     bool always_local = analyze_program(had_cc ? job.compilerName().c_str() : argv[0], job);
     bool seen_c = false;
     bool seen_s = false;
+    if( icerun ) {
+        always_local = true;
+        job.setLanguage( CompileJob::Lang_Custom );
+    }
 
     for (int i = had_cc ? 2 : 1; argv[i]; i++) {
         const char *a = argv[i];
 
-        if (a[0] == '-') {
+        if (icerun) {
+            args.append(a, Arg_Local);
+        } else if (a[0] == '-') {
             if (!strcmp(a, "-E") || !strncmp(a, "-fdump", 6) || !strcmp(a, "-combine")) {
                 always_local = true;
                 args.append(a, Arg_Local);
--- icecream/client/Makefile.am.sav	2010-01-31 20:58:24.626879945 +0100
+++ icecream/client/Makefile.am	2010-01-31 21:56:06.194966169 +0100
@@ -7,16 +7,10 @@ icecc_LDADD = ../services/libicecc.la $(
 noinst_HEADERS = client.h md5.h util.h
 
 EXTRA_DIST = icecc-create-env
-CLEANFILES = icecc++
-
-all-local: icecc++
-
-icecc++:
-	-rm -f icecc++
-	$(LN_S) icecc icecc++
 
 install-exec-local:
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	(cd $(DESTDIR)$(bindir) && $(LN_S) icecc icerun)
 	for link in g++ gcc c++ cc; do \
 	  rm -f $(DESTDIR)$(bindir)/$$link ;\
 	  $(LN_S) icecc $(DESTDIR)$(bindir)/$$link ;\
--- icecream.spec.sav	2009-05-01 02:04:38.000000000 +0200
+++ icecream.spec	2010-01-31 21:57:52.094874994 +0100
@@ -129,6 +129,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %config /etc/logrotate.d/icecream
 %config /etc/init.d/icecream
 %_bindir/icecc
+%_bindir/icerun
 %_sbindir/scheduler
 %_libdir/icecc
 %_sbindir/iceccd
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to