You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/09/08 20:36:27 UTC

svn commit: r1520893 - in /subversion/trunk: build.conf build/generator/gen_base.py build/generator/gen_win.py

Author: rhuijben
Date: Sun Sep  8 18:36:27 2013
New Revision: 1520893

URL: http://svn.apache.org/r1520893
Log:
Re-implement the forced usage of shared libraries for our test suite using a
proper build.conf flag. The updated implementation resolves a few cases where
we linked some applications (E.g. op-depth-test) against both the shared and
the static version of the same library, because direct and indirect
dependencies were handled using different code paths.

This last problem caused test failures on the Windows shared library buildbot,
because svn_error_clear() unhooked a different function for its
maintainer-abort on error leaks, than the other library inserted.

* build.conf
  (msvc-force-static): Document.
  (locks-test,
   checksum-test,
   crypto-test,
   client-test,
   conflict-data-test,
   db-test,
   pristine-store-test,
   entries-compat-test,
   op-depth-test,
   wc-test): Mark these tests as msvc-force-static they use functions that
     aren't published from the libraries that define them.

  (entries-dump,
   wc-lock-tester,
   wc-incomplete-tester): Mark these wc.db test helpers as msvc-force-static.

* build/generator/gen_base.py
  (DependencyGraph.remove): New function.
  (TargetExe): Read new value from build.conf.
  (disable_shared): Don't touch msvc_export.

* build/generator/gen_win.py
  (get_install_targets): Handle the magic of forcing static library usage here,
    with the code that creates shared libraries.
  (create_dll_target): Remove magic name logic.

Modified:
    subversion/trunk/build.conf
    subversion/trunk/build/generator/gen_base.py
    subversion/trunk/build/generator/gen_win.py

Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1520893&r1=1520892&r2=1520893&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Sun Sep  8 18:36:27 2013
@@ -120,6 +120,7 @@ swig-checkout-files = common.swg swigrun
 #    msvc-libs        - additional libraries to link with on Windows
 #    msvc-export      - additional list of files to expose in dsp/vc(x)proj
 #    msvc-static      - visual studio target produces only a static lib
+#    msvc-force-static- visual studio always uses static libraries for svn libs
 #    add-deps         - expands to additional autoconf-defined dependencies
 #    add-install-deps - like add-deps, but for the install step
 #    external-lib     - expands to additional autoconf-defined libs
@@ -820,6 +821,7 @@ path = subversion/tests/libsvn_fs
 sources = locks-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_delta libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [fs-test]
 description = Test locks in libsvn_fs
@@ -867,6 +869,7 @@ path = subversion/tests/libsvn_subr
 sources = checksum-test.c
 install = test
 libs = libsvn_test libsvn_subr apr
+msvc-force-static = yes
 
 [compat-test]
 description = Test compatibility functions
@@ -891,6 +894,7 @@ path = subversion/tests/libsvn_subr
 sources = crypto-test.c
 install = test
 libs = libsvn_test libsvn_subr aprutil apr
+msvc-force-static = yes
 
 [dirent_uri-test]
 description = Test dirent_uri library
@@ -1097,6 +1101,7 @@ path = subversion/tests/libsvn_client
 sources = client-test.c
 install = test
 libs = libsvn_test libsvn_client libsvn_wc libsvn_repos libsvn_ra libsvn_fs libsvn_delta libsvn_subr apriconv apr
+msvc-force-static = yes
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_diff
@@ -1151,6 +1156,7 @@ path = subversion/tests/libsvn_wc
 sources = conflict-data-test.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [db-test]
 description = Test the wc-ng database subsystem
@@ -1159,6 +1165,7 @@ path = subversion/tests/libsvn_wc
 sources = db-test.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [pristine-store-test]
 description = Test the wc-ng pristine text storage subsystem
@@ -1167,6 +1174,7 @@ path = subversion/tests/libsvn_wc
 sources = pristine-store-test.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [entries-compat-test]
 description = Test backwards compat for the entry interface
@@ -1175,6 +1183,7 @@ path = subversion/tests/libsvn_wc
 sources = entries-compat.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [op-depth-test]
 description = Test layered tree changes
@@ -1183,6 +1192,7 @@ path = subversion/tests/libsvn_wc
 sources = op-depth-test.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [wc-queries-test]
 description = Test Sqlite query evaluation
@@ -1199,6 +1209,7 @@ path = subversion/tests/libsvn_wc
 sources = wc-test.c utils.c
 install = test
 libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 
 # ----------------------------------------------------------------------------
 # These are not unit tests at all, they are small programs that exercise
@@ -1230,6 +1241,7 @@ path = subversion/tests/cmdline
 sources = entries-dump.c
 install = test
 libs = libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 testing = skip
 
 [atomic-ra-revprop-change]
@@ -1246,6 +1258,7 @@ path = subversion/tests/libsvn_wc
 sources = wc-lock-tester.c
 install = test
 libs = libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 testing = skip
 
 [wc-incomplete-tester]
@@ -1254,6 +1267,7 @@ path = subversion/tests/libsvn_wc
 sources = wc-incomplete-tester.c
 install = test
 libs = libsvn_wc libsvn_subr apriconv apr
+msvc-force-static = yes
 testing = skip
 
 # ----------------------------------------------------------------------------

Modified: subversion/trunk/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_base.py?rev=1520893&r1=1520892&r2=1520893&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_base.py (original)
+++ subversion/trunk/build/generator/gen_base.py Sun Sep  8 18:36:27 2013
@@ -334,6 +334,10 @@ class DependencyGraph:
     else:
       self.deps[type][target] = [ source ]
 
+  def remove(self, type, target, source):
+    if target in self.deps[type] and source in self.deps[type][target]:
+      self.deps[type][target].remove(source)
+
   def bulk_add(self, type, target, sources):
     if target in self.deps[type]:
       self.deps[type][target].extend(sources)
@@ -541,6 +545,8 @@ class TargetExe(TargetLinked):
     self.manpages = options.get('manpages', '')
     self.testing = options.get('testing')
 
+    self.msvc_force_static = options.get('msvc-force-static') == 'yes'
+
   def add_dependencies(self):
     TargetLinked.add_dependencies(self)
 
@@ -594,7 +600,6 @@ class TargetLib(TargetLinked):
     "tries to disable building as a shared library,"
 
     self.msvc_static = True
-    self.msvc_export = []
 
 class TargetApacheMod(TargetLib):
 

Modified: subversion/trunk/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1520893&r1=1520892&r2=1520893&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Sun Sep  8 18:36:27 2013
@@ -252,6 +252,21 @@ class WinGeneratorBase(gen_win_dependenc
             dll_targets.append(self.create_dll_target(target))
     install_targets.extend(dll_targets)
 
+    # Fix up targets that can't be linked to libraries
+    if not self.disable_shared:
+      for target in install_targets:
+        if isinstance(target, gen_base.TargetExe) and target.msvc_force_static:
+
+          # Make direct dependencies of all the indirect dependencies
+          linked_deps = {}
+          self.get_linked_win_depends(target, linked_deps)
+
+          for lk in linked_deps.keys():
+            if not isinstance(lk, gen_base.TargetLib) or not lk.msvc_export:
+              self.graph.add(gen_base.DT_LINK, target.name, lk)
+            else:
+              self.graph.remove(gen_base.DT_LINK, target.name, lk)
+
     for target in install_targets:
       target.project_guid = self.makeguid(target.name)
 
@@ -302,9 +317,7 @@ class WinGeneratorBase(gen_win_dependenc
       # against the static libraries because they sometimes access internal
       # library functions.
 
-      # ### The magic behavior for 'test' in a name and 'entries-dump' should
-      # ### move to another option in build.conf
-      if dep in deps[key] and key.find("test") == -1 and key != 'entries-dump':
+      if dep in deps[key]:
         deps[key].remove(dep)
         deps[key].append(target)