This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Set up nasm from external.bat
Type: enhancement Stage: resolved
Components: Build, Windows Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zach.ware Nosy List: BreamoreBoy, jpe, pitrou, python-dev, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2013-04-13 16:34 by jpe, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue17717-default.diff zach.ware, 2014-10-31 17:36 review
Messages (12)
msg186752 - (view) Author: John Ehresman (jpe) * Date: 2013-04-13 16:34
It would be nice for Tools\buildbot\external.bat to set a copy of nasm up to use.  Is there a reason this is not done?
msg187490 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-04-21 04:08
Could you elaborate on what you mean to be done? All I've ever had to do was run the nasm installer and add the install location to PATH.
msg187543 - (view) Author: John Ehresman (jpe) * Date: 2013-04-22 02:31
What I'd like is for external to set up all the dependencies needed to build python and run the test suite.  Yes, nasm can be downloaded and set up separately, but that's true of all of the libraries that external.bat downloads.
msg187571 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-04-22 16:44
I agree it would be nice, but I'm not sure how easy or practical it would be to implement, particularly making sure that NASM is on the PATH.  And besides, at some point, we have to draw the line between what we can reasonably do for a user and what we can reasonably expect a user to do for themselves.  That line falls at minimum after installation of Visual C++ 2010, which would be nearly impossible to properly install from a batch script, and is currently also after installation of NASM and Perl, which are both optional anyway--you can build Python without NASM, you'll just have build errors and won't have SSL support.  I think that's a reasonable place to keep the line: short of trying to install external programs for the user.

I think it would be good to have a nice error/warning message in build.bat if NASM (or MSVC++, for that matter) can't be found, possibly with a URL pointing to where to look for an installer.  Something along the lines of:

where nasm >nul 2>&1

if %ERRORLEVEL% == 1 (
    echo NASM not found on PATH.  It can be downloaded from
    set /P _continue=Continue without NASM? (y/n)
    if %_continue% == n exit /B 1 else echo Continuing...

Does that come anywhere close to scratching your itch?
msg222922 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-13 12:42
I think a message as suggested in msg187571 would be more than adequate.
msg230090 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2014-10-27 19:04
Practically this is very easy to do, and I'm more than willing to author detection into the new PCbuild files.

Having nasm mirrored on (or anywhere on a PSF host) would be real nice though. I don't particularly like making the build system rely on potentially unreliable external sites. Not sure what the legal ramifications here are though...
msg230251 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-29 22:17
NASM seems BSD-licensed, so it shouldn't be a legal problem.
msg230353 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-10-31 16:57
Ok, I've imported nasm-2.11.06 to:

I'll work on a patch for default and see what (if anything) will need to change in the openssl checkout.
msg230359 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-10-31 17:36
Fairly simple patch for default.
msg230360 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-31 17:39
I can't say anything about the patch, but thank you for automating this! One less manual step :-)
msg230471 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-01 23:43
New changeset 28d18fdc52c4 by Zachary Ware in branch '2.7':
Issue #17717: Pull NASM from for OpenSSL build.

New changeset f7ed3e058fca by Zachary Ware in branch '3.4':
Issue #17717: Pull NASM from for OpenSSL build.

New changeset ef15b51d59fb by Zachary Ware in branch 'default':
Issue #17717: Pull NASM from for OpenSSL build.
msg230473 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-11-01 23:57
The patches for 2.7 and 3.4 were more trivial than for default, and I was pretty confident in the patch for default, so I went ahead and committed.  I did switch around which end of PATH our copy of NASM was added to, to make it easier for someone to override which NASM was used.

Thanks for the suggestion John, and thanks for the support Antoine!
Date User Action Args
2022-04-11 14:57:44adminsetgithub: 61917
2014-11-01 23:58:27zach.waresetnosy: + tim.golden

components: + Build
stage: resolved
2014-11-01 23:57:31zach.waresetstatus: open -> closed
versions: + Python 2.7, Python 3.4
messages: + msg230473

assignee: zach.ware
resolution: fixed
2014-11-01 23:43:53python-devsetnosy: + python-dev
messages: + msg230471
2014-10-31 17:39:20pitrousetmessages: + msg230360
2014-10-31 17:36:08zach.waresetfiles: + issue17717-default.diff
keywords: + patch
messages: + msg230359
2014-10-31 16:57:41zach.waresetmessages: + msg230353
2014-10-29 22:17:26pitrousetnosy: + pitrou
messages: + msg230251
2014-10-27 19:04:55steve.dowersetnosy: + steve.dower
messages: + msg230090
2014-07-13 12:42:30BreamoreBoysetnosy: + BreamoreBoy

messages: + msg222922
versions: + Python 3.5, - Python 3.4
2013-04-22 19:10:29terry.reedysetnosy: - terry.reedy
2013-04-22 16:44:58zach.waresetmessages: + msg187571
2013-04-22 02:31:17jpesetmessages: + msg187543
2013-04-21 04:08:43zach.waresetmessages: + msg187490
2013-04-21 02:07:40ezio.melottisetnosy: + terry.reedy, zach.ware
2013-04-13 16:34:32jpecreate