Running MSVC via CMake using ssh to Cygwin works if using a password to login but not with a public key

StackOverflow https://stackoverflow.com/questions/17978984

Question

We have a Windows 7 desktop that we're hoping to use to run automated tests of a Windows port of our C++ code. It's successfully using a CMake build system, compiling with Visual Studio 10.0, if logged in locally. The automated test system we're using needs to ssh to the build machines using public-key authentication, so I've installed Cygwin and have sshd running as a service in a separate account (cyg_server). I can connect to it fine, logging in to the build account using its password, and run the build without issues. However, if I then add the public-key authentication, I can still log in fine, but the build fails, even if I'm logged in and running the build manually, so it's a login interactive bash shell just as for the working case! The error message is

3>LINK : fatal error LNK1101: incorrect MSPDB100.DLL version; recheck installation of this product

for every link step.

What could be different in the environment between password and public-key authentication that's causing this? Note that everything else is identical between a working and failing case - only the authentication method has changed, and this is repeatable so it's not running builds in a particular sequence that's at fault.

Was it helpful?

Solution

Probably what you need to do is run cyglsa-config in a Cygwin bash shell and then reboot the system. You might need to start the shell by right-clicking the Cygwin shell shortcut and selecting "Run as administrator", otherwise cyglsa-config may fail with a permission error. I had the same issue (with a different version of Visual C++), and cyglsa-config fixed it.

The following page from the Cygwin documentation explains the issues related to Windows security:

http://cygwin.com/cygwin-ug-net/ntsec.html

The relevant stuff starts in the section called "Switching the user context". It specifically mentions that the default approach has problems with Visual C++.

OTHER TIPS

I'm answering the question in case anyone else gets stuck with this issue, although my 'solution' isn't ideal, so I'm not going to accept the answer, in case anyone with a better approach comes across this.

Since the machine we're logging into is only being used for the automated tests, and so we only need to ssh into the one account, I've reconfigured the ssh service to run under that account, ensuring that it has the required permissions and also has ownership of files in /etc and /var previously owned by the cyg_server account. This then allows the build to work when using public-key authentication. It does give the build account rather more privileges than I'd like though!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top