dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

SSL backend causing fc_git_info failure on MS Windows #156

Closed miroi closed 8 years ago

miroi commented 8 years ago

Hints and tips ?

================================== FAILURES ===================================
______________________________ test_fc_git_info _______________________________

    def test_fc_git_info():
>       configure_build_and_exe('fc_git_info', 'python setup --fc=gfortran')

..\test.py:109:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'fc_git_info'
setup_command = 'python setup --fc=gfortran --generator="MinGW Makefiles" build-2015-10-15-16-23-26'
launcher = None

    def configure_build_and_exe(name, setup_command, launcher=None):

        stamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d-%H-%M-%S')

        os.chdir(os.path.join(HERE, name, 'cmake'))
        shutil.copy(os.path.join('..', '..', '..', 'update.py'), 'update.py')

        dst_dir = 'lib'
        if not os.path.exists(dst_dir):
            os.makedirs(dst_dir)
        shutil.copy(os.path.join('..', '..', '..', dst_dir, 'config.py'), dst_dir)

        dst_dir = os.path.join('lib', 'docopt')
        if not os.path.exists(dst_dir):
            os.makedirs(dst_dir)
        shutil.copy(os.path.join('..', '..', '..', dst_dir, 'docopt.py'), dst_dir)

        stdout, stderr = exe('python update.py ..')
        os.chdir(os.path.join(HERE, name))

        make_command = 'make'
        binary = './bin/example'
        if sys.platform == 'win32':
            setup_command += ' --generator="MinGW Makefiles"'
            make_command = 'mingw32-make'
            binary = 'bin\\\example.exe'

        if launcher:
            binary = '%s %s' % (launcher, binary)

        setup_command += ' build-%s' % stamp

        stdout, stderr = exe(setup_command)
>       assert stderr == ''
E       assert "python: can'...r directory\n" == ''
E         - python: can't open file 'setup': [Errno 2] No such file or directory

..\test.py:81: AssertionError
---------------------------- Captured stderr call -----------------------------
- parsing autocmake.cfg

- assembling modules: [                              ] (0/4)
- assembling modules: [#######                       ] (1/4)
- assembling modules: [###############               ] (2/4)
- assembling modules: [######################        ] (3/4)Traceback (most recent call last):
  File "update.py", line 546, in <module>
    main(sys.argv)
  File "update.py", line 425, in main
    modules = fetch_modules(config, relative_path)
  File "update.py", line 320, in fetch_modules
    fetch_url(src, dst)
  File "update.py", line 46, in fetch_url
    opener.retrieve(src, dst)
  File "C:\Python27\lib\urllib.py", line 245, in retrieve
    fp = self.open(url, data)
  File "C:\Python27\lib\urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "C:\Python27\lib\urllib.py", line 443, in open_https
    h.endheaders(data)
  File "C:\Python27\lib\httplib.py", line 1049, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 893, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 855, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 1274, in connect
    server_hostname=server_hostname)
  File "C:\Python27\lib\ssl.py", line 352, in wrap_socket
    _context=self)
  File "C:\Python27\lib\ssl.py", line 579, in __init__
    self.do_handshake()
  File "C:\Python27\lib\ssl.py", line 808, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
python: can't open file 'setup': [Errno 2] No such file or directory
============== 1 failed, 5 passed, 12 skipped in 360.86 seconds ===============
bast commented 8 years ago

I think the title is not ideal. This problem is in the SSL backend. I don't think this has anything to do with Autocmake. To debug it I recommend to not do this with Autocmake but debug urllib directly in a Python shell.

bast commented 8 years ago

Sorry I don't think this is an Autocmake issue and am therefore closing this.