-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
bpo-30912: Don't check ffi.h for specific contents #2687
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2003,16 +2003,9 @@ def detect_ctypes(self, inc_dirs, lib_dirs): | |
| ffi_inc = find_file('ffi.h', [], inc_dirs) | ||
| if ffi_inc is not None: | ||
| ffi_h = ffi_inc[0] + '/ffi.h' | ||
| with open(ffi_h) as f: | ||
| for line in f: | ||
| line = line.strip() | ||
| if line.startswith(('#define LIBFFI_H', | ||
| '#define ffi_wrapper_h')): | ||
| break | ||
| else: | ||
| ffi_inc = None | ||
| print('Header file {} does not define LIBFFI_H or ' | ||
| 'ffi_wrapper_h'.format(ffi_h)) | ||
| if not os.path.exists(ffi_h): | ||
| ffi_inc = None | ||
| print('Header file {} does not exist'.format(ffi_h)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. But we need a proper commit message describing this change. The previous patch commit message is not relevant any more, and this patch commit message is not useful. People looking at python git history should not have to search github pull requests comments. I think the proper way to do this would be to fixup this change into the previous patch, and upgrade the commit message to describe the actual change. |
||
| ffi_lib = None | ||
| if ffi_inc is not None: | ||
| for lib_name in ('ffi', 'ffi_pic'): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't checked the implementation of
find_file, but it looks like it probably takes care of theos.path.existscheck and I'm not sure that the printed message is worth a whole lot in the grand spam of things. Could you check on that and probably just remove this whole branch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zware: the problem is that find_file does not always get called and moreover that message may be useful to pinpoint a build problem,