Building the python core freezes on 'Generating code' For a very long time.

seandhunt_7's Avatar


14 Dec, 2017 06:12 PM

On previous builds of my project the Generating code step on pythoncore.vcxproj that makes python36.dll used to take only a few seconds. Now it takes almost 15~25 minutes (and sometimes even longer than 25 minutes) on just that. What is going on this is insane. Also for some reason on my branch build of an branch on the official repository that also has an pull request so they have 2 builds on the branch. They both end up failing on secure-file with exit code 1. See for details (this is the branch one linked) the 110 one should be the PR one to master.

Locally it takes me less than 4 minutes to build cpython 3.6 branch and master branch on my Inspiron 1545 with the P8800 (Core 2 Duo) with 4 GB of Memory total and VS2017 Enterprise installed. And that is with the rebuild all option. If I dont use rebuild all and do build to where it updates to object files for the source files that changes that will take even less time.

I wonder if the AppVeyor servers or w/e is delaying somewhat currently.

  1. Support Staff 1 Posted by Feodor Fitsner on 14 Dec, 2017 06:30 PM

    Feodor Fitsner's Avatar

    Secure-file tools is failing on PRs because secure variable ‘SECRET_KEY’ is not set for PR builds (you can allow secure variables for either private repo or PRs from the same repo - secure vars in PRs from forks are not allowed)

  2. 2 Posted by seandhunt_7 on 14 Dec, 2017 06:46 PM

    seandhunt_7's Avatar

    I just now changed the setting to enable that on PR's to the same Repo. Thanks for pointing that out.

    However the very long Generating Code part seems to still be a problem though.

    Also how can I make it where both builds from the Pull Requuests actually start at the same time. Every time I try to make it like this it seems to not work that way.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 14 Dec, 2017 08:02 PM

    Ilya Finkelshteyn's Avatar

    Use Enable secure variables in Pull Requests from the same repository only checkbox in General setting in UI.

  4. 4 Posted by seandhunt_7 on 14 Dec, 2017 09:15 PM

    seandhunt_7's Avatar

    I did that, however there is still the issue where the pythoncore.vcxproj project file in the cpython repository still takes minutes to recompile 1 or 3 of their C Source files that should only take seconds to do.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 14 Dec, 2017 09:20 PM

    Ilya Finkelshteyn's Avatar

    Can you send a like to the build where it took seconds?

  6. 6 Posted by seandhunt_7 on 14 Dec, 2017 09:29 PM

    seandhunt_7's Avatar

    Sure, here is one from a few days ago that took 4 minutes and 7 seconds for python and my project which builds on top of it. It also seems to be holding up now when calculating the checksum for updating the caches too.

  7. Support Staff 7 Posted by Feodor Fitsner on 15 Dec, 2017 12:41 AM

    Feodor Fitsner's Avatar

    OK, I did some tests on a fork of your repo.

    Here I'm running the build on GCE environment (where I/O is not affected by noisy neighbors) and current VS 2017 image:

    Well, it hangs on Generating code step.

    However, I was able to run the build without the issue on Previous Visual Studio 2017 image:

    The difference between images is VS 2017 15.5.1 on the current while there is 15.4 on previous:

    So, VS 2017 might be the issue. Indeed, I found this comment:

    Hopefully, they fixed optimization issues in 15.5.2 which was released earlier today: I'm going to have a look. If it works we'll update the image with 15.5.2.

  8. Support Staff 8 Posted by Feodor Fitsner on 17 Dec, 2017 02:16 AM

    Feodor Fitsner's Avatar

    We’ve updated VS 2017 image with the latest VS 2017 15.5.2 and the problem has gone. Test build results:

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac