|
Something I'm a little confused by about this issue: It seems like it's fixing assumptions made for gcc that don't hold for the xlc compiler. But is that a question of xlc for AIX, or xlc in general? |
|
I have no access to XLC for Linux. However, as a gut-feeling - IBM SW developers tend to be very consistent, for better or worse, when it comes to cross-platform UI issues. "Support" really dislikes options that work differently on different platforms. And, please note: there is only one "difference". The flag -E - to create .i files does not take a -o flag. The change to " elif not cmd or cmd is None:" in init.py is fixes several tests. Perhaps it will help review to have this broken into two PR that can be reviewed separately. If so, I would prefer to attach them both to this issue number. |
|
More detail: This PR corrects 7 "errors", six are corrected by the change in init.py. The more bulky change fixes the original issue re: search_cpp - which uses the combined gcc flags of -E and -o. XLC fails because it does not support the combination. Your consideration is appreciated! Details: 6 + 1 errors: |
I suspect you are right, but it would be good to check. I do not have it either, but apparently IBM supplies a free trial version for Linux, so I might give that a try. The reason I ask is that while it's true AIX is far and away the most likely place to encounter that compiler, the Of course there are cases where checking the platform to determine what flags to use does make sense, especially when it comes to linking. But for something like "xlc does not support |
|
I can see about getting that trial version of XL C/C++ for Linux if it helps. |
Maybe I can use that instead, rather than the additional method - exernalized (self.compiler that only calls self._compiler()) to get the compiler name. This took forever to figure out. The generic bottom-line is: it is known to work if self._isgcc is true, and unknown if it is not (versus known to not work if AIX and not self._isgcc). Maybe it is more maintainable to respond as some tests do with "skip" when ((not "known to work") is True) And, actually, just the documentation of xlc for Linux should answer the question. I'll look for the comment in AIX documentation (I hope it is there), and see if I can find the same in the Linux XLC documentation. |
So, from the documentation: AIX documentation - xlc compiler reference (v12) (PDF)
For Linux on Power version: https://www.ibm.com/support/knowledgecenter/SSXVZZ_16.1.0/com.ibm.xlcpp161.lelinux.doc/compiler_ref/opt_e_upper.html Usage Source files with unrecognized file name suffixes are treated and preprocessed as C files. Unless -C is specified, comments are replaced in the preprocessed output by a single space character. New lines and #line directives are issued for comments that span multiple source lines. The -E option overrides the -P and -fsyntax-only (-qsyntaxonly) options. The combination of -E -o stores the preprocessed result in the file specified by -o. Answer seems to be same behavior for both versions. |
|
On 03/10/2018 22:33, Andrew Svetlov wrote:
asvetlov commented on this pull request.
> @@ -2725,7 +2725,7 @@ def missing_compiler_executable(cmd_names=[]):
if cmd_names:
assert cmd is not None, \
"the '%s' executable is not configured" % name
- elif cmd is None:
+ elif not cmd or cmd is None:
Thanks Andrew.
This got me digging deeper - and I moved this out of issue11191 (was not
comfortable changing the title of an issue going back so many years.
Your comments on issue34897 - where I have it now - would be greatly
appreciated.
Thank you for the time already invested.
…
`not cmd` shadows `cmd is None` test
|
|
On 03/10/2018 12:18, E. M. Bray wrote:
Something I'm a little confused by about this issue: It seems like it's fixing assumptions made for gcc that don't hold for the xlc compiler. But is that a question of xlc for AIX, or xlc in general?
Dear E, (Sorry I missed your full first name)!
Excellent comment - and adding a bit to this thread - repeating what I
said in the PR conversation.
It is not just AIX and XLC, it is, as far as I understand from the
compier_ref documentation the same for all.
I took your idea of _is_xlc and re-worked the PR. I am looking forward
to your comments - should you have any!
|
|
I've updated the NEWS entry in the Test section to reflect just the bpo-11191 fix. However, there is an additional change still in this PR that affects the actual distutils library behaviour:
I'm not clear how that relates to either the original issue in bpo-11191, or the issue that was split out as bpo-34897 (and is now covered by PR #9706) |
|
Originally I had all the "things" I found while researching bpo-11191 in a single PR. Over time I felt it may be more understandable - and I hoped easier to get accepted - a PR that focused, as much as possible - on the original "ancient" issue - and moved the "newly discovered" but not yet in an issue - to a new issue and PR. During my initial analysis of bpo-11191 I noticed that the comments were not being included, at all - so even before I had learned that the output could not be re-directed to a file I had to correct that comments would even be included in any output. My opinion is that is was also a an element of the cause, just not the complete solution. Hope this helps. If you prefer a new issue - I'll be happy to provide both a new issue and PR. And thanks for updating the NEWS content! |
|
Argh - had not noticed you had already removed the check_compiler function - and in tying to remove the file Lib/distutils/command/config.py from the PR reverted the changes you had added. So, back now to the "line deletion" on line 333. Sigh - and Happy New Year. p.s. did remove the change that added the -C argument needed for when the test does become possible with a later (version 15 or 16?) of the xlc compiler. |
the many year old issue was: test_search_cpp error on AIX (with xlc)
This patch fixes all (6) current test_distutils errors, when using xlc (aka not using gcc for AIX)
https://bugs.python.org/issue11191