From 530ea4cb0db7b944003c69e82f7aaff0a5961f7f Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 1 Nov 2022 10:26:09 +0800 Subject: [PATCH 1/2] Collect pyston 2.3.5 Python 3.8 sysconfig file --- sysconfig/pyston-3.8.txt | 719 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 719 insertions(+) create mode 100644 sysconfig/pyston-3.8.txt diff --git a/sysconfig/pyston-3.8.txt b/sysconfig/pyston-3.8.txt new file mode 100644 index 000000000..899ffb83c --- /dev/null +++ b/sysconfig/pyston-3.8.txt @@ -0,0 +1,719 @@ +Platform: "linux-x86_64" +Python version: "3.8" +Current installation scheme: "posix_prefix" + +Paths: + data = "/root/pyston_2.3.5" + include = "/root/pyston_2.3.5/include/python3.8-pyston2.3" + platinclude = "/root/pyston_2.3.5/include/python3.8-pyston2.3" + platlib = "/root/pyston_2.3.5/lib/python3.8-pyston2.3/site-packages" + platstdlib = "/root/pyston_2.3.5/lib/python3.8-pyston2.3" + purelib = "/root/pyston_2.3.5/lib/python3.8-pyston2.3/site-packages" + scripts = "/root/pyston_2.3.5/bin" + stdlib = "/root/pyston_2.3.5/lib/python3.8-pyston2.3" + +Variables: + ABIFLAGS = "" + AC_APPLE_UNIVERSAL_BUILD = "0" + AIX_GENUINE_CPLUSPLUS = "0" + ALT_SOABI = "0" + ANDROID_API_LEVEL = "0" + AOT_DIR = "../aot_pic" + AR = "ar" + ARFLAGS = "rcs" + BASECFLAGS = "-Wno-unused-result -Wsign-compare" + BASECPPFLAGS = "-IObjects -IInclude -IPython" + BASEMODLIBS = "" + BINDIR = "/usr/bin" + BINLIBDEST = "/usr/lib/python3.8-pyston2.3" + BLDLIBRARY = "-L. -lpython3.8-pyston2.3" + BLDSHARED = "gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro" + BUILDEXE = "" + BUILDPYTHON = "pyston" + BUILD_GNU_TYPE = "x86_64-pc-linux-gnu" + BYTESTR_DEPS = "\" + CC = "gcc -pthread" + CCSHARED = "-fPIC" + CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security" + CFLAGSFORSHARED = "-fPIC" + CFLAGS_ALIASING = "" + CFLAGS_NODIST = "" + CLANG_RT_PROFILE = "$(shell /src/build/build/Release/llvm/bin/clang --print-resource-dir)/lib/linux/libclang_rt.profile-$(shell uname -m).a" + CONFIGFILES = "configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in" + CONFIGURE_CFLAGS = "-g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT" + CONFIGURE_CFLAGS_NODIST = "-fstack-protector -specs=/src/build/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2 -fno-reorder-blocks-and-partition -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration" + CONFIGURE_CPPFLAGS = "-Wdate-time -D_FORTIFY_SOURCE=2" + CONFIGURE_LDFLAGS = "-Wl,-Bsymbolic-functions -Wl,-z,relro" + CONFIGURE_LDFLAGS_NODIST = "-specs=/src/build/pyston/tools/no-pie-link.specs -Wl,-z,relro -Wl,--emit-relocs -fno-semantic-interposition -fsemantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" + CONFIG_ARGS = "'--prefix=/usr' '--enable-optimizations' '--with-lto' '--disable-debugging-features' '--enable-shared' '--enable-configure' 'CFLAGS=-g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'PROFILE_TASK=../../Lib/test/regrtest.py -j 0 -unone,decimal -x test_posix test_asyncio test_cmd_line_script test_compiler test_concurrent_futures test_ctypes test_dbm_dumb test_dbm_ndbm test_distutils test_ensurepip test_ftplib test_gdb test_httplib test_imaplib test_ioctl test_linuxaudiodev test_multiprocessing test_nntplib test_ossaudiodev test_poplib test_pydoc test_signal test_socket test_socketserver test_ssl test_subprocess test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_threading_local test_threadsignals test_venv test_zipimport_support || true'" + CONFINCLUDEDIR = "/usr/include" + CONFINCLUDEPY = "/usr/include/python3.8-pyston2.3" + COREPYTHONPATH = "" + COVERAGE_INFO = "/src/build/build/releaseshared_build/coverage.info" + COVERAGE_REPORT = "/src/build/build/releaseshared_build/lcov-report" + COVERAGE_REPORT_OPTIONS = "--no-branch-coverage --title "CPython lcov report"" + CPPFLAGS = "-IObjects -IInclude -IPython -I. -I../../Include -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2" + CXX = "g++ -pthread" + DESTDIRS = "/usr /usr/lib /usr/lib/python3.8-pyston2.3 /usr/lib/python3.8-pyston2.3/lib-dynload" + DESTLIB = "/usr/lib/python3.8-pyston2.3" + DESTPATH = "" + DESTSHARED = "/usr/lib/python3.8-pyston2.3/lib-dynload" + DFLAGS = "" + DIRMODE = "755" + DIST = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummy" + DISTDIRS = "Include Lib Misc Ext-dummy" + DISTFILES = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in" + DLINCLDIR = "." + DLLLIBRARY = "" + DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 = "0" + DOUBLE_IS_BIG_ENDIAN_IEEE754 = "0" + DOUBLE_IS_LITTLE_ENDIAN_IEEE754 = "1" + DTRACE = "" + DTRACE_DEPS = "\" + DTRACE_HEADERS = "" + DTRACE_OBJS = "" + DYNLOADFILE = "dynload_shlib.o" + ENABLE_IPV6 = "1" + ENSUREPIP = "upgrade" + EXE = "" + EXEMODE = "755" + EXTRATESTOPTS = "" + EXTRA_CFLAGS = "" + EXT_SUFFIX = ".pyston-23-x86_64-linux-gnu.so" + FILEMODE = "644" + FLOAT_WORDS_BIGENDIAN = "0" + FLOCK_NEEDS_LIBBSD = "0" + GETPGRP_HAVE_ARG = "0" + GETTIMEOFDAY_NO_TZ = "0" + GITBRANCH = "git --git-dir ../../.git name-rev --name-only HEAD" + GITTAG = "git --git-dir ../../.git describe --all --always" + GITVERSION = "git --git-dir ../../.git rev-parse --short HEAD" + GNULD = "yes" + HAVE_ACCEPT4 = "1" + HAVE_ACOSH = "1" + HAVE_ADDRINFO = "1" + HAVE_ALARM = "1" + HAVE_ALIGNED_REQUIRED = "0" + HAVE_ALLOCA_H = "1" + HAVE_ALTZONE = "0" + HAVE_ASINH = "1" + HAVE_ASM_TYPES_H = "1" + HAVE_ATANH = "1" + HAVE_BIND_TEXTDOMAIN_CODESET = "1" + HAVE_BLUETOOTH_BLUETOOTH_H = "1" + HAVE_BLUETOOTH_H = "0" + HAVE_BROKEN_MBSTOWCS = "0" + HAVE_BROKEN_NICE = "0" + HAVE_BROKEN_PIPE_BUF = "0" + HAVE_BROKEN_POLL = "0" + HAVE_BROKEN_POSIX_SEMAPHORES = "0" + HAVE_BROKEN_PTHREAD_SIGMASK = "0" + HAVE_BROKEN_SEM_GETVALUE = "0" + HAVE_BROKEN_UNSETENV = "0" + HAVE_BUILTIN_ATOMIC = "1" + HAVE_CHFLAGS = "0" + HAVE_CHOWN = "1" + HAVE_CHROOT = "1" + HAVE_CLOCK = "1" + HAVE_CLOCK_GETRES = "1" + HAVE_CLOCK_GETTIME = "1" + HAVE_CLOCK_SETTIME = "1" + HAVE_COMPUTED_GOTOS = "1" + HAVE_CONFSTR = "1" + HAVE_CONIO_H = "0" + HAVE_COPYSIGN = "1" + HAVE_COPY_FILE_RANGE = "1" + HAVE_CRYPT_H = "1" + HAVE_CRYPT_R = "1" + HAVE_CTERMID = "1" + HAVE_CTERMID_R = "0" + HAVE_CURSES_FILTER = "1" + HAVE_CURSES_H = "1" + HAVE_CURSES_HAS_KEY = "1" + HAVE_CURSES_IMMEDOK = "1" + HAVE_CURSES_IS_PAD = "1" + HAVE_CURSES_IS_TERM_RESIZED = "1" + HAVE_CURSES_RESIZETERM = "1" + HAVE_CURSES_RESIZE_TERM = "1" + HAVE_CURSES_SYNCOK = "1" + HAVE_CURSES_TYPEAHEAD = "1" + HAVE_CURSES_USE_ENV = "1" + HAVE_CURSES_WCHGAT = "1" + HAVE_DECL_ISFINITE = "1" + HAVE_DECL_ISINF = "1" + HAVE_DECL_ISNAN = "1" + HAVE_DECL_RTLD_DEEPBIND = "1" + HAVE_DECL_RTLD_GLOBAL = "1" + HAVE_DECL_RTLD_LAZY = "1" + HAVE_DECL_RTLD_LOCAL = "1" + HAVE_DECL_RTLD_MEMBER = "0" + HAVE_DECL_RTLD_NODELETE = "1" + HAVE_DECL_RTLD_NOLOAD = "1" + HAVE_DECL_RTLD_NOW = "1" + HAVE_DECL_TZNAME = "0" + HAVE_DEVICE_MACROS = "1" + HAVE_DEV_PTC = "0" + HAVE_DEV_PTMX = "1" + HAVE_DIRECT_H = "0" + HAVE_DIRENT_D_TYPE = "1" + HAVE_DIRENT_H = "1" + HAVE_DIRFD = "1" + HAVE_DLFCN_H = "1" + HAVE_DLOPEN = "1" + HAVE_DUP2 = "1" + HAVE_DUP3 = "1" + HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH = "0" + HAVE_DYNAMIC_LOADING = "1" + HAVE_ENDIAN_H = "1" + HAVE_EPOLL = "1" + HAVE_EPOLL_CREATE1 = "1" + HAVE_ERF = "1" + HAVE_ERFC = "1" + HAVE_ERRNO_H = "1" + HAVE_EXECV = "1" + HAVE_EXPLICIT_BZERO = "1" + HAVE_EXPLICIT_MEMSET = "0" + HAVE_EXPM1 = "1" + HAVE_FACCESSAT = "1" + HAVE_FCHDIR = "1" + HAVE_FCHMOD = "1" + HAVE_FCHMODAT = "1" + HAVE_FCHOWN = "1" + HAVE_FCHOWNAT = "1" + HAVE_FCNTL_H = "1" + HAVE_FDATASYNC = "1" + HAVE_FDOPENDIR = "1" + HAVE_FDWALK = "0" + HAVE_FEXECVE = "1" + HAVE_FINITE = "1" + HAVE_FLOCK = "1" + HAVE_FORK = "1" + HAVE_FORKPTY = "1" + HAVE_FPATHCONF = "1" + HAVE_FSEEK64 = "0" + HAVE_FSEEKO = "1" + HAVE_FSTATAT = "1" + HAVE_FSTATVFS = "1" + HAVE_FSYNC = "1" + HAVE_FTELL64 = "0" + HAVE_FTELLO = "1" + HAVE_FTIME = "1" + HAVE_FTRUNCATE = "1" + HAVE_FUTIMENS = "1" + HAVE_FUTIMES = "1" + HAVE_FUTIMESAT = "1" + HAVE_GAI_STRERROR = "1" + HAVE_GAMMA = "1" + HAVE_GCC_ASM_FOR_MC68881 = "0" + HAVE_GCC_ASM_FOR_X64 = "1" + HAVE_GCC_ASM_FOR_X87 = "1" + HAVE_GCC_UINT128_T = "1" + HAVE_GETADDRINFO = "1" + HAVE_GETC_UNLOCKED = "1" + HAVE_GETENTROPY = "1" + HAVE_GETGRGID_R = "1" + HAVE_GETGRNAM_R = "1" + HAVE_GETGROUPLIST = "1" + HAVE_GETGROUPS = "1" + HAVE_GETHOSTBYNAME = "0" + HAVE_GETHOSTBYNAME_R = "1" + HAVE_GETHOSTBYNAME_R_3_ARG = "0" + HAVE_GETHOSTBYNAME_R_5_ARG = "0" + HAVE_GETHOSTBYNAME_R_6_ARG = "1" + HAVE_GETITIMER = "1" + HAVE_GETLOADAVG = "1" + HAVE_GETLOGIN = "1" + HAVE_GETNAMEINFO = "1" + HAVE_GETPAGESIZE = "1" + HAVE_GETPEERNAME = "1" + HAVE_GETPGID = "1" + HAVE_GETPGRP = "1" + HAVE_GETPID = "1" + HAVE_GETPRIORITY = "1" + HAVE_GETPWENT = "1" + HAVE_GETPWNAM_R = "1" + HAVE_GETPWUID_R = "1" + HAVE_GETRANDOM = "1" + HAVE_GETRANDOM_SYSCALL = "1" + HAVE_GETRESGID = "1" + HAVE_GETRESUID = "1" + HAVE_GETSID = "1" + HAVE_GETSPENT = "1" + HAVE_GETSPNAM = "1" + HAVE_GETTIMEOFDAY = "1" + HAVE_GETWD = "1" + HAVE_GLIBC_MEMMOVE_BUG = "0" + HAVE_GRP_H = "1" + HAVE_HSTRERROR = "1" + HAVE_HTOLE64 = "1" + HAVE_HYPOT = "1" + HAVE_IEEEFP_H = "0" + HAVE_IF_NAMEINDEX = "1" + HAVE_INET_ATON = "1" + HAVE_INET_PTON = "1" + HAVE_INITGROUPS = "1" + HAVE_INTTYPES_H = "1" + HAVE_IO_H = "0" + HAVE_IPA_PURE_CONST_BUG = "0" + HAVE_KILL = "1" + HAVE_KILLPG = "1" + HAVE_KQUEUE = "0" + HAVE_LANGINFO_H = "1" + HAVE_LARGEFILE_SUPPORT = "0" + HAVE_LCHFLAGS = "0" + HAVE_LCHMOD = "0" + HAVE_LCHOWN = "1" + HAVE_LGAMMA = "1" + HAVE_LIBDL = "1" + HAVE_LIBDLD = "0" + HAVE_LIBIEEE = "0" + HAVE_LIBINTL_H = "1" + HAVE_LIBREADLINE = "1" + HAVE_LIBRESOLV = "0" + HAVE_LIBSENDFILE = "0" + HAVE_LIBUTIL_H = "0" + HAVE_LINK = "1" + HAVE_LINKAT = "1" + HAVE_LINUX_CAN_BCM_H = "1" + HAVE_LINUX_CAN_H = "1" + HAVE_LINUX_CAN_RAW_FD_FRAMES = "1" + HAVE_LINUX_CAN_RAW_H = "1" + HAVE_LINUX_MEMFD_H = "1" + HAVE_LINUX_NETLINK_H = "1" + HAVE_LINUX_QRTR_H = "1" + HAVE_LINUX_RANDOM_H = "1" + HAVE_LINUX_TIPC_H = "1" + HAVE_LINUX_VM_SOCKETS_H = "1" + HAVE_LOCKF = "1" + HAVE_LOG1P = "1" + HAVE_LOG2 = "1" + HAVE_LONG_DOUBLE = "1" + HAVE_LSTAT = "1" + HAVE_LUTIMES = "1" + HAVE_MADVISE = "1" + HAVE_MAKEDEV = "1" + HAVE_MBRTOWC = "1" + HAVE_MEMFD_CREATE = "1" + HAVE_MEMORY_H = "1" + HAVE_MEMRCHR = "1" + HAVE_MKDIRAT = "1" + HAVE_MKFIFO = "1" + HAVE_MKFIFOAT = "1" + HAVE_MKNOD = "1" + HAVE_MKNODAT = "1" + HAVE_MKTIME = "1" + HAVE_MMAP = "1" + HAVE_MREMAP = "1" + HAVE_NCURSES_H = "1" + HAVE_NDIR_H = "0" + HAVE_NETPACKET_PACKET_H = "1" + HAVE_NET_IF_H = "1" + HAVE_NICE = "1" + HAVE_OPENAT = "1" + HAVE_OPENPTY = "1" + HAVE_PATHCONF = "1" + HAVE_PAUSE = "1" + HAVE_PIPE2 = "1" + HAVE_PLOCK = "0" + HAVE_POLL = "1" + HAVE_POLL_H = "1" + HAVE_POSIX_FADVISE = "1" + HAVE_POSIX_FALLOCATE = "1" + HAVE_POSIX_SPAWN = "1" + HAVE_POSIX_SPAWNP = "1" + HAVE_PREAD = "1" + HAVE_PREADV = "1" + HAVE_PREADV2 = "1" + HAVE_PRLIMIT = "1" + HAVE_PROCESS_H = "0" + HAVE_PROTOTYPES = "1" + HAVE_PTHREAD_CONDATTR_SETCLOCK = "1" + HAVE_PTHREAD_DESTRUCTOR = "0" + HAVE_PTHREAD_GETCPUCLOCKID = "1" + HAVE_PTHREAD_H = "1" + HAVE_PTHREAD_INIT = "0" + HAVE_PTHREAD_KILL = "1" + HAVE_PTHREAD_SIGMASK = "1" + HAVE_PTY_H = "1" + HAVE_PUTENV = "1" + HAVE_PWRITE = "1" + HAVE_PWRITEV = "1" + HAVE_PWRITEV2 = "1" + HAVE_READLINK = "1" + HAVE_READLINKAT = "1" + HAVE_READV = "1" + HAVE_REALPATH = "1" + HAVE_RENAMEAT = "1" + HAVE_RL_APPEND_HISTORY = "1" + HAVE_RL_CATCH_SIGNAL = "1" + HAVE_RL_COMPLETION_APPEND_CHARACTER = "1" + HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK = "1" + HAVE_RL_COMPLETION_MATCHES = "1" + HAVE_RL_COMPLETION_SUPPRESS_APPEND = "1" + HAVE_RL_PRE_INPUT_HOOK = "1" + HAVE_RL_RESIZE_TERMINAL = "1" + HAVE_ROUND = "1" + HAVE_RTPSPAWN = "0" + HAVE_SCHED_GET_PRIORITY_MAX = "1" + HAVE_SCHED_H = "1" + HAVE_SCHED_RR_GET_INTERVAL = "1" + HAVE_SCHED_SETAFFINITY = "1" + HAVE_SCHED_SETPARAM = "1" + HAVE_SCHED_SETSCHEDULER = "1" + HAVE_SEM_GETVALUE = "1" + HAVE_SEM_OPEN = "1" + HAVE_SEM_TIMEDWAIT = "1" + HAVE_SEM_UNLINK = "1" + HAVE_SENDFILE = "1" + HAVE_SETEGID = "1" + HAVE_SETEUID = "1" + HAVE_SETGID = "1" + HAVE_SETGROUPS = "1" + HAVE_SETHOSTNAME = "1" + HAVE_SETITIMER = "1" + HAVE_SETLOCALE = "1" + HAVE_SETPGID = "1" + HAVE_SETPGRP = "1" + HAVE_SETPRIORITY = "1" + HAVE_SETREGID = "1" + HAVE_SETRESGID = "1" + HAVE_SETRESUID = "1" + HAVE_SETREUID = "1" + HAVE_SETSID = "1" + HAVE_SETUID = "1" + HAVE_SETVBUF = "1" + HAVE_SHADOW_H = "1" + HAVE_SHM_OPEN = "1" + HAVE_SHM_UNLINK = "1" + HAVE_SIGACTION = "1" + HAVE_SIGALTSTACK = "1" + HAVE_SIGFILLSET = "1" + HAVE_SIGINFO_T_SI_BAND = "1" + HAVE_SIGINTERRUPT = "1" + HAVE_SIGNAL_H = "1" + HAVE_SIGPENDING = "1" + HAVE_SIGRELSE = "1" + HAVE_SIGTIMEDWAIT = "1" + HAVE_SIGWAIT = "1" + HAVE_SIGWAITINFO = "1" + HAVE_SNPRINTF = "1" + HAVE_SOCKADDR_ALG = "1" + HAVE_SOCKADDR_SA_LEN = "0" + HAVE_SOCKADDR_STORAGE = "1" + HAVE_SOCKETPAIR = "1" + HAVE_SPAWN_H = "1" + HAVE_SSIZE_T = "1" + HAVE_STATVFS = "1" + HAVE_STAT_TV_NSEC = "1" + HAVE_STAT_TV_NSEC2 = "0" + HAVE_STDARG_PROTOTYPES = "1" + HAVE_STDINT_H = "1" + HAVE_STDLIB_H = "1" + HAVE_STD_ATOMIC = "1" + HAVE_STRDUP = "1" + HAVE_STRFTIME = "1" + HAVE_STRINGS_H = "1" + HAVE_STRING_H = "1" + HAVE_STRLCPY = "0" + HAVE_STROPTS_H = "1" + HAVE_STRSIGNAL = "1" + HAVE_STRUCT_PASSWD_PW_GECOS = "1" + HAVE_STRUCT_PASSWD_PW_PASSWD = "1" + HAVE_STRUCT_STAT_ST_BIRTHTIME = "0" + HAVE_STRUCT_STAT_ST_BLKSIZE = "1" + HAVE_STRUCT_STAT_ST_BLOCKS = "1" + HAVE_STRUCT_STAT_ST_FLAGS = "0" + HAVE_STRUCT_STAT_ST_GEN = "0" + HAVE_STRUCT_STAT_ST_RDEV = "1" + HAVE_STRUCT_TM_TM_ZONE = "1" + HAVE_SYMLINK = "1" + HAVE_SYMLINKAT = "1" + HAVE_SYNC = "1" + HAVE_SYSCONF = "1" + HAVE_SYSEXITS_H = "1" + HAVE_SYS_AUDIOIO_H = "0" + HAVE_SYS_BSDTTY_H = "0" + HAVE_SYS_DEVPOLL_H = "0" + HAVE_SYS_DIR_H = "0" + HAVE_SYS_ENDIAN_H = "0" + HAVE_SYS_EPOLL_H = "1" + HAVE_SYS_EVENT_H = "0" + HAVE_SYS_FILE_H = "1" + HAVE_SYS_IOCTL_H = "1" + HAVE_SYS_KERN_CONTROL_H = "0" + HAVE_SYS_LOADAVG_H = "0" + HAVE_SYS_LOCK_H = "0" + HAVE_SYS_MEMFD_H = "0" + HAVE_SYS_MKDEV_H = "0" + HAVE_SYS_MMAN_H = "1" + HAVE_SYS_MODEM_H = "0" + HAVE_SYS_NDIR_H = "0" + HAVE_SYS_PARAM_H = "1" + HAVE_SYS_POLL_H = "1" + HAVE_SYS_RANDOM_H = "1" + HAVE_SYS_RESOURCE_H = "1" + HAVE_SYS_SELECT_H = "1" + HAVE_SYS_SENDFILE_H = "1" + HAVE_SYS_SOCKET_H = "1" + HAVE_SYS_STATVFS_H = "1" + HAVE_SYS_STAT_H = "1" + HAVE_SYS_SYSCALL_H = "1" + HAVE_SYS_SYSMACROS_H = "1" + HAVE_SYS_SYS_DOMAIN_H = "0" + HAVE_SYS_TERMIO_H = "0" + HAVE_SYS_TIMES_H = "1" + HAVE_SYS_TIME_H = "1" + HAVE_SYS_TYPES_H = "1" + HAVE_SYS_UIO_H = "1" + HAVE_SYS_UN_H = "1" + HAVE_SYS_UTSNAME_H = "1" + HAVE_SYS_WAIT_H = "1" + HAVE_SYS_XATTR_H = "1" + HAVE_TCGETPGRP = "1" + HAVE_TCSETPGRP = "1" + HAVE_TEMPNAM = "1" + HAVE_TERMIOS_H = "1" + HAVE_TERM_H = "1" + HAVE_TGAMMA = "1" + HAVE_TIMEGM = "1" + HAVE_TIMES = "1" + HAVE_TMPFILE = "1" + HAVE_TMPNAM = "1" + HAVE_TMPNAM_R = "1" + HAVE_TM_ZONE = "1" + HAVE_TRUNCATE = "1" + HAVE_TZNAME = "0" + HAVE_UCS4_TCL = "0" + HAVE_UNAME = "1" + HAVE_UNISTD_H = "1" + HAVE_UNLINKAT = "1" + HAVE_UNSETENV = "1" + HAVE_USABLE_WCHAR_T = "0" + HAVE_UTIL_H = "0" + HAVE_UTIMENSAT = "1" + HAVE_UTIMES = "1" + HAVE_UTIME_H = "1" + HAVE_UUID_CREATE = "0" + HAVE_UUID_ENC_BE = "0" + HAVE_UUID_GENERATE_TIME_SAFE = "0" + HAVE_UUID_H = "0" + HAVE_UUID_UUID_H = "0" + HAVE_WAIT3 = "1" + HAVE_WAIT4 = "1" + HAVE_WAITID = "1" + HAVE_WAITPID = "1" + HAVE_WCHAR_H = "1" + HAVE_WCSCOLL = "1" + HAVE_WCSFTIME = "1" + HAVE_WCSXFRM = "1" + HAVE_WMEMCMP = "1" + HAVE_WORKING_TZSET = "1" + HAVE_WRITEV = "1" + HAVE_X509_VERIFY_PARAM_SET1_HOST = "1" + HAVE_ZLIB_COPY = "1" + HAVE__GETPTY = "0" + HOST_GNU_TYPE = "x86_64-pc-linux-gnu" + IMPLEMENTATION_NAME = ""pyston"" + INCLDIRSTOMAKE = "/usr/include /usr/include /usr/include/python3.8-pyston2.3 /usr/include/python3.8-pyston2.3" + INCLUDEDIR = "/usr/include" + INCLUDEPY = "/usr/include/python3.8-pyston2.3" + INSTALL = "/usr/bin/install -c" + INSTALL_DATA = "/usr/bin/install -c -m 644" + INSTALL_PROGRAM = "/usr/bin/install -c" + INSTALL_SCRIPT = "/usr/bin/install -c" + INSTALL_SHARED = "/usr/bin/install -c -m 755" + INSTSONAME = "libpython3.8-pyston2.3.so.1.0" + IO_H = "Modules/_io/_iomodule.h" + IO_OBJS = "\" + LDCXXSHARED = "g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions" + LDFLAGS = "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro" + LDFLAGS_NODIST = "" + LDLIBRARY = "libpython3.8-pyston2.3.so" + LDLIBRARYDIR = "" + LDSHARED = "gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro" + LDVERSION = "3.8-pyston2.3" + LIBC = "" + LIBDEST = "/usr/lib/python3.8-pyston2.3" + LIBDIR = "/root/pyston_2.3.5/lib" + LIBFFI_INCLUDEDIR = "" + LIBM = "-lm" + LIBOBJDIR = "Python/" + LIBOBJS = "" + LIBPC = "/usr/lib/pkgconfig" + LIBPL = "/usr/lib/python3.8-pyston2.3/config-3.8-pyston2.3-x86_64-linux-gnu" + LIBPYTHON = "" + LIBRARY = "libpython3.8-pyston2.3.a" + LIBRARY_OBJS = "\" + LIBRARY_OBJS_OMIT_FROZEN = "\" + LIBS = "-lcrypt -lpthread -ldl -lutil -lm" + LIBSUBDIRS = "tkinter tkinter/test tkinter/test/test_tkinter \" + LINKCC = "gcc -pthread" + LINKFORSHARED = "-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions" + LIPO_32BIT_FLAGS = "" + LIPO_INTEL64_FLAGS = "" + LLVM_PROF_ERR = "no" + LLVM_PROF_FILE = "" + LLVM_PROF_MERGER = "true" + LN = "ln" + LOCALMODLIBS = "" + MACHDEP = "linux" + MACHDEP_OBJS = "" + MACHDESTLIB = "/usr/lib/python3.8-pyston2.3" + MACOSX_DEPLOYMENT_TARGET = "" + MAINCC = "gcc -pthread" + MAJOR_IN_MKDEV = "0" + MAJOR_IN_SYSMACROS = "0" + MAKESETUP = "../../Modules/makesetup" + MANDIR = "/usr/share/man" + MKDIR_P = "/bin/mkdir -p" + MODBUILT_NAMES = "posix errno pwd _sre _codecs _weakref _functools _operator _collections _abc itertools atexit _signal _stat time _thread _locale _io faulthandler _tracemalloc _symtable xxsubtype" + MODDISABLED_NAMES = "" + MODLIBS = "" + MODOBJS = "Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o Modules/xxsubtype.o" + MODULE_OBJS = "\" + MULTIARCH = "x86_64-linux-gnu" + MULTIARCH_CPPFLAGS = "-DMULTIARCH=\"x86_64-linux-gnu\"" + MVWDELCH_IS_EXPRESSION = "1" + NO_AS_NEEDED = "-Wl,--no-as-needed" + OBJECT_OBJS = "\" + OPENSSL_INCLUDES = "" + OPENSSL_LDFLAGS = "" + OPENSSL_LIBS = "-lssl -lcrypto" + OPT = "-DNDEBUG -g -fwrapv -O3 -Wall" + OTHER_LIBTOOL_OPT = "" + PACKAGE_BUGREPORT = "0" + PACKAGE_NAME = "0" + PACKAGE_STRING = "0" + PACKAGE_TARNAME = "0" + PACKAGE_URL = "0" + PACKAGE_VERSION = "0" + PARSER_HEADERS = "\" + PARSER_OBJS = "\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o" + PGO_PROF_GEN_FLAG = "-fprofile-generate" + PGO_PROF_USE_FLAG = "-fprofile-use -fprofile-correction" + POBJS = "\" + POSIX_SEMAPHORES_NOT_ENABLED = "0" + PROFILE_TASK = "../../Lib/test/regrtest.py -j 0 -unone,decimal -x test_posix test_asyncio test_cmd_line_script test_compiler test_concurrent_futures test_ctypes test_dbm_dumb test_dbm_ndbm test_distutils test_ensurepip test_ftplib test_gdb test_httplib test_imaplib test_ioctl test_linuxaudiodev test_multiprocessing test_nntplib test_ossaudiodev test_poplib test_pydoc test_signal test_socket test_socketserver test_ssl test_subprocess test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_threading_local test_threadsignals test_venv test_zipimport_support || true" + PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT = "1" + PTHREAD_SYSTEM_SCHED_SUPPORTED = "1" + PURIFY = "" + PY3LIBRARY = "libpyston3.so" + PYLONG_BITS_IN_DIGIT = "0" + PYSTON_SPEEDUPS = "1" + PYTHON = "pyston" + PYTHONFRAMEWORK = "" + PYTHONFRAMEWORKDIR = "no-framework" + PYTHONFRAMEWORKINSTALLDIR = "" + PYTHONFRAMEWORKPREFIX = "" + PYTHONPATH = "" + PYTHON_FOR_BUILD = "./pyston -E" + PYTHON_FOR_REGEN = "python3" + PYTHON_HEADERS = "\" + PYTHON_OBJS = "\" + PY_BUILTIN_MODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector -specs=/src/build/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2 -fno-reorder-blocks-and-partition -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../../Include/internal -IObjects -IInclude -IPython -I. -I../../Include -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE_BUILTIN" + PY_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security" + PY_CFLAGS_NODIST = "-fstack-protector -specs=/src/build/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2 -fno-reorder-blocks-and-partition -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../../Include/internal" + PY_COERCE_C_LOCALE = "1" + PY_CORE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector -specs=/src/build/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2 -fno-reorder-blocks-and-partition -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../../Include/internal -IObjects -IInclude -IPython -I. -I../../Include -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE" + PY_CORE_LDFLAGS = "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -specs=/src/build/pyston/tools/no-pie-link.specs -Wl,-z,relro -Wl,--emit-relocs -fno-semantic-interposition -fsemantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" + PY_CPPFLAGS = "-IObjects -IInclude -IPython -I. -I../../Include -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2" + PY_DEBUGGING_FEATURES = "0" + PY_FORMAT_SIZE_T = ""z"" + PY_LDFLAGS = "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro" + PY_LDFLAGS_NODIST = "-specs=/src/build/pyston/tools/no-pie-link.specs -Wl,-z,relro -Wl,--emit-relocs -fno-semantic-interposition -fsemantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" + PY_SSL_DEFAULT_CIPHERS = "1" + PY_SSL_DEFAULT_CIPHER_STRING = "0" + PY_STDMODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_AOT -g -O2 -fdebug-prefix-map=/src/build/pyston=. -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector -specs=/src/build/pyston/tools/no-pie-compile.specs -D_FORTIFY_SOURCE=2 -fno-reorder-blocks-and-partition -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../../Include/internal -IObjects -IInclude -IPython -I. -I../../Include -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC" + Py_DEBUG = "0" + Py_ENABLE_SHARED = "1" + Py_HASH_ALGORITHM = "0" + Py_TRACE_REFS = "0" + QUICKTESTOPTS = "-x test_subprocess test_io test_lib2to3 \" + READELF = "readelf" + RESSRCDIR = "Mac/Resources/framework" + RETSIGTYPE = "void" + RUNSHARED = "LD_LIBRARY_PATH=/src/build/build/releaseshared_build" + SCRIPTDIR = "/usr/lib" + SETPGRP_HAVE_ARG = "0" + SGI_ABI = "@SGI_ABI@" + SHELL = "/bin/sh" + SHLIBS = "-lcrypt -lpthread -ldl -lutil -lm" + SHLIB_SUFFIX = ".so" + SHM_NEEDS_LIBRT = "1" + SIGNED_RIGHT_SHIFT_ZERO_FILLS = "0" + SITEPATH = "" + SIZEOF_DOUBLE = "8" + SIZEOF_FLOAT = "4" + SIZEOF_FPOS_T = "16" + SIZEOF_INT = "4" + SIZEOF_LONG = "8" + SIZEOF_LONG_DOUBLE = "16" + SIZEOF_LONG_LONG = "8" + SIZEOF_OFF_T = "8" + SIZEOF_PID_T = "4" + SIZEOF_PTHREAD_KEY_T = "4" + SIZEOF_PTHREAD_T = "8" + SIZEOF_SHORT = "2" + SIZEOF_SIZE_T = "8" + SIZEOF_TIME_T = "8" + SIZEOF_UINTPTR_T = "8" + SIZEOF_VOID_P = "8" + SIZEOF_WCHAR_T = "4" + SIZEOF__BOOL = "1" + SO = ".pyston-23-x86_64-linux-gnu.so" + SOABI = "pyston-23-x86_64-linux-gnu" + SRCDIRS = "Parser Objects Python Modules Modules/_io Programs" + SRC_GDB_HOOKS = "../../Tools/gdb/libpython.py" + STDC_HEADERS = "1" + STRICT_SYSV_CURSES = "/* Don't use ncurses extensions */" + STRIPFLAG = "-s" + SUBDIRS = "" + SUBDIRSTOO = "Include Lib Misc" + SYSLIBS = "-lm" + SYS_SELECT_WITH_SYS_TIME = "1" + TCLTK_INCLUDES = "" + TCLTK_LIBS = "" + TESTOPTS = "" + TESTPATH = "" + TESTPYTHON = "LD_LIBRARY_PATH=/src/build/build/releaseshared_build ./pyston" + TESTPYTHONOPTS = "" + TESTRUNNER = "LD_LIBRARY_PATH=/src/build/build/releaseshared_build ./pyston ../../Tools/scripts/run_tests.py" + TESTTIMEOUT = "1200" + TIMEMODULE_LIB = "0" + TIME_WITH_SYS_TIME = "1" + TM_IN_SYS_TIME = "0" + UNICODE_DEPS = "\" + UNIVERSALSDK = "" + UPDATE_FILE = "python3 ../../Tools/scripts/update_file.py" + USE_AOT = "true" + USE_COMPUTED_GOTOS = "0" + VERSION = "3.8-pyston2.3" + VPATH = "../.." + WINDOW_HAS_FLAGS = "1" + WITH_DECIMAL_CONTEXTVAR = "1" + WITH_DOC_STRINGS = "1" + WITH_DTRACE = "0" + WITH_DYLD = "0" + WITH_LIBINTL = "0" + WITH_NEXT_FRAMEWORK = "0" + WITH_PYMALLOC = "1" + WITH_VALGRIND = "0" + X87_DOUBLE_ROUNDING = "0" + XMLLIBSUBDIRS = "xml xml/dom xml/etree xml/parsers xml/sax" + abiflags = "" + abs_builddir = "/src/build/build/releaseshared_build" + abs_srcdir = "/src/build/build/releaseshared_build/../.." + base = "/root/pyston_2.3.5" + datarootdir = "/usr/share" + exec_prefix = "/usr" + installed_base = "/root/pyston_2.3.5" + installed_platbase = "/root/pyston_2.3.5" + platbase = "/root/pyston_2.3.5" + prefix = "/usr" + projectbase = "/root/pyston_2.3.5/bin" + py_version = "3.8.12" + py_version_nodot = "38" + py_version_short = "3.8" + pyston_version = "3.8-pyston2.3" + srcdir = "/root/pyston_2.3.5/lib/python3.8-pyston2.3/config-3.8-pyston2.3-x86_64-linux-gnu" + userbase = "/root/.local" From e4b9ce14272632da4aead750ed83be5aec4ce3f3 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 1 Nov 2022 15:38:49 +0800 Subject: [PATCH 2/2] Use generic tags when `sys.implementation.name` != `platform.python_implementation()` For example pyston --- Changelog.md | 2 + src/build_options.rs | 17 +++- .../get_interpreter_metadata.py | 4 + src/python_interpreter/mod.rs | 94 ++++++++++++------- 4 files changed, 76 insertions(+), 41 deletions(-) diff --git a/Changelog.md b/Changelog.md index a6711d4c8..5ad9b9387 100644 --- a/Changelog.md +++ b/Changelog.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Upgrade to clap 4.0 in [#1197](https://github.com/PyO3/maturin/pull/1197). This bumps MSRV to 1.61.0. * Remove `workspace.members` in `Cargo.toml` from sdist if there isn't any path dependency in #[1227](https://github.com/PyO3/maturin/pull/1227) * Fix auditwheel `libpython` check on Python 3.7 and older versions in [#1229](https://github.com/PyO3/maturin/pull/1229) +* Use generic tags when `sys.implementation.name` != `platform.python_implementation()` in [#1232](https://github.com/PyO3/maturin/pull/1232). + Fixes the compatibility tags for Pyston. ## [0.13.7] - 2022-10-29 diff --git a/src/build_options.rs b/src/build_options.rs index d05bfa2a7..06562b7b0 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -270,11 +270,10 @@ impl BuildOptions { let ext_suffix = sysconfig_data .get("EXT_SUFFIX") .context("syconfig didn't define an `EXT_SUFFIX` ಠ_ಠ")?; - let abi_tag = sysconfig_data - .get("SOABI") - .and_then(|abi| abi.split('-').nth(1).map(ToString::to_string)); - let interpreter_kind = sysconfig_data - .get("SOABI") + let soabi = sysconfig_data.get("SOABI"); + let abi_tag = + soabi.and_then(|abi| abi.split('-').nth(1).map(ToString::to_string)); + let interpreter_kind = soabi .and_then(|tag| { if tag.starts_with("pypy") { Some(InterpreterKind::PyPy) @@ -298,6 +297,8 @@ impl BuildOptions { executable: PathBuf::new(), platform: None, runnable: false, + implmentation_name: interpreter_kind.to_string().to_ascii_lowercase(), + soabi: soabi.cloned(), }); } else { if interpreter.is_empty() && !self.find_interpreter { @@ -376,6 +377,8 @@ impl BuildOptions { executable: PathBuf::new(), platform: None, runnable: false, + implmentation_name: "cpython".to_string(), + soabi: None, }]) } else if let Some(interp) = interpreters.get(0) { println!("🐍 Using {} to generate to link bindings (With abi3, an interpreter is only required on windows)", interp); @@ -396,6 +399,8 @@ impl BuildOptions { executable: PathBuf::new(), platform: None, runnable: false, + implmentation_name: "cpython".to_string(), + soabi: None, }]) } else { bail!("Failed to find a python interpreter"); @@ -438,6 +443,8 @@ impl BuildOptions { executable: PathBuf::new(), platform: None, runnable: false, + implmentation_name: "cpython".to_string(), + soabi: None, }]) } else if target.cross_compiling() { let mut interps = Vec::with_capacity(found_interpreters.len()); diff --git a/src/python_interpreter/get_interpreter_metadata.py b/src/python_interpreter/get_interpreter_metadata.py index 68f763aa3..7908cac36 100644 --- a/src/python_interpreter/get_interpreter_metadata.py +++ b/src/python_interpreter/get_interpreter_metadata.py @@ -20,12 +20,16 @@ ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") metadata = { + # sys.implementation.name can differ from platform.python_implementation(), for example + # Pyston has sys.implementation.name == "pyston" while platform.python_implementation() == cpython + "implementation_name": sys.implementation.name, "executable": sys.executable or None, "major": sys.version_info.major, "minor": sys.version_info.minor, "abiflags": sysconfig.get_config_var("ABIFLAGS"), "interpreter": platform.python_implementation().lower(), "ext_suffix": ext_suffix, + "soabi": sysconfig.get_config_var("SOABI") or None, "abi_tag": (sysconfig.get_config_var("SOABI") or "-").split("-")[1] or None, "platform": sysconfig.get_platform(), # This one isn't technically necessary, but still very useful for sanity checks diff --git a/src/python_interpreter/mod.rs b/src/python_interpreter/mod.rs index 38f5a5202..9b413af76 100644 --- a/src/python_interpreter/mod.rs +++ b/src/python_interpreter/mod.rs @@ -318,6 +318,7 @@ impl FromStr for InterpreterKind { /// The output format of [GET_INTERPRETER_METADATA] #[derive(Deserialize)] struct InterpreterMetadataMessage { + implementation_name: String, executable: Option, major: usize, minor: usize, @@ -328,6 +329,7 @@ struct InterpreterMetadataMessage { platform: String, // comes from `platform.system()` system: String, + soabi: Option, abi_tag: Option, } @@ -350,6 +352,10 @@ pub struct PythonInterpreter { /// When cross compile the target interpreter isn't runnable, /// and it's `executable` is empty pub runnable: bool, + /// Comes from `sys.platform.name` + pub implmentation_name: String, + /// Comes from sysconfig var `SOABI` + pub soabi: Option, } impl Deref for PythonInterpreter { @@ -440,41 +446,58 @@ impl PythonInterpreter { } else { target.get_platform_tag(platform_tags, universal2)? }; - let tag = match self.interpreter_kind { - InterpreterKind::CPython => { - if target.is_unix() { - format!( - "cp{major}{minor}-cp{major}{minor}{abiflags}-{platform}", - major = self.major, - minor = self.minor, - abiflags = self.abiflags, - platform = platform - ) - } else { - // On windows the abiflags are missing, but this seems to work + let tag = if self.implmentation_name.parse::().is_err() { + // Use generic tags when `sys.implementation.name` != `platform.python_implementation()`, for example Pyston + // See also https://github.com/pypa/packaging/blob/0031046f7fad649580bc3127d1cef9157da0dd79/packaging/tags.py#L234-L261 + format!( + "{interpreter}{major}{minor}-{soabi}-{platform}", + interpreter = self.implmentation_name, + major = self.major, + minor = self.minor, + soabi = self + .soabi + .as_deref() + .unwrap_or("none") + .replace(['-', '.'], "_"), + platform = platform + ) + } else { + match self.interpreter_kind { + InterpreterKind::CPython => { + if target.is_unix() { + format!( + "cp{major}{minor}-cp{major}{minor}{abiflags}-{platform}", + major = self.major, + minor = self.minor, + abiflags = self.abiflags, + platform = platform + ) + } else { + // On windows the abiflags are missing, but this seems to work + format!( + "cp{major}{minor}-none-{platform}", + major = self.major, + minor = self.minor, + platform = platform + ) + } + } + InterpreterKind::PyPy => { + // pypy uses its version as part of the ABI, e.g. + // pypy 3.7 7.3 => numpy-1.20.1-pp37-pypy37_pp73-manylinux2014_x86_64.whl format!( - "cp{major}{minor}-none-{platform}", + "pp{major}{minor}-pypy{major}{minor}_{abi_tag}-{platform}", major = self.major, minor = self.minor, - platform = platform + // TODO: Proper tag handling for pypy + abi_tag = self + .abi_tag + .clone() + .expect("PyPy's syconfig didn't define an `SOABI` ಠ_ಠ"), + platform = platform, ) } } - InterpreterKind::PyPy => { - // pypy uses its version as part of the ABI, e.g. - // pypy 3.7 7.3 => numpy-1.20.1-pp37-pypy37_pp73-manylinux2014_x86_64.whl - format!( - "pp{major}{minor}-pypy{major}{minor}_{abi_tag}-{platform}", - major = self.major, - minor = self.minor, - // TODO: Proper tag handling for pypy - abi_tag = self - .abi_tag - .clone() - .expect("PyPy's syconfig didn't define an `SOABI` ಠ_ಠ"), - platform = platform, - ) - } }; Ok(tag) } @@ -598,13 +621,7 @@ impl PythonInterpreter { // We don't use platform from sysconfig on macOS None } else { - Some( - message - .platform - .to_lowercase() - .replace('-', "_") - .replace('.', "_"), - ) + Some(message.platform.to_lowercase().replace(['-', '.'], "_")) }; Ok(Some(PythonInterpreter { @@ -625,16 +642,21 @@ impl PythonInterpreter { .unwrap_or_else(|| executable.as_ref().to_path_buf()), platform, runnable: true, + implmentation_name: message.implementation_name, + soabi: message.soabi, })) } /// Construct a `PythonInterpreter` from a sysconfig and target pub fn from_config(config: InterpreterConfig) -> Self { + let implmentation_name = config.interpreter_kind.to_string().to_ascii_lowercase(); PythonInterpreter { config, executable: PathBuf::new(), platform: None, runnable: false, + implmentation_name, + soabi: None, } }