-
Notifications
You must be signed in to change notification settings - Fork 67
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
Make compiler.include_dirs expose all paths correct again for MSVC #172
Conversation
including the SDK dirs after compiler.initialize() . Changes in 9f9a3e5 / c84d3e5 broke compatibility (pywin32), used shadowed class variables in an odd manner, and conceiled the MSVC & SDK dirs from public access (as required by some projects for alternative compile tasks) compiler.set_include_dirs() should be able to replace everything - there is also add_include_dir() . Option --include-dirs on build_ext inserts early at/near compiler construction time before compiler.initialze()
when no output_dir is given. Motive: distutils/tests/test_ccompiler.py (1afdbe3) left garbage files in a strange relative subdir of the cwd/source root like <cwd>\Users\<user>\AppData\Local\Temp\pytest-of-user on Windows.
Sorry, but I can't accept this change. It essentially undoes the changes that I intentionally made in #153, including breaking the regression test that captures the expectation we're trying to retain. The reason that test was added was because if Please file a bug report describing what the issue is and what you expected to happen differently and we can discuss ways to address it. |
Not really: It accomplishes the (original) goal of that PR fully ( Just set_include_dirs() can again replace everything as the name "set" indicates (unlike add_include_dir()) .
I think usually that is the meaning of "set". Or which actual problems does #153 solve so far, which this PR here doesn't solve? When this "API" break & limitation would remain as is (without this or another solution), then something like this kind of strange workaround would need to stay in pywin32: I have already tested the complex pywin32 build (inserting includes in various ways) with this PR - also with --include-dirs. The altered and extended tests check that SDK includes are not erased by |
Perhaps, except it's explicitly documented that set shouldn't affect compiler defaults. |
I'm trying to work toward a more layered approach, with better abstractions around state, so that there's not a lot of entangled concerns. Right now, the compiler is very complicated by the _fix methods and initialize and the fact that |
I think this 23 years old doc just refers, as a rather trivial hint, to the standard directories which are potentially built internally into a compiler binary and not manageable by distutils due to low level reasons. E.g. into gcc specifically for a certain distribution (
The SDK dirs on Windows are not bound or somehow internal to the compiler (several SDK kits are usually installed - 4 here currently), they are kind of extra libraries just often needed on Windows and provided as defaults. The compatibility issue here would less be about what |
On one hand, I do prefer the behaviour of this patch over what's currently in there for MSVC (I didn't notice just how much Jason(?) rewrote my original PR - I was using private instance attributes, not class variables... can see that breaking under certain [mis]uses...). Though calling On the other hand, it would break the behaviour for gcc, where It's a shame that distutils was never designed properly in the first place. I'm sure the intent was for the command line interface to be the only "public" API, and it would have saved a lot of angst if everyone who was monkey patching it knew that they'd be responsible to fix their issues later on. Alas, we do things carefully instead. However, I'd argue that |
Fixup etc. for changes in 9f9a3e5 / c84d3e5 which crashed the pywin32 CI builds recently - setuptools is currently frozen there <=63.2.0 until clarified.
The problem happened at
https://github.com/mhammond/pywin32/blob/fc69a1ecc150a13433a7a71d61bac52a5f3df42b/setup.py#L695
/ mhammond/pywin32@fc69a1e) ( @zooba )
Besides the unnecessary compatibility break the MSVC paths should probably not be hidden generally I think.
(Otherwise pywin32 would need to dig into distutils internals
compiler.__class__.include_dirs
in a strange manner, a class variable which is only available after instance.initialize() ...)