Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: MSVCCompiler grows 'lib' & 'include' env strings exponentially. #7963

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

charris
Copy link
Member

@charris charris commented Aug 23, 2016

Each time an MSVCCompiler was instantiated the old values of

os.environ['lib'] and os.environ['include'] were concatenated to the new
values set by initializing the distutils.msvc{,9}compiler.MSVCCompiler
base class. Consequently when the the old and new values of those
variables were the same, they doubled in size with each instantiation,
leading to quickly hitting the 32,768 character limit.

This is an alternative fix for #7926. It is somewhat more involved, but imho more obviously correct than the alternatives.

@mingwandroid
Copy link
Contributor

Hi @charris, by going through a set here, aren't you reordering the values?

@charris
Copy link
Member Author

charris commented Aug 23, 2016

@mingwandroid Oh, darn. Yes, I bet so.

@charris
Copy link
Member Author

charris commented Aug 23, 2016

I forgot that order mattered. I wonder how that applies to the order in which they were concatenated originally?

@charris
Copy link
Member Author

charris commented Aug 23, 2016

The base class looks for the environments in the order

    HKEYS = (hkey_mod.HKEY_USERS,
             hkey_mod.HKEY_CURRENT_USER,
             hkey_mod.HKEY_LOCAL_MACHINE,
             hkey_mod.HKEY_CLASSES_ROOT)

And uses the first that exists. If that was always HKEY_CURRENT_USER we could probably dispense with the merge.

@charris
Copy link
Member Author

charris commented Aug 23, 2016

Updated.

Each time an MSVCCompiler was instantiated the old values of
os.environ['lib'] and os.environ['include'] were concatenated to the new
values set by initializing the distutils.msvc{,9}compiler.MSVCCompiler
base class.  Consequently when the  the old and new values of those
variables were the same, they doubled in size with each instantiation,
leading to quickly hitting the 32,768 character limit.
@charris charris merged commit 90668d0 into numpy:master Aug 25, 2016
@charris charris deleted the fix-microsoft-compilers branch August 25, 2016 15:46
@charris charris removed this from the 1.11.2 release milestone Aug 25, 2016
@mingwandroid
Copy link
Contributor

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants