You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Hett <st...@egosoft.com> on 2015/07/20 16:20:02 UTC

1.9/trunk build errors when building without OpenSSL

Hi,

following several hours of investigation and discussion on IRC with 
danielsh, philipm and bert I believe there to be some issue in the build 
generator for Windows.

Running the python command:
python gen-make.py -t vcproj --with-zlib=..\zlib --with-apr=..\apr 
--with-apr-util=..\apr-util --vsnet-version=2010

followed by building (using VS 2010 SP1):
msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release

I get 8 project errors:
- libsvn_ra_dll: LINK : fatal error LNK1181: cannot open input file 
'ssleay32.lib' 
[E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\libsvn_ra_dll.vcxproj]
- test_client: LINK : fatal error LNK1181: cannot open input file 
'ssleay32.lib' 
[E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_client.vcxproj]
- conflict-data-test: LINK : fatal error LNK1181: cannot open input file 
'ssleay32.lib' 
[E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_conflict_data.vcxproj]
- some more tests - all with ssleay32.lib missing

ssleay32.lib is an OpenSSL library specified in build.conf in the 
openssl-section alongside libeay32.lib for the "msvc-libs"-option.

Looking at the generated libsvn_ra_dll.vcxproj-file actually shows the 
additional linker dependencies being set to:
[...]ssleay32.lib;libeay32.lib;secur32.lib[...]

IMHO this is wrong. I'm explicitly building without OpenSSL as well as 
without serf and still these OpenSSL/Serf librarie references are being 
generated in the project files.

Taken from build.conf:
libsvn_ra specifies "ra_libs" as a libs dependency and "ra-libs" 
specifies "libsvn_ra_serf" as a libs-dependency which then specifies 
"serf" as a lib-dependency which defines msvc-libs as secur32.lib.
"serf" then also defines "openssl" as the dependency which in effect 
takes ssleay32.lib and libeay32.lib as the setting for msvc-libs.

gen_win.py:get_win_libs: takes the msvc-libs conditionless as the 
required dependencies *UNLESS* the target specifies msvc_static (in 
which case get_win_libs returns an empty array).

Originally my thought was that the generated dependency tree should be 
adjusted so it correctly reflects the build-parameter-state (aka: drop 
serf/openSSL completely) but danielsh clarified to me that he believes 
the issue rather to be in the part generating the project output since 
the dependency tree should simply reflect exactly what is specified in 
the build.conf-file.

So I guess that the issue is located in gen_win.py:get_win_libs() not 
omitting the libraries, if these are not specified by the gen-make commands.

I've tested the attached patch and with that applied, running the two 
build commands stated above succeed with no errors (also verified that 
the generated project files then no longer contain the lib-references).
However, I'm not 100% convinced yet that this is the correct approach or 
whether some more generic solution would be more suitable (aka one which 
would handle any optional library not present and the corresponding 
entry in the build dependency tree).
Given that there's already another special case command omitting the 
ra-serf-install target if "serf" is not found, I guess the patch might 
be acceptable though.
Nevertheless, I think some SVN developer is better of with providing 
more input on this so to find the right solution.

(note: the issue also exists in 1.9 and currently results in the fact 
that building without OpenSSL fails on Windows - assuming this is not a 
problem in 1.8, it's a regression of 1.9 compared to 1.8).

Regards,
Stefan

Re: 1.9/trunk build errors when building without OpenSSL

Posted by Stefan Hett <st...@egosoft.com>.
added patchnotes:

[[[
Fix building SVN under Windows without OpenSSL/Serf.

* build/generator/gen_win.py
   (get_win_libs): skip serf/openssl dependencies, if these optional 
libs are
                   not present
]]]

Regards,
Stefan


Re: 1.9/trunk build errors when building without OpenSSL

Posted by Stefan Hett <st...@egosoft.com>.
> On 7/21/2015 7:55 AM, Branko Čibej wrote:
>> On 20.07.2015 16:20, Stefan Hett wrote:
>>> Hi,
>>>
>>> following several hours of investigation and discussion on IRC with
>>> danielsh, philipm and bert I believe there to be some issue in the
>>> build generator for Windows.
>>>
>>> Running the python command:
>>> python gen-make.py -t vcproj --with-zlib=..\zlib --with-apr=..\apr
>>> --with-apr-util=..\apr-util --vsnet-version=2010
>>>
>>> followed by building (using VS 2010 SP1):
>>> msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release
>>>
>>> I get 8 project errors:
>>> - libsvn_ra_dll: LINK : fatal error LNK1181: cannot open input file
>>> 'ssleay32.lib'
>>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\libsvn_ra_dll.vcxproj] 
>>>
>>> - test_client: LINK : fatal error LNK1181: cannot open input file
>>> 'ssleay32.lib'
>>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_client.vcxproj] 
>>>
>>> - conflict-data-test: LINK : fatal error LNK1181: cannot open input
>>> file 'ssleay32.lib'
>>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_conflict_data.vcxproj] 
>>>
>>> - some more tests - all with ssleay32.lib missing
>>>
>>> ssleay32.lib is an OpenSSL library specified in build.conf in the
>>> openssl-section alongside libeay32.lib for the "msvc-libs"-option.
>>>
>>> Looking at the generated libsvn_ra_dll.vcxproj-file actually shows the
>>> additional linker dependencies being set to:
>>> [...]ssleay32.lib;libeay32.lib;secur32.lib[...]
>>>
>>> IMHO this is wrong. I'm explicitly building without OpenSSL as well as
>>> without serf and still these OpenSSL/Serf librarie references are
>>> being generated in the project files.
>>>
>>> Taken from build.conf:
>>> libsvn_ra specifies "ra_libs" as a libs dependency and "ra-libs"
>>> specifies "libsvn_ra_serf" as a libs-dependency which then specifies
>>> "serf" as a lib-dependency which defines msvc-libs as secur32.lib.
>>> "serf" then also defines "openssl" as the dependency which in effect
>>> takes ssleay32.lib and libeay32.lib as the setting for msvc-libs.
>>>
>>> gen_win.py:get_win_libs: takes the msvc-libs conditionless as the
>>> required dependencies *UNLESS* the target specifies msvc_static (in
>>> which case get_win_libs returns an empty array).
>>>
>>> Originally my thought was that the generated dependency tree should be
>>> adjusted so it correctly reflects the build-parameter-state (aka: drop
>>> serf/openSSL completely) but danielsh clarified to me that he believes
>>> the issue rather to be in the part generating the project output since
>>> the dependency tree should simply reflect exactly what is specified in
>>> the build.conf-file.
>>>
>>> So I guess that the issue is located in gen_win.py:get_win_libs() not
>>> omitting the libraries, if these are not specified by the gen-make
>>> commands.
>>>
>>> I've tested the attached patch and with that applied, running the two
>>> build commands stated above succeed with no errors (also verified that
>>> the generated project files then no longer contain the lib-references).
>>> However, I'm not 100% convinced yet that this is the correct approach
>>> or whether some more generic solution would be more suitable (aka one
>>> which would handle any optional library not present and the
>>> corresponding entry in the build dependency tree).
>>> Given that there's already another special case command omitting the
>>> ra-serf-install target if "serf" is not found, I guess the patch might
>>> be acceptable though.
>>> Nevertheless, I think some SVN developer is better of with providing
>>> more input on this so to find the right solution.
>>>
>>> (note: the issue also exists in 1.9 and currently results in the fact
>>> that building without OpenSSL fails on Windows - assuming this is not
>>> a problem in 1.8, it's a regression of 1.9 compared to 1.8).
>> It's very likely not a regression but a long-standing missing feature of
>> the Windows build generator.
>>
>> Note that these days, the only thing that uses OpenSSL is Serf; so, the
>> libsvn_ra DLL should only link OpenSSL if we're statically linking Serf
>> and if Serf was build with OpenSSL support. Even then, I believe that
>> OpenSSL should be in the Serf library dependency list. I'd have expected
>> that there'd be no need to mention the OpenSSL importlib dependencies in
>> the libsvn_ra project at all ... but ISTR they're needed on Windows
>> despite the explicit dependency in Serf?
>>
>> -- Brane
>>
> I think I can't follow you here. openssl is only listed as a 
> dependency in [serf] in build.conf. There's no explicit dependency to 
> openSSL in libsvn_ra. Only the implicit one via serf.
> And yes, as far as my understanding with Windows/DLLs goes that's 
> needed, unless you build openssl statically and link it that way into 
> serf.
>
> For the record: I didn't test whether building openSSL statically and 
> linking it that way with Serf is possible/supported at all.
>
> Regards,
> Stefan
>
I'c that a better approach was taken on trunk to resolve this problem. 
Thanks for taking care and resolving the issue.

Regards,
Stefan

Re: 1.9/trunk build errors when building without OpenSSL

Posted by Stefan Hett <st...@egosoft.com>.
On 7/21/2015 7:55 AM, Branko Čibej wrote:
> On 20.07.2015 16:20, Stefan Hett wrote:
>> Hi,
>>
>> following several hours of investigation and discussion on IRC with
>> danielsh, philipm and bert I believe there to be some issue in the
>> build generator for Windows.
>>
>> Running the python command:
>> python gen-make.py -t vcproj --with-zlib=..\zlib --with-apr=..\apr
>> --with-apr-util=..\apr-util --vsnet-version=2010
>>
>> followed by building (using VS 2010 SP1):
>> msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release
>>
>> I get 8 project errors:
>> - libsvn_ra_dll: LINK : fatal error LNK1181: cannot open input file
>> 'ssleay32.lib'
>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\libsvn_ra_dll.vcxproj]
>> - test_client: LINK : fatal error LNK1181: cannot open input file
>> 'ssleay32.lib'
>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_client.vcxproj]
>> - conflict-data-test: LINK : fatal error LNK1181: cannot open input
>> file 'ssleay32.lib'
>> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_conflict_data.vcxproj]
>> - some more tests - all with ssleay32.lib missing
>>
>> ssleay32.lib is an OpenSSL library specified in build.conf in the
>> openssl-section alongside libeay32.lib for the "msvc-libs"-option.
>>
>> Looking at the generated libsvn_ra_dll.vcxproj-file actually shows the
>> additional linker dependencies being set to:
>> [...]ssleay32.lib;libeay32.lib;secur32.lib[...]
>>
>> IMHO this is wrong. I'm explicitly building without OpenSSL as well as
>> without serf and still these OpenSSL/Serf librarie references are
>> being generated in the project files.
>>
>> Taken from build.conf:
>> libsvn_ra specifies "ra_libs" as a libs dependency and "ra-libs"
>> specifies "libsvn_ra_serf" as a libs-dependency which then specifies
>> "serf" as a lib-dependency which defines msvc-libs as secur32.lib.
>> "serf" then also defines "openssl" as the dependency which in effect
>> takes ssleay32.lib and libeay32.lib as the setting for msvc-libs.
>>
>> gen_win.py:get_win_libs: takes the msvc-libs conditionless as the
>> required dependencies *UNLESS* the target specifies msvc_static (in
>> which case get_win_libs returns an empty array).
>>
>> Originally my thought was that the generated dependency tree should be
>> adjusted so it correctly reflects the build-parameter-state (aka: drop
>> serf/openSSL completely) but danielsh clarified to me that he believes
>> the issue rather to be in the part generating the project output since
>> the dependency tree should simply reflect exactly what is specified in
>> the build.conf-file.
>>
>> So I guess that the issue is located in gen_win.py:get_win_libs() not
>> omitting the libraries, if these are not specified by the gen-make
>> commands.
>>
>> I've tested the attached patch and with that applied, running the two
>> build commands stated above succeed with no errors (also verified that
>> the generated project files then no longer contain the lib-references).
>> However, I'm not 100% convinced yet that this is the correct approach
>> or whether some more generic solution would be more suitable (aka one
>> which would handle any optional library not present and the
>> corresponding entry in the build dependency tree).
>> Given that there's already another special case command omitting the
>> ra-serf-install target if "serf" is not found, I guess the patch might
>> be acceptable though.
>> Nevertheless, I think some SVN developer is better of with providing
>> more input on this so to find the right solution.
>>
>> (note: the issue also exists in 1.9 and currently results in the fact
>> that building without OpenSSL fails on Windows - assuming this is not
>> a problem in 1.8, it's a regression of 1.9 compared to 1.8).
> It's very likely not a regression but a long-standing missing feature of
> the Windows build generator.
>
> Note that these days, the only thing that uses OpenSSL is Serf; so, the
> libsvn_ra DLL should only link OpenSSL if we're statically linking Serf
> and if Serf was build with OpenSSL support. Even then, I believe that
> OpenSSL should be in the Serf library dependency list. I'd have expected
> that there'd be no need to mention the OpenSSL importlib dependencies in
> the libsvn_ra project at all ... but ISTR they're needed on Windows
> despite the explicit dependency in Serf?
>
> -- Brane
>
I think I can't follow you here. openssl is only listed as a dependency 
in [serf] in build.conf. There's no explicit dependency to openSSL in 
libsvn_ra. Only the implicit one via serf.
And yes, as far as my understanding with Windows/DLLs goes that's 
needed, unless you build openssl statically and link it that way into serf.

For the record: I didn't test whether building openSSL statically and 
linking it that way with Serf is possible/supported at all.

Regards,
Stefan

Re: 1.9/trunk build errors when building without OpenSSL

Posted by Branko Čibej <br...@wandisco.com>.
On 20.07.2015 16:20, Stefan Hett wrote:
> Hi,
>
> following several hours of investigation and discussion on IRC with
> danielsh, philipm and bert I believe there to be some issue in the
> build generator for Windows.
>
> Running the python command:
> python gen-make.py -t vcproj --with-zlib=..\zlib --with-apr=..\apr
> --with-apr-util=..\apr-util --vsnet-version=2010
>
> followed by building (using VS 2010 SP1):
> msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release
>
> I get 8 project errors:
> - libsvn_ra_dll: LINK : fatal error LNK1181: cannot open input file
> 'ssleay32.lib'
> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\libsvn_ra_dll.vcxproj]
> - test_client: LINK : fatal error LNK1181: cannot open input file
> 'ssleay32.lib'
> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_client.vcxproj]
> - conflict-data-test: LINK : fatal error LNK1181: cannot open input
> file 'ssleay32.lib'
> [E:\[delete]SVNTest\SVN\src-trunk\build\win32\vcnet-vcproj\test_conflict_data.vcxproj]
> - some more tests - all with ssleay32.lib missing
>
> ssleay32.lib is an OpenSSL library specified in build.conf in the
> openssl-section alongside libeay32.lib for the "msvc-libs"-option.
>
> Looking at the generated libsvn_ra_dll.vcxproj-file actually shows the
> additional linker dependencies being set to:
> [...]ssleay32.lib;libeay32.lib;secur32.lib[...]
>
> IMHO this is wrong. I'm explicitly building without OpenSSL as well as
> without serf and still these OpenSSL/Serf librarie references are
> being generated in the project files.
>
> Taken from build.conf:
> libsvn_ra specifies "ra_libs" as a libs dependency and "ra-libs"
> specifies "libsvn_ra_serf" as a libs-dependency which then specifies
> "serf" as a lib-dependency which defines msvc-libs as secur32.lib.
> "serf" then also defines "openssl" as the dependency which in effect
> takes ssleay32.lib and libeay32.lib as the setting for msvc-libs.
>
> gen_win.py:get_win_libs: takes the msvc-libs conditionless as the
> required dependencies *UNLESS* the target specifies msvc_static (in
> which case get_win_libs returns an empty array).
>
> Originally my thought was that the generated dependency tree should be
> adjusted so it correctly reflects the build-parameter-state (aka: drop
> serf/openSSL completely) but danielsh clarified to me that he believes
> the issue rather to be in the part generating the project output since
> the dependency tree should simply reflect exactly what is specified in
> the build.conf-file.
>
> So I guess that the issue is located in gen_win.py:get_win_libs() not
> omitting the libraries, if these are not specified by the gen-make
> commands.
>
> I've tested the attached patch and with that applied, running the two
> build commands stated above succeed with no errors (also verified that
> the generated project files then no longer contain the lib-references).
> However, I'm not 100% convinced yet that this is the correct approach
> or whether some more generic solution would be more suitable (aka one
> which would handle any optional library not present and the
> corresponding entry in the build dependency tree).
> Given that there's already another special case command omitting the
> ra-serf-install target if "serf" is not found, I guess the patch might
> be acceptable though.
> Nevertheless, I think some SVN developer is better of with providing
> more input on this so to find the right solution.
>
> (note: the issue also exists in 1.9 and currently results in the fact
> that building without OpenSSL fails on Windows - assuming this is not
> a problem in 1.8, it's a regression of 1.9 compared to 1.8).

It's very likely not a regression but a long-standing missing feature of
the Windows build generator.

Note that these days, the only thing that uses OpenSSL is Serf; so, the
libsvn_ra DLL should only link OpenSSL if we're statically linking Serf
and if Serf was build with OpenSSL support. Even then, I believe that
OpenSSL should be in the Serf library dependency list. I'd have expected
that there'd be no need to mention the OpenSSL importlib dependencies in
the libsvn_ra project at all ... but ISTR they're needed on Windows
despite the explicit dependency in Serf?

-- Brane