HTCondor Project List Archives



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Condor-devel] Patches (was: Re: Official Debian package for Condor)



Hi,

On Wed, Dec 08, 2010 at 11:16:37PM -0600, Thawan Kooburat wrote:
> > On the other hand the packaging needs to be fully compliant
> > with the Debian policy.
> 
> With the current Debian packages, we also try to follow Debian policy
> as much as possible while trying to ship a working Condor package. I
> believed that Ubuntu package is a "clipped port" so that it can be
> built on Ubuntu build facility.

Yes it is. The Debian package also will be a clipped port, as I'm now
convinced that it is more useful to have a working condor in Debian
soon, as opposed to a perfect condor sometime in the future.

I made good progress creating a first Debian packaging draft. While
doing so I discovered some issue that aren't necessarily
Debian-specific. I'm attaching a set of patches that you may want to
commit at your convenience (they should all be git-am'able). Some
patches probably need some discussion. If something is obviously stupid,
please let me know.

Some of these patches point to issues that arise from compiling condor's
internal libraries as shared libs. However, the ones attached here
should be valid issues -- there are just hidden when compiling static
libs.

Here is the list of patches. Each file should have some additional
information in its header.


fix_sysapi_undefined_syms

  Change sysapi symbols to plain C


gcc_compat

  Explicitly cast away constness to prevent build failure


lsb_compliance

  Add dependency to remote FS to LSB init header


postgres_fixes

  Few fixes to be able to compile with system postgresql


remove_bogus_path

  Bogus CD command causes build to fail


rename_duplicate_symbol

  Rename duplicate symbol




Thanks in advance,


Michael

-- 
Michael Hanke
http://mih.voxindeserto.de
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Change sysapi symbols to plain C

This is what they are used like and declared in the headers. Implementing them
as C++ leads to undefined symbolds in the library.
--- a/src/condor_sysapi/CMakeLists.txt
+++ b/src/condor_sysapi/CMakeLists.txt
@@ -17,7 +17,7 @@
  ############################################################### 
 
 
-file( GLOB SysApiRmvElements *_t.cpp *.t.* dhry21b* )
+file( GLOB SysApiRmvElements *.t.* dhry21b* )
 
 condor_glob(SysapiHeaderFiles SysapiSourceFiles "${SysApiRmvElements}" )
 
--- a/src/condor_sysapi/arch_t.cpp
+++ b/src/condor_sysapi/arch_t.cpp
@@ -25,6 +25,10 @@
 #include "stdio.h"
 #include "string.h"
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int arch_test(int trials)
 {
 	const char *foo = NULL, *foo2 = NULL;
--- a/src/condor_sysapi/clinpack_t.cpp
+++ b/src/condor_sysapi/clinpack_t.cpp
@@ -64,6 +64,10 @@
 	return 0;
 }
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int kflops_test(int test_blocksize,
 				double max_sd_variation_ratio, 
 				double ratio_failed_test_blocks_ok)
--- a/src/condor_sysapi/dhry_t.cpp
+++ b/src/condor_sysapi/dhry_t.cpp
@@ -65,6 +65,10 @@
 	return 0;
 }
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int mips_test(int test_blocksize,
 			  double max_sd_variation_ratio, 
 			  double ratio_failed_test_blocks_ok)
--- a/src/condor_sysapi/idle_time_t.cpp
+++ b/src/condor_sysapi/idle_time_t.cpp
@@ -25,6 +25,10 @@
 #include "stdio.h"
 #include "time.h"
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int idle_time_test(int trials, int interval, int tolerance, double warn_ok_ratio)
 {
 	int		i;
--- a/src/condor_sysapi/load_avg_t.cpp
+++ b/src/condor_sysapi/load_avg_t.cpp
@@ -26,6 +26,10 @@
 
 #define ITERATIONS_PER_SECOND 10000000
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int load_avg_test(int trials, int interval, int num_children, double warn_ok_ratio);
 
 int load_avg_test(int trials, int interval, int num_children, double warn_ok_ratio) {
--- a/src/condor_sysapi/ncpus_t.cpp
+++ b/src/condor_sysapi/ncpus_t.cpp
@@ -24,6 +24,10 @@
 #include "sysapi_externs.h"
 #include "stdio.h"
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int ncpus_test(int trials, double warn_ok_ratio)
 {
 	int foo,  bar;
--- a/src/condor_sysapi/phys_mem_t.cpp
+++ b/src/condor_sysapi/phys_mem_t.cpp
@@ -25,8 +25,16 @@
 #include "stdio.h"
 #include "string.h"
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int phys_memory_test(int trials, double warn_ok_ratio);
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int phys_memory_test(int trials, double warn_ok_ratio)
 {
 	int foo,  bar;
--- a/src/condor_sysapi/virt_mem_t.cpp
+++ b/src/condor_sysapi/virt_mem_t.cpp
@@ -25,9 +25,17 @@
 #include "stdio.h"
 #include "math.h"
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int virt_memory_test(int test_blocksize, double max_sd_varation_ratio,
 					 					double max_failed_test_ratio);
 
+/* test is a plain C symbols, because it is used as such in the rest of thei
+ * code
+ */
+extern "C"
 int virt_memory_test(int	test_blocksize,
 					 double max_sd_varation_ratio, 
 					 double max_failed_test_ratio)
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Explicitly cast away constness to prevent build failure

GCC 4.5 refuses to compile SOAP unless const-type mismatch is addressed.
This happens with Debian's (outdated) version of gsoap.
--- a/src/condor_daemon_core.V6/soap_core.cpp
+++ b/src/condor_daemon_core.V6/soap_core.cpp
@@ -51,7 +51,8 @@
 struct soap *
 dc_soap_accept(Sock *socket, const struct soap *soap)
 {
-	struct soap *cursoap = soap_copy(soap);
+	// soap_copy doesn't take const
+	struct soap *cursoap = soap_copy(const_cast<struct soap*>(soap));
 	ASSERT(cursoap);
 
 		// Mimic a gsoap soap_accept as follows:
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Add dependency to remote FS to LSB init header

Often condor would be installed under /usr (e.g. any system packaged
version is), and hence the daemons should not start until remote file
systems become available.
--- a/src/condor_examples/condor.boot.rpm
+++ b/src/condor_examples/condor.boot.rpm
@@ -21,8 +21,8 @@
 # LSB init part (Used by Debian package)
 ### BEGIN INIT INFO
 # Provides:          condor
-# Required-Start:    $network $local_fs
-# Required-Stop:     $local_fs $network
+# Required-Start:    $network $local_fs $remote_fs
+# Required-Stop:     $remote_fs $local_fs $network
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: Manage condor daemons
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Few fixes to be able to compile with system postgresql
--- a/src/condor_job_router/CMakeLists.txt
+++ b/src/condor_job_router/CMakeLists.txt
@@ -18,7 +18,7 @@
 
 
 
-set (JR_LINK_LIBS "qmgmt;${CONDOR_LIBS};${PCRE_FOUND};${OPENSSL_FOUND};${KRB5_FOUND};${CLASSADS_FOUND};${COREDUMPER_FOUND}")
+set (JR_LINK_LIBS "qmgmt;${CONDOR_LIBS};${PCRE_FOUND};${OPENSSL_FOUND};${KRB5_FOUND};${CLASSADS_FOUND};${COREDUMPER_FOUND};${POSTGRESQL_FOUND}")
 
 condor_glob(JRHdrs JRSrcs "VanillaToGrid_main.cpp")
 
--- a/src/condor_tools/load_history.cpp
+++ b/src/condor_tools/load_history.cpp
@@ -40,8 +40,8 @@
 #include "historysnapshot.h"
 #include "jobqueuedatabase.h"
 #include "pgsqldatabase.h"
-#include "../condor_tt/condor_ttdb.h"
-#include "../condor_tt/jobqueuecollection.h"
+#include "../condor_contrib/condor_tt/condor_ttdb.h"
+#include "../condor_contrib/condor_tt/jobqueuecollection.h"
 #include "dbms_utils.h"
 #include "subsystem_info.h"
 
--- a/src/condor_utils/dbms_utils.cpp
+++ b/src/condor_utils/dbms_utils.cpp
@@ -27,8 +27,8 @@
 #ifdef HAVE_EXT_POSTGRESQL
 
 #include "pgsqldatabase.h"
-#include "../condor_tt/condor_ttdb.h"
-#include "../condor_tt/jobqueuecollection.h"
+#include "../condor_contrib/condor_tt/condor_ttdb.h"
+#include "../condor_contrib/condor_tt/jobqueuecollection.h"
 
 extern "C" {
 
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Bogus CD command causes build to fail.
--- a/src/condor_utils/CMakeLists.txt
+++ b/src/condor_utils/CMakeLists.txt
@@ -26,7 +26,7 @@
 if (${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
         command_target( utils_genparams perl param_info_c_generator.pl param_info_init.c )
 else()
-        command_target( utils_genparams cd "/D;${CMAKE_CURRENT_SOURCE_DIR};&&;perl;param_info_c_generator.pl;&&;mv;-f;param_info_init.c;${CMAKE_CURRENT_BINARY_DIR}" param_info_init.c )
+        command_target( utils_genparams cd "${CMAKE_CURRENT_SOURCE_DIR};&&;perl;param_info_c_generator.pl;&&;mv;-f;param_info_init.c;${CMAKE_CURRENT_BINARY_DIR}" param_info_init.c )
 endif()
 		
 condor_static_lib( utils "${HeaderFiles};${SourceFiles}" )
From: Michael Hanke <mih@xxxxxxxxxx>
Subject: Rename duplicate symbol

libutils code has two symbols of identical name. Disable a randomly chosen one
(need to clarify which one is the intended one). In the static libs ones of them
gets swallowed.
--- a/src/condor_utils/signames.cpp
+++ b/src/condor_utils/signames.cpp
@@ -19,7 +19,10 @@
 
 #include "condor_common.h"
 
-char	*SigNames[] = {
+/* there is another 'SigNames' src/condor_utils/event_handler.unix.cpp
+ * that has been chosen by fair flip of a coin
+ */
+char	*SigNamesDISABLED[] = {
 "(0)",
 "SIGHUP",		/* 1 */
 "SIGINT",		/* 2 */