Lines Matching +full:proc +full:- +full:macro +full:- +full:api
4 Pass --generate to recreate auto-generated files instead.
54 # to better serve that purpose (while keeping it human-readable).
57 """Collection of `ABIItem`s forming the stable ABI/limited API."""
64 # even if they're different kinds (e.g. function vs. macro).
71 kinds: set of requested kinds, e.g. {'function', 'macro'}
74 If False, include only items from the limited API
118 @itemclass('macro')
124 """Information on one item (function, macro, struct, etc.)"""
168 # Other actions, like "--unixy-check", don't work on a single file.
175 func.arg_name = '--' + var_name.replace('_', '-')
187 /* Re-export stable Python ABI */
231 'macro': 'macro',
266 """Generate/check the ctypes-based test for exported symbols"""
344 write('// Add an entry in dict `result` for each Stable ABI feature macro.')
346 for macro in manifest.select({'feature_macro'}):
347 name = macro.name
398 item.name for item in manifest.select({'macro'})
400 missing_macros = expected_macros - present_macros
430 missing_defs = expected_defs - found_defs
436 # Some Limited API macros are defined in terms of private symbols.
437 # These are not part of Limited API (even though they're defined with
440 extra_defs = found_defs - expected_defs - private_symbols
454 print(' -', item, file=sys.stderr)
462 args = ["nm", "--no-sort"]
464 args.append("--dynamic")
466 proc = subprocess.run(args, stdout=subprocess.PIPE, universal_newlines=True)
467 if proc.returncode:
468 sys.stdout.write(proc.stdout)
469 sys.exit(proc.returncode)
471 stdout = proc.stdout.rstrip()
484 symbol = parts[-1]
494 missing_symbols = expected_symbols - available_symbols
497 Some symbols from the limited API are missing from {library}:
503 a prototype belonging to a symbol in the limited API has been
511 """Get all limited API macros from headers.
514 "-DPy_LIMITED_API" to the correct value for the running version of the
515 interpreter and extracting all macro definitions (via adding -dM to the
518 Requires Python built with a GCC-compatible compiler. (clang might work)
528 "-DSIZEOF_WCHAR_T=4", # The actual value is not important
529 f"-DPy_LIMITED_API={api_hexversion}",
530 "-I.",
531 "-I./Include",
532 "-dM",
533 "-E",
548 """Get all limited API definitions from headers.
551 "-DPy_LIMITED_API" to the correct value for the running version of the
554 The limited API symbols will be extracted from the output of this command
556 that are in the limited api.
558 This function does *NOT* extract the macros defined on the limited API
560 Requires Python built with a GCC-compatible compiler. (clang might work)
568 "-DPyAPI_FUNC=__PyAPI_FUNC",
569 "-DPyAPI_DATA=__PyAPI_DATA",
570 "-DEXPORT_DATA=__EXPORT_DATA",
571 "-D_Py_NO_RETURN=",
572 "-DSIZEOF_WCHAR_T=4", # The actual value is not important
573 f"-DPy_LIMITED_API={api_hexversion}",
574 "-I.",
575 "-I./Include",
576 "-E",
594 """Ensure limited API doesn't contain private names
601 f'`{name}` is private (underscore-prefixed) and should be '
636 "--generate", action='store_true',
640 "--generate-all", action='store_true',
641 help="as --generate, but generate all file(s) using default filenames."
642 + " (unlike --all, does not run any extra checks)",
645 "-a", "--all", action='store_true',
649 "-l", "--list", action='store_true',
653 "--dump", action='store_true',
666 '--unixy-check', action='store_true',
725 parser.error('No file specified. Use --help for usage.')
726 parser.error('No check specified. Use --help for usage.')
737 Run `make regen-limited-abi` to fix this.
744 You can read more about the limited API and its contracts at:
746 https://docs.python.org/3/c-api/stable.html
750 https://peps.python.org/pep-0384/