Title: add .asm extension
Type: enhancement Stage: patch review
Components: Distutils Versions: Python 3.6
Status: open Resolution:
Dependencies: 7511 Superseder:
Assigned To: Nosy List: alexis, brian.curtin, eric.araujo, josip, rpetrov, skrah, sneves, steve.dower, tarek, zooko
Priority: normal Keywords: patch

Created on 2009-12-19 16:44 by skrah, last changed 2015-07-28 12:08 by skrah.

File name Uploaded Description Edit
vcasm.diff skrah, 2009-12-19 16:44
vcasm2.patch skrah, 2010-09-04 08:28
Messages (17)
msg96614 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2009-12-19 16:44

would it be possible to add .asm to the extensions? I attach a diff that
I have tested with VS Express.
msg104793 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-05-02 17:06
Distutils is frozen, switching to distutils2
msg114462 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-20 22:30
Could you add tests? There are helpers in than deal with temporary files, and we use unittest2 which provides decorators to skip the tests on non-Windows.
msg114757 - (view) Author: Roumen Petrov (rpetrov) * Date: 2010-08-23 23:19
To me distutils does not support assembler files and for other compilers this is required to build ctypes - see also issue 2942.
msg114758 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-23 23:26
> To me distutils does not support assembler files
Do you think it should?

> and for other compilers this is required to build ctypes
Sorry, I don’t understand. Can you rephrase?
msg114762 - (view) Author: Roumen Petrov (rpetrov) * Date: 2010-08-24 00:22
Please see my comments to issue 2942 - so I think compilers should support assembler suffixes.
msg115224 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-08-30 15:28
I have a new patch with tests, but I'm not quite satisfied with it.

The remaining problem is that the choice of ml64 or ml is fragile
if a user has executed `vcvarsall xyz`, and we attempt to use the
resulting environment.

For example, if `vcvarsall amd64` has been executed once in a command
line window, a subsequent `vcvarsall x86` will not reset the environment
sufficiently, so ml64 is detected and the x86 build will fail.

But in general this patch should work.
msg115225 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-08-30 15:30
For Visual Studio Express this issue depends on issue 7511.
msg115562 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-09-04 08:15
Minor cleanups in vcasm2.patch.
msg115563 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-09-04 08:28
Further cleanup (sorry for the mail volume!).
msg115564 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-04 09:39
(distutils2 bugs have all versions set)
msg135043 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2011-05-03 15:46
I got a bug report from a user that they encountered this error:

Then a follow-up in which they say they applied the patch from (this ticket is the superceder of that one) and got a different error:
msg135086 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2011-05-03 22:47
The poster should get the same error messages from:

ml64 /c /Cx x64dll.asm

Perhaps the assembly isn't MASM?
msg135088 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2011-05-04 00:01
Thanks, Stefan Krah. I posted your comment to the tahoe-dev mailing list:

Also Samuel Neves has posted on that thread.
msg247472 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2015-07-27 14:59
Steve, this issue has been open for a while:  Do you have an
opinion on whether this is useful to have?

I originally opened the issue because I am using masm in cdecimal,
but there are workarounds.
msg247483 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-07-27 21:09
I'm not against adding the support (to 3.6), though I'd be interested in what the workarounds are and whether it'd be more useful as an example (e.g. "here's how to support a special build step" vs. "all special build steps need to be merged into core").

There are also updates required since we now use distutils/ is only still there so that people who import it directly don't break.
msg247522 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2015-07-28 12:08
The workaround is telling users to run e.g. ``vcvarsall x64'' before
the build. then contains

  extra_objects = ['vcdiv64.obj']
  os.system("ml64 /c /Cx vcdiv64.asm"),

which is run before creating the extension. The extension itself
contains 'extra_objects':

ext = Extension (

That has always worked for me.  It isn't a big deal either, since
most people on Windows use installer packages anyway.

I have no strong opinion either way. If you think this adds too much
complexity, feel free to close the issue.
Date User Action Args
2015-07-28 12:08:02skrahsetmessages: + msg247522
2015-07-27 21:09:11steve.dowersetmessages: + msg247483
versions: + Python 3.6, - Python 3.5
2015-07-27 14:59:35skrahsetnosy: + skrah, steve.dower
messages: + msg247472
2014-10-14 16:15:42skrahsetnosy: - skrah
2014-03-13 20:15:57eric.araujosetassignee: tarek ->
components: + Distutils, - Distutils2
versions: + Python 3.5, - 3rd party
2011-05-04 00:01:30zookosetmessages: + msg135088
2011-05-03 22:47:44skrahsetmessages: + msg135086
2011-05-03 15:46:11zookosetmessages: + msg135043
2011-02-13 15:31:31alexissetnosy: + alexis
2010-09-30 00:00:25eric.araujosetversions: + 3rd party, - Python 2.6, Python 2.5, Python 3.1, Python 2.7, Python 3.2
2010-09-04 09:39:33eric.araujosetmessages: + msg115564
versions: + Python 2.6, Python 2.5
2010-09-04 08:32:52skrahsetnosy: + zooko, brian.curtin, sneves

versions: - Python 2.6, Python 2.5
2010-09-04 08:28:38skrahsetfiles: + vcasm2.patch

messages: + msg115563
2010-09-04 08:27:00skrahsetfiles: - vcasm2.patch
2010-09-04 08:15:34skrahsetfiles: + vcasm2.patch

messages: + msg115562
2010-09-04 08:14:48skrahsetfiles: - vcasm2.patch
2010-09-04 08:03:39skrahlinkissue8597 superseder
2010-09-04 00:32:54eric.araujosetnosy: + josip
2010-08-30 15:30:13skrahsetdependencies: + ValueError when trying to compile with VC Express
messages: + msg115225
2010-08-30 15:28:13skrahsetfiles: + vcasm2.patch

messages: + msg115224
2010-08-24 15:31:37eric.araujounlinkissue2942 dependencies
2010-08-24 15:31:09eric.araujolinkissue2942 dependencies
2010-08-24 00:22:49rpetrovsetmessages: + msg114762
2010-08-23 23:26:04eric.araujosetmessages: + msg114758
2010-08-23 23:19:24rpetrovsetnosy: + rpetrov
messages: + msg114757
2010-08-20 22:30:11eric.araujosetnosy: + eric.araujo

messages: + msg114462
versions: + Python 2.6, Python 2.5, Python 3.1
2010-05-02 17:06:45tareksetnosy: tarek, skrah
messages: + msg104793
components: + Distutils2, - Distutils
2009-12-19 16:46:47pitrousetnosy: + tarek
versions: + Python 2.7, - Python 3.1
priority: normal
assignee: tarek
components: + Distutils
stage: patch review
2009-12-19 16:44:04skrahcreate