Ejemplo n.º 1
0
def build_executable_cache(c_files, eci):
    path = cache_file_path(c_files, eci, 'build_executable_cache')
    try:
        return path.read()
    except py.error.Error:
        result = platform.execute(platform.compile(c_files, eci))
        path.write(result.out)
        return result.out
Ejemplo n.º 2
0
def build_executable_cache(c_files, eci):
    "Builds and run a program; caches the result"
    # Import 'platform' every time, the compiler may have been changed
    from pypy.translator.platform import platform

    path = cache_file_path(c_files, eci, "build_executable_cache")
    try:
        return path.read()
    except py.error.Error:
        result = platform.execute(platform.compile(c_files, eci))
        path.write(result.out)
        return result.out
Ejemplo n.º 3
0
def build_executable_cache(c_files, eci, ignore_errors=False):
    "Builds and run a program; caches the result"
    # Import 'platform' every time, the compiler may have been changed
    from pypy.translator.platform import platform
    path = cache_file_path(c_files, eci, 'build_executable_cache')
    try:
        return path.read()
    except py.error.Error:
        _previous = platform.log_errors
        try:
            if ignore_errors:
                platform.log_errors = False
            result = platform.execute(platform.compile(c_files, eci))
        finally:
            if ignore_errors:
                del platform.log_errors
            # ^^^remove from the instance --- needed so that it can
            # compare equal to another instance without it
            if platform.log_errors != _previous:
                platform.log_errors = _previous
        path.write(result.out)
        return result.out
Ejemplo n.º 4
0
def build_executable_cache(c_files, eci, ignore_errors=False):
    "Builds and run a program; caches the result"
    # Import 'platform' every time, the compiler may have been changed
    from pypy.translator.platform import platform
    path = cache_file_path(c_files, eci, 'build_executable_cache')
    try:
        return path.read()
    except py.error.Error:
        _previous = platform.log_errors
        try:
            if ignore_errors:
                platform.log_errors = False
            result = platform.execute(platform.compile(c_files, eci))
        finally:
            if ignore_errors:
                del platform.log_errors
            # ^^^remove from the instance --- needed so that it can
            # compare equal to another instance without it
            if platform.log_errors != _previous:
                platform.log_errors = _previous
        path.write(result.out)
        return result.out
Ejemplo n.º 5
0
"""
import os
import re
from pypy.translator.platform import platform
from pypy.interpreter import gateway

#XXX # the release serial 42 is not in range(16)
CPYTHON_VERSION            = (2, 7, 2, "final", 42)   #XXX # sync patchlevel.h
CPYTHON_API_VERSION        = 1013   #XXX # sync with include/modsupport.h

PYPY_VERSION               = (1, 8, 1, "dev", 0)    #XXX # sync patchlevel.h

if platform.name == 'msvc':
    COMPILER_INFO = 'MSC v.%d 32 bit' % (platform.version * 10 + 600)
elif platform.cc is not None and platform.cc.startswith('gcc'):
    out = platform.execute(platform.cc, '--version').out
    match = re.search(' (\d+\.\d+(\.\d+)*)', out)
    if match:
        COMPILER_INFO = "GCC " + match.group(1)
    else:
        COMPILER_INFO = "GCC"
else:
    COMPILER_INFO = ""


import pypy
pypydir = os.path.dirname(os.path.abspath(pypy.__file__))
del pypy
from pypy.tool.version import get_repo_version_info

import time as t
Ejemplo n.º 6
0
import os
import re
from pypy.translator.platform import platform
from pypy.interpreter import gateway

#XXX # the release serial 42 is not in range(16)
CPYTHON_VERSION = (2, 7, 2, "final", 42)
#XXX # sync CPYTHON_VERSION with patchlevel.h, package.py
CPYTHON_API_VERSION = 1013  #XXX # sync with include/modsupport.h

PYPY_VERSION = (1, 9, 0, "final", 0)  #XXX # sync patchlevel.h

if platform.name == 'msvc':
    COMPILER_INFO = 'MSC v.%d 32 bit' % (platform.version * 10 + 600)
elif platform.cc is not None and platform.cc.startswith('gcc'):
    out = platform.execute(platform.cc, '--version').out
    match = re.search(' (\d+\.\d+(\.\d+)*)', out)
    if match:
        COMPILER_INFO = "GCC " + match.group(1)
    else:
        COMPILER_INFO = "GCC"
else:
    COMPILER_INFO = ""

import pypy
pypydir = os.path.dirname(os.path.abspath(pypy.__file__))
del pypy
from pypy.tool.version import get_repo_version_info

import time as t
gmtime = t.gmtime()