You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Russell Yanofsky <re...@columbia.edu> on 2003/10/14 05:46:57 UTC
[PATCH] Compiling Subversion Libraries as DLLs on Windows
I'd like to get some feedback on a patch that builds subversion libraries as
dlls instead of libs on windows. It uses the
automatically-generated-DEF-file approach discussed back in March in this
thread:
http://www.contactor.se/~dast/svn/archive-2003-03/1457.shtml
The patch is actually three separate patches, which are attached to this
message and are meant to be applied successively. The first patch causes
subversion libraries to be linked with the dynamic apr library instead of
the static one. The second patch eliminates some special case code from
gen_win.py for compiling mod_dav_svn and mod_authz_svn which the first patch
obsoletes. And the third patch contains the changes needed to generate DEF
files and compile the libraries as DLLs.
These patches aren't ready to be applied. They cause at least a few
problems:
1) They break compilation of test programs which call non-exported library
functions. (See test-errors.txt for the resulting link errors.)
2) They break the windows testing script because subversion exes won't run
without being in the same directory as the dll's they depend on.
3) They probably break the windows installer. It would need to be updated to
install the new dlls.
Anyone have ideas on how to move forward, or feedback on what's been done so
far?
- Russ
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Russell Yanofsky <re...@columbia.edu>.
Barry Scott wrote:
> Can you update the RC file automaticall with the revision number that
> is being built?
Yes, the resource script pulls in the number from svn_version.h.
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Barry Scott <ba...@barrys-emacs.org>.
Can you update the RC file automaticall with the revision number that is
being built?
BArry
At 16-10-2003 22:26, Russell Yanofsky wrote:
>Barry Scott wrote:
> > I did not see a .RC file with a version resource. Is it missing
> > from the patch or did I miss something?
> >
> > You must have a version resource with the right version info in it to
> > allow for maintenance. e.g. checking DLL versions when installing
> > a patch kit.
>
>Good point. There is an .RC file already (build\win32\svn.rc), but it isn't
>used by the build generator for the new DLL's because I neglected to assign
>them "desc" values in build.conf. I'll include these in a future patch.
>
>- Russ
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Russell Yanofsky <re...@columbia.edu>.
Barry Scott wrote:
> I did not see a .RC file with a version resource. Is it missing
> from the patch or did I miss something?
>
> You must have a version resource with the right version info in it to
> allow for maintenance. e.g. checking DLL versions when installing
> a patch kit.
Good point. There is an .RC file already (build\win32\svn.rc), but it isn't
used by the build generator for the new DLL's because I neglected to assign
them "desc" values in build.conf. I'll include these in a future patch.
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Barry Scott <ba...@barrys-emacs.org>.
I did not see a .RC file with a version resource. Is it missing
from the patch or did I miss something?
You must have a version resource with the right version info in it to
allow for maintenance. e.g. checking DLL versions when installing
a patch kit.
Barry
At 14-10-2003 06:46, Russell Yanofsky wrote:
>I'd like to get some feedback on a patch that builds subversion libraries as
>dlls instead of libs on windows. It uses the
>automatically-generated-DEF-file approach discussed back in March in this
>thread:
>
>http://www.contactor.se/~dast/svn/archive-2003-03/1457.shtml
>
>The patch is actually three separate patches, which are attached to this
>message and are meant to be applied successively. The first patch causes
>subversion libraries to be linked with the dynamic apr library instead of
>the static one. The second patch eliminates some special case code from
>gen_win.py for compiling mod_dav_svn and mod_authz_svn which the first patch
>obsoletes. And the third patch contains the changes needed to generate DEF
>files and compile the libraries as DLLs.
>
>These patches aren't ready to be applied. They cause at least a few
>problems:
>
>1) They break compilation of test programs which call non-exported library
>functions. (See test-errors.txt for the resulting link errors.)
>
>2) They break the windows testing script because subversion exes won't run
>without being in the same directory as the dll's they depend on.
>
>3) They probably break the windows installer. It would need to be updated to
>install the new dlls.
>
>Anyone have ideas on how to move forward, or feedback on what's been done so
>far?
>
>- Russ
>
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Russell Yanofsky <re...@columbia.edu>.
Brandon Ehle wrote:
> Russell Yanofsky wrote:
>> These patches aren't ready to be applied. They cause at least a few
>> problems:
>>
>> 1) They break compilation of test programs which call non-exported
>> library functions. (See test-errors.txt for the resulting link
>> errors.)
>>
>> 2) They break the windows testing script because subversion exes
>> won't run without being in the same directory as the dll's they
>> depend on.
>>
> Not to mention the debugger. We could probably just compile all the
> dlls and exes to the same directory.
I'm not sure doing this would make things much easier. It looks like the
testing code assumes that the build directories have the same structure as
the source directories. And it already copies the .exe's before running
them.
The debugger isn't as much of a concern since it has to be invoked manually.
Testing and installation need to work automatically.
>
>> 3) They probably break the windows installer. It would need to be
>> updated to install the new dlls.
>>
>> Anyone have ideas on how to move forward, or feedback on what's been
>> done so far?
>>
> I'm running with your applied patches + a couple of fixes to get the
> VC.NET projects working.
Thanks for doing this. I'll make a new patch with your changes. Can you post
the autoconverted apr projects too?
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
RE: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Roger Lipscombe <ro...@differentpla.net>.
> Using a tool that tracks OS leaks such as Heap, Critical Sections,
> Thread Local Storage, etc. None of these items where getting leaked
> with the staticly linked version of svn, but they are leaking
> in the DLL
> version, although the only things that are leaking are what
> apr_terminate is supposed to clean up which isn't much.
If apr_terminate is registered using atexit(), it's possible that it's
getting called after the leak-detection functions. This is/was a problem
with some versions of MSVCRT.DLL, and may be a problem with other
leak-detection tools.
Cheers,
Roger.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Brandon Ehle <az...@yahoo.com>.
Russell Yanofsky wrote:
>Brandon Ehle wrote:
>
>
>>Looks like switching to dlls introduces some memory leaks at shutdown
>>because of the way atexit(apr_terminate) is getting called. I'm not
>>entirely sure what the interaction is, but apr_initialize() is now
>>being called from within the libsvn_subr-1.dll instead of the
>>executable.
>>
>>
>
>Does it matter where apr_initialize is called from? How do you know there
>are problems at shutdown? (I haven't actually tried running the dynamically
>linked exe's yet).
>
>
Using a tool that tracks OS leaks such as Heap, Critical Sections,
Thread Local Storage, etc. None of these items where getting leaked
with the staticly linked version of svn, but they are leaking in the DLL
version, although the only things that are leaking are what
apr_terminate is supposed to clean up which isn't much.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Russell Yanofsky <re...@columbia.edu>.
Brandon Ehle wrote:
> Looks like switching to dlls introduces some memory leaks at shutdown
> because of the way atexit(apr_terminate) is getting called. I'm not
> entirely sure what the interaction is, but apr_initialize() is now
> being called from within the libsvn_subr-1.dll instead of the
> executable.
Does it matter where apr_initialize is called from? How do you know there
are problems at shutdown? (I haven't actually tried running the dynamically
linked exe's yet).
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Brandon Ehle <az...@yahoo.com>.
Brandon Ehle wrote:
> Russell Yanofsky wrote:
>
>> I'd like to get some feedback on a patch that builds subversion
>> libraries as
>> dlls instead of libs on windows. It uses the
>> automatically-generated-DEF-file approach discussed back in March in
>> this
>> thread:
>
>>
>> Anyone have ideas on how to move forward, or feedback on what's been
>> done so
>> far?
>>
> I'm running with your applied patches + a couple of fixes to get the
> VC.NET projects working. I'll let you know if I run into any issues,
> but so far so good.
>
Looks like switching to dlls introduces some memory leaks at shutdown
because of the way atexit(apr_terminate) is getting called. I'm not
entirely sure what the interaction is, but apr_initialize() is now being
called from within the libsvn_subr-1.dll instead of the executable.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Compiling Subversion Libraries as DLLs on Windows
Posted by Brandon Ehle <az...@yahoo.com>.
Russell Yanofsky wrote:
>I'd like to get some feedback on a patch that builds subversion libraries as
>dlls instead of libs on windows. It uses the
>automatically-generated-DEF-file approach discussed back in March in this
>thread:
>
>http://www.contactor.se/~dast/svn/archive-2003-03/1457.shtml
>
>The patch is actually three separate patches, which are attached to this
>message and are meant to be applied successively. The first patch causes
>subversion libraries to be linked with the dynamic apr library instead of
>the static one. The second patch eliminates some special case code from
>gen_win.py for compiling mod_dav_svn and mod_authz_svn which the first patch
>obsoletes. And the third patch contains the changes needed to generate DEF
>files and compile the libraries as DLLs.
>
>These patches aren't ready to be applied. They cause at least a few
>problems:
>
>1) They break compilation of test programs which call non-exported library
>functions. (See test-errors.txt for the resulting link errors.)
>
>2) They break the windows testing script because subversion exes won't run
>without being in the same directory as the dll's they depend on.
>
Not to mention the debugger. We could probably just compile all the
dlls and exes to the same directory.
>3) They probably break the windows installer. It would need to be updated to
>install the new dlls.
>
>Anyone have ideas on how to move forward, or feedback on what's been done so
>far?
>
I'm running with your applied patches + a couple of fixes to get the
VC.NET projects working. I'll let you know if I run into any issues,
but so far so good.
1) I had to comment out the move_proj_file stuff for the project file
overrides because those are static project files and need to be updated
and I'm just running with the auto-converted projects just fine.
2) I had to specify the .def file in the project link tab.
--- generator/gen_vcnet_vcproj.py (revision 7428)
+++ generator/gen_vcnet_vcproj.py (working copy)
@@ -48,6 +48,8 @@
sources = self.get_proj_sources(False, target, rootpath)
+ linkdef = self.get_proj_linkdef(target, rootpath)
+
data = {
'target' : target,
'target_type' : config_type,
@@ -59,6 +61,7 @@
'sources' : sources,
'default_platform' : self.platforms[0],
'default_config' : configs[0].name,
+ 'linker_definition' : linkdef,
'is_exe' : ezt.boolean(isinstance(target, gen_base.TargetExe)),
'is_external' : ezt.boolean(isinstance(target,
gen_base.TargetProject)
and target.cmd),
@@ -99,17 +102,17 @@
# apr doesn't supply vcproj files, so move our pre-defined ones
# over if they don't match
- self.move_proj_file('apr', 'apr.vcproj')
- self.move_proj_file('apr-iconv', 'apriconv.vcproj')
- self.move_proj_file(os.path.join('apr-iconv','ccs'),
- 'apriconv_ccs_modules.vcproj')
- self.move_proj_file(os.path.join('apr-iconv','ces'),
- 'apriconv_ces_modules.vcproj')
- self.move_proj_file('apr-util', 'aprutil.vcproj')
- self.move_proj_file(os.path.join('apr-util','uri'),
- 'gen_uri_delims.vcproj')
- self.move_proj_file(os.path.join('apr-util','xml', 'expat', 'lib'),
- 'xml.vcproj')
+## self.move_proj_file('apr', 'apr.vcproj')
+## self.move_proj_file('apr-iconv', 'apriconv.vcproj')
+## self.move_proj_file(os.path.join('apr-iconv','ccs'),
+## 'apriconv_ccs_modules.vcproj')
+## self.move_proj_file(os.path.join('apr-iconv','ces'),
+## 'apriconv_ces_modules.vcproj')
+## self.move_proj_file('apr-util', 'aprutil.vcproj')
+## self.move_proj_file(os.path.join('apr-util','uri'),
+## 'gen_uri_delims.vcproj')
+## self.move_proj_file(os.path.join('apr-util','xml', 'expat', 'lib'),
+## 'xml.vcproj')
install_targets = self.get_install_targets()
--- generator/vcnet_vcproj.ezt (revision 7428)
+++ generator/vcnet_vcproj.ezt (working copy)
@@ -51,7 +51,8 @@
[end]
AdditionalLibraryDirectories="..\..\..\db4-win32\lib;[for
configs.libdirs][configs.libdirs];[end]"
TargetMachine="1"
IgnoreDefaultLibraryNames="libc.lib"
- GenerateDebugInformation="TRUE"
+[if-any linker_definition]
ModuleDefinitionFile="[linker_definition]"
+[end] GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"[is configs.name "Debug"]
OptimizeReferences="0"[else]
OptimizeReferences="2"
--- generator/gen_win.py (revision 7428)
+++ generator/gen_win.py (working copy)
@@ -256,6 +257,11 @@
))
return configs
+ def get_proj_linkdef(self, target, rootpath):
+ if isinstance(target, gen_base.TargetLib) and target.msvc_export:
+ return rootpath + "\\" + target.path + "\\" + target.name + ".def"
+ return None
+
def get_proj_sources(self, quote_path, target, rootpath):
"Get the list of source files for each project"
sources = [ ]
@@ -265,8 +271,21 @@
if quote_path and '-' in rsrc:
rsrc = '"%s"' % rsrc
sources.append(ProjectItem(path=rsrc, reldir=reldir, user_deps=[],
- swig_language=None))
+ custom_build=None))
+
+ dsrc = self.get_proj_linkdef(target, rootpath)
+ if dsrc:
+ gsrc = rootpath + "\\build\\generator\\extractor.py"
+ deps = []
+ for header in target.msvc_export:
+ deps.append(rootpath + "\\subversion\\include\\" + header)
+
+ sources.append(ProjectItem(path=dsrc, reldir=None, custom_build=None,
+ user_deps=[]))
+ sources.append(ProjectItem(path=gsrc, reldir=None,
custom_build="defgen",
+ user_deps=deps, custom_target=dsrc))
+
if isinstance(target, gen_base.TargetSWIG):
for obj in self.graph.get_sources(gen_base.DT_LINK, target.name):
if isinstance(obj, gen_base.SWIGObject):
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org