classification
Title: distutils/_msvccompiler does not remove /DLL during link(CCompiler.EXECUTABLE)
Type: compile error Stage: resolved
Components: Distutils Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: James Salter, dstufft, eric.araujo, steve.dower
Priority: normal Keywords: patch

Created on 2015-07-20 11:05 by James Salter, last changed 2021-02-03 18:26 by steve.dower. This issue is now closed.

Files
File name Uploaded Description Edit
_msvccompiler_link.patch James Salter, 2015-07-20 11:05
Messages (2)
msg246976 - (view) Author: James Salter (James Salter) * Date: 2015-07-20 11:05
Encountered trying to build numpy with python 3.5b3, visual studio 2015.

From distutils/_msvccompiler.py:MSVCCompiler.link:

        if self._need_link(objects, output_filename):
            ldflags = (self.ldflags_shared_debug if debug
                       else self.ldflags_shared)
            if target_desc == CCompiler.EXECUTABLE:
                ldflags = ldflags[1:]

But

        self.ldflags_shared = [
            '/nologo', '/DLL', '/INCREMENTAL:NO'
        ]
        self.ldflags_shared_debug = [
            '/nologo', '/DLL', '/INCREMENTAL:no', '/DEBUG:FULL'
        ]

Which leads to a DLL being created instead of a .exe.

I have attached a patch that explicitly removes '/DLL' rather than trimming by index.
msg386382 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:26
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2021-02-03 18:26:24steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386382

resolution: out of date
stage: resolved
2015-07-20 11:05:19James Saltercreate