Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
75d73197
Commit
75d73197
authored
Aug 29, 2016
by
Kevin Modzelewski
Committed by
GitHub
Aug 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1341 from kmod/directories
Undo all the places we changed installed paths
parents
0814d218
d3336158
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
79 additions
and
129 deletions
+79
-129
CMakeLists.txt
CMakeLists.txt
+2
-3
Makefile
Makefile
+6
-6
cmake/_sysconfigdata.py.in
cmake/_sysconfigdata.py.in
+0
-0
cmake/pyconfig.cmake
cmake/pyconfig.cmake
+2
-2
cmake/sysconfigdata.cmake
cmake/sysconfigdata.cmake
+2
-2
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+40
-27
from_cpython/Lib/distutils/command/install.py
from_cpython/Lib/distutils/command/install.py
+2
-5
from_cpython/Lib/distutils/sysconfig.py
from_cpython/Lib/distutils/sysconfig.py
+2
-14
from_cpython/Lib/sysconfig.py
from_cpython/Lib/sysconfig.py
+6
-13
from_cpython/Modules/getpath.c
from_cpython/Modules/getpath.c
+11
-25
lib_pyston/CMakeLists.txt
lib_pyston/CMakeLists.txt
+0
-17
lib_pyston/cPickle.py
lib_pyston/cPickle.py
+0
-2
lib_pyston/marshal.py
lib_pyston/marshal.py
+0
-5
test/extra/avro_test.py
test/extra/avro_test.py
+1
-1
test/extra/flask_test.py
test/extra/flask_test.py
+1
-1
test/extra/pyopenssl_test.py
test/extra/pyopenssl_test.py
+1
-1
test/extra/sqlalchemy_0.5_smalltest.py
test/extra/sqlalchemy_0.5_smalltest.py
+0
-1
test/integration/pycrypto_test.py
test/integration/pycrypto_test.py
+1
-1
test/integration/sqlalchemy_smalltest.py
test/integration/sqlalchemy_smalltest.py
+0
-1
test/lib/virtualenv
test/lib/virtualenv
+1
-1
test/test_extension/CMakeLists.txt
test/test_extension/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
75d73197
...
...
@@ -288,7 +288,7 @@ add_definitions(${LLVM_DEFINITIONS})
add_definitions
(
-DDEFAULT_PYTHON_MAJOR_VERSION=2 -DDEFAULT_PYTHON_MINOR_VERSION=7 -DDEFAULT_PYTHON_MICRO_VERSION=6
)
# Python 2.7.6
add_definitions
(
-DLLVMREV=
${
LLVMREV
}
)
include_directories
(
${
CMAKE_BINARY_DIR
}
/
from_cpython/Include
)
include_directories
(
${
CMAKE_BINARY_DIR
}
/
include/python2.7
)
include_directories
(
${
LLVM_INCLUDE_DIRS
}
)
find_package
(
LibLZMA REQUIRED
)
...
...
@@ -299,7 +299,6 @@ ADD_PROFILE_FLAGS()
include
(
sysconfigdata
)
add_subdirectory
(
lib_pyston
)
add_subdirectory
(
from_cpython
)
add_subdirectory
(
src
)
add_subdirectory
(
test/test_extension
)
...
...
@@ -351,7 +350,7 @@ add_custom_target(check-format ${CMAKE_SOURCE_DIR}/tools/check_format.sh ${LLVM_
add_custom_target
(
lint
${
PYTHON_EXE
}
${
CMAKE_SOURCE_DIR
}
/tools/lint.py WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/src
)
# check
add_custom_target
(
check-deps DEPENDS pyston copy_stdlib c
opy_libpyston c
lang-format ext_cpython ext_pyston unittests sharedmods
)
add_custom_target
(
check-deps DEPENDS pyston copy_stdlib clang-format ext_cpython ext_pyston unittests sharedmods
)
add_custom_target
(
check-pyston COMMAND
${
CMAKE_CTEST_COMMAND
}
--output-on-failure DEPENDS check-deps
)
# {run,dbg,perf,memcheck,memleaks,cachegrind}_TESTNAME
...
...
Makefile
View file @
75d73197
...
...
@@ -654,10 +654,10 @@ CMAKE_SHAREDMODS := sharedmods ext_pyston
.PHONY
:
pyston_dbg pyston_release
pyston_dbg
:
$(CMAKE_SETUP_DBG)
$(NINJA)
-C
$(CMAKE_DIR_DBG)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_DBG)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_DBG)
/pyston
$@
pyston_release
:
$(CMAKE_SETUP_RELEASE)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_RELEASE)
/pyston
$@
CMAKE_SETUP_GCC
:=
$(CMAKE_DIR_GCC)
/build.ninja
...
...
@@ -667,7 +667,7 @@ $(CMAKE_SETUP_GCC):
cd
$(CMAKE_DIR_GCC)
;
CC
=
'
$(GCC)
'
CXX
=
'
$(GPP)
'
cmake
$(COMMON_CMAKE_OPTIONS)
-DCMAKE_BUILD_TYPE
=
Debug
.PHONY
:
pyston_gcc
pyston_gcc
:
$(CMAKE_SETUP_GCC)
$(NINJA)
-C
$(CMAKE_DIR_GCC)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_GCC)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_GCC)
/pyston
$@
CMAKE_SETUP_RELEASE_GCC
:=
$(CMAKE_DIR_RELEASE_GCC)
/build.ninja
...
...
@@ -677,7 +677,7 @@ $(CMAKE_SETUP_RELEASE_GCC):
cd
$(CMAKE_DIR_RELEASE_GCC)
;
CC
=
'
$(GCC)
'
CXX
=
'
$(GPP)
'
cmake
$(COMMON_CMAKE_OPTIONS)
-DCMAKE_BUILD_TYPE
=
Release
.PHONY
:
pyston_release_gcc
pyston_release_gcc
:
$(CMAKE_SETUP_RELEASE_GCC)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_RELEASE_GCC)
/pyston
$@
...
...
@@ -689,7 +689,7 @@ $(CMAKE_SETUP_RELEASE_GCC_PGO):
cd
$(CMAKE_DIR_RELEASE_GCC_PGO)
;
CC
=
'
$(GCC)
'
CXX
=
'
$(GPP)
'
cmake
$(COMMON_CMAKE_OPTIONS)
-DCMAKE_BUILD_TYPE
=
Release
-DENABLE_PGO
=
ON
-DPROFILE_STATE
=
use
.PHONY
:
pyston_release_gcc_pgo
pyston_release_gcc_pgo
:
$(CMAKE_SETUP_RELEASE_GCC_PGO) $(CMAKE_DIR_RELEASE_GCC_PGO)/.trained
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC_PGO)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC_PGO)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_RELEASE_GCC_PGO)
/pyston
$@
CMAKE_SETUP_RELEASE_GCC_PGO_INSTRUMENTED
:=
$(CMAKE_DIR_RELEASE_GCC_PGO_INSTRUMENTED)
/build.ninja
...
...
@@ -700,7 +700,7 @@ $(CMAKE_SETUP_RELEASE_GCC_PGO_INSTRUMENTED):
.PHONY
:
pyston_release_gcc_pgo_instrumented
pyston_release_gcc_pgo_instrumented
:
$(CMAKE_SETUP_RELEASE_GCC_PGO_INSTRUMENTED)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC_PGO_INSTRUMENTED)
pyston copy_stdlib
copy_libpyston
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
$(NINJA)
-C
$(CMAKE_DIR_RELEASE_GCC_PGO_INSTRUMENTED)
pyston copy_stdlib
$(CMAKE_SHAREDMODS)
ext_cpython
$(NINJAFLAGS)
ln
-sf
$(CMAKE_DIR_RELEASE_GCC_PGO_INSTRUMENTED)
/pyston
$@
PROFILE_TARGET
:=
./pyston
$(SRC_DIR)
/minibenchmarks/combined.py
...
...
lib_pyston
/_sysconfigdata.py.in
→
cmake
/_sysconfigdata.py.in
View file @
75d73197
File moved
cmake/pyconfig.cmake
View file @
75d73197
...
...
@@ -63,9 +63,9 @@ set(CMAKE_REQUIRED_LIBRARIES util)
check_symbol_exists
(
openpty
"pty.h"
HAVE_OPENPTY
)
configure_file
(
from_cpython/Include/pyconfig.h.in
from_cpython/Include
/pyconfig.h
)
configure_file
(
from_cpython/Include/pyconfig.h.in
include/python2.7
/pyconfig.h
)
# CMake sucks: it has no idea that pyconfig.h is something that can be installed.
# Just tell it to install whatever file is at that particular location, and rely on
# the rest of the build rules to ensure that it's made in time.
install
(
FILES
${
CMAKE_BINARY_DIR
}
/from_cpython/Include/pyconfig.h DESTINATION
from_cpython/Include
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/from_cpython/Include/pyconfig.h DESTINATION
include/python2.7
)
cmake/sysconfigdata.cmake
View file @
75d73197
...
...
@@ -8,9 +8,9 @@ if (${ENABLE_REF_DEBUG})
set
(
EXT_BUILD_FLAGS
"-DPy_REF_DEBUG -DPYMALLOC_DEBUG -DPy_TRACE_REFS
${
EXT_BUILD_FLAGS
}
"
)
endif
()
configure_file
(
lib_pyston/_sysconfigdata.py.in lib_pyston
/_sysconfigdata.py
)
configure_file
(
cmake/_sysconfigdata.py.in lib/python2.7
/_sysconfigdata.py
)
# CMake sucks: it has no idea that configure-generated files can be installed.
# Just tell it to install whatever file is at that particular location, and rely on
# the rest of the build rules to ensure that it's made in time.
install
(
FILES
${
CMAKE_BINARY_DIR
}
/lib
_pyston/_sysconfigdata.py DESTINATION lib_pyston
)
install
(
FILES
${
CMAKE_BINARY_DIR
}
/lib
/python2.7/_sysconfigdata.py DESTINATION lib/python2.7
)
from_cpython/CMakeLists.txt
View file @
75d73197
# Copy any changed stdlib files to the destination:
file
(
GLOB_RECURSE STDLIB_SRCS Lib/
"*.py"
)
file
(
GLOB_RECURSE STD_INCLUDES Include/
"*.h"
)
file
(
GLOB_RECURSE STDLIB_SRCS Lib/
*.py
)
file
(
GLOB_RECURSE STD_INCLUDES Include/
*.h
)
set
(
STDLIB_TARGETS
""
)
foreach
(
STDLIB_FILE
${
STDLIB_SRCS
}
${
STD_INCLUDES
}
)
file
(
RELATIVE_PATH FN_REL
${
CMAKE_SOURCE_DIR
}
${
STDLIB_FILE
}
)
set
(
TARGET
${
CMAKE_BINARY_DIR
}
/
${
FN_REL
}
)
foreach
(
STDLIB_FILE
${
STDLIB_SRCS
}
)
file
(
RELATIVE_PATH FN_REL
${
CMAKE_SOURCE_DIR
}
/from_cpython/Lib
${
STDLIB_FILE
}
)
set
(
TARGET
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/
${
FN_REL
}
)
add_custom_command
(
OUTPUT
${
TARGET
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
STDLIB_FILE
}
${
TARGET
}
DEPENDS
${
STDLIB_FILE
}
COMMENT
"Copying
${
FN_REL
}
"
COMMENT
"Copying
Python stdlib
${
FN_REL
}
"
)
set
(
STDLIB_TARGETS
${
STDLIB_TARGETS
}
${
TARGET
}
)
get_filename_component
(
DIR
${
FN_REL
}
DIRECTORY
)
install
(
FILES
${
STDLIB_FILE
}
DESTINATION
${
DIR
}
)
install
(
FILES
${
STDLIB_FILE
}
DESTINATION lib/python2.7/
${
DIR
}
)
endforeach
(
STDLIB_FILE
)
foreach
(
STDLIB_FILE
${
STD_INCLUDES
}
)
file
(
RELATIVE_PATH FN_REL
${
CMAKE_SOURCE_DIR
}
/from_cpython/Include
${
STDLIB_FILE
}
)
set
(
TARGET
${
CMAKE_BINARY_DIR
}
/include/python2.7/
${
FN_REL
}
)
add_custom_command
(
OUTPUT
${
TARGET
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
STDLIB_FILE
}
${
TARGET
}
DEPENDS
${
STDLIB_FILE
}
COMMENT
"Copying Python header
${
FN_REL
}
"
)
set
(
STDLIB_TARGETS
${
STDLIB_TARGETS
}
${
TARGET
}
)
get_filename_component
(
DIR
${
FN_REL
}
DIRECTORY
)
install
(
FILES
${
STDLIB_FILE
}
DESTINATION include/python2.7/
${
DIR
}
)
endforeach
(
STDLIB_FILE
)
add_custom_target
(
copy_stdlib ALL DEPENDS
${
STDLIB_TARGETS
}
)
...
...
@@ -128,7 +142,7 @@ file(GLOB_RECURSE STDPYTHON_SRCS Python
_warnings.c
)
# compile specified files in from_cpython/P
ython
# compile specified files in from_cpython/P
arser
file
(
GLOB_RECURSE STDPARSER_SRCS Parser
acceler.c
grammar1.c
...
...
@@ -144,29 +158,28 @@ add_library(FROM_CPYTHON OBJECT ${STDMODULE_SRCS} ${STDOBJECT_SRCS} ${STDPYTHON_
add_dependencies
(
FROM_CPYTHON copy_stdlib
)
set
(
STDMODULES
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/bz2.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/cmath.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/cPickle.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_ctypes.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_curses.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_elementtree.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/future_builtins.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/grp.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_locale.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/mmap.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_multiprocessing.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/parser.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/pyexpat.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/readline.pyston.so
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/termios.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/bz2.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/cmath.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/cPickle.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_ctypes.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_curses.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_elementtree.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/future_builtins.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/grp.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_locale.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/mmap.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_multiprocessing.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/parser.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/pyexpat.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/readline.pyston.so
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/termios.pyston.so
)
add_custom_command
(
OUTPUT
${
STDMODULES
}
COMMAND
${
CMAKE_BINARY_DIR
}
/pyston setup.py build --build-lib
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
COMMAND
${
CMAKE_BINARY_DIR
}
/pyston setup.py build --build-lib
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
DEPENDS
pyston
copy_stdlib
copy_libpyston
Modules/_multiprocessing/multiprocessing.c
Modules/_multiprocessing/semaphore.c
Modules/_multiprocessing/socket_connection.c
...
...
@@ -193,6 +206,6 @@ add_custom_command(OUTPUT ${STDMODULES}
Modules/cPickle.c
Modules/parsermodule.c
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_custom_target
(
sharedmods ALL DEPENDS
${
CMAKE_BINARY_DIR
}
/
from_cpython/Lib
/_multiprocessing.pyston.so
)
add_custom_target
(
sharedmods ALL DEPENDS
${
CMAKE_BINARY_DIR
}
/
lib/python2.7/lib-dynload
/_multiprocessing.pyston.so
)
install
(
FILES
${
STDMODULES
}
DESTINATION
from_cpython/Lib
)
install
(
FILES
${
STDMODULES
}
DESTINATION
lib/python2.7/lib-dynload
)
from_cpython/Lib/distutils/command/install.py
View file @
75d73197
...
...
@@ -41,11 +41,8 @@ else:
INSTALL_SCHEMES
=
{
'unix_prefix'
:
{
# Pyston change
# 'purelib': '$base/lib/python$py_version_short/site-packages',
# 'platlib': '$platbase/lib/python$py_version_short/site-packages',
'purelib'
:
'$base/site-packages'
,
'platlib'
:
'$base/site-packages'
,
'purelib'
:
'$base/lib/python$py_version_short/site-packages'
,
'platlib'
:
'$platbase/lib/python$py_version_short/site-packages'
,
'headers'
:
'$base/include/python$py_version_short/$dist_name'
,
'scripts'
:
'$base/bin'
,
'data'
:
'$base'
,
...
...
from_cpython/Lib/distutils/sysconfig.py
View file @
75d73197
# This file is originally from CPython 2.7, with modifications for Pyston
# We should probably create a pyston-specific version instead of modifying the
# CPython one.
"""Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
...
...
@@ -68,9 +64,6 @@ def get_python_version():
def
get_python_inc
(
plat_specific
=
0
,
prefix
=
None
):
# Pyston change: this is the way we layout things internally:
return
os
.
path
.
join
(
sys
.
prefix
,
"from_cpython/Include"
)
"""Return the directory containing installed Python header files.
If 'plat_specific' is false (the default), this is the path to the
...
...
@@ -126,17 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix
=
plat_specific
and
EXEC_PREFIX
or
PREFIX
if
os
.
name
==
"posix"
:
# Pyston change
# libpython = os.path.join(prefix,
# "lib", "python" + get_python_version())
libpython
=
os
.
path
.
join
(
prefix
,
"
from_cpython"
,
"Lib"
)
"
lib"
,
"python"
+
get_python_version
()
)
if
standard_lib
:
return
libpython
else
:
# Pyston change
# return os.path.join(libpython, "site-packages")
return
os
.
path
.
join
(
prefix
,
"site-packages"
)
return
os
.
path
.
join
(
libpython
,
"site-packages"
)
elif
os
.
name
==
"nt"
:
if
standard_lib
:
...
...
from_cpython/Lib/sysconfig.py
View file @
75d73197
...
...
@@ -7,19 +7,12 @@ from os.path import pardir, realpath
_INSTALL_SCHEMES
=
{
'posix_prefix'
:
{
# Pyston changes: changed paths
# 'stdlib': '{base}/lib/python{py_version_short}',
# 'platstdlib': '{platbase}/lib/python{py_version_short}',
# 'purelib': '{base}/lib/python{py_version_short}/site-packages',
# 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
# 'include': '{base}/include/python{py_version_short}',
# 'platinclude': '{platbase}/include/python{py_version_short}',
'stdlib'
:
'{base}/from_cpython/Lib'
,
'platstdlib'
:
'{platbase}/from_cpython/Lib'
,
'purelib'
:
'{base}/site-packages'
,
'platlib'
:
'{platbase}/site-packages'
,
'include'
:
'{base}/from_cpython/Include'
,
'platinclude'
:
'{platbase}/from_cpython/Include'
,
'stdlib'
:
'{base}/lib/python{py_version_short}'
,
'platstdlib'
:
'{platbase}/lib/python{py_version_short}'
,
'purelib'
:
'{base}/lib/python{py_version_short}/site-packages'
,
'platlib'
:
'{platbase}/lib/python{py_version_short}/site-packages'
,
'include'
:
'{base}/include/python{py_version_short}'
,
'platinclude'
:
'{platbase}/include/python{py_version_short}'
,
'scripts'
:
'{base}/bin'
,
'data'
:
'{base}'
,
},
...
...
from_cpython/Modules/getpath.c
View file @
75d73197
...
...
@@ -91,6 +91,14 @@
* process to find the installed Python tree.
*/
// Pyston change:
// In CPython, these are passed via commandline flags:
#define VERSION "2.7"
#define PREFIX ""
#define EXEC_PREFIX ""
#define VPATH ""
#define PYTHONPATH ":lib-dynload"
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -117,9 +125,8 @@
#endif
#ifndef PYTHONPATH
// Pyston change
#define PYTHONPATH PREFIX "/from_cpython/Lib:" \
EXEC_PREFIX "/from_cpython/Lib/lib-dynload"
#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
#endif
#ifndef LANDMARK
...
...
@@ -130,7 +137,7 @@ static char prefix[MAXPATHLEN+1];
static
char
exec_prefix
[
MAXPATHLEN
+
1
];
static
char
progpath
[
MAXPATHLEN
+
1
];
static
char
*
module_search_path
=
NULL
;
static
char
lib_python
[]
=
"
from_cpython/Lib"
;
// Pyston change
static
char
lib_python
[]
=
"
lib/python"
VERSION
;
static
void
reduce
(
char
*
dir
)
...
...
@@ -397,7 +404,6 @@ calculate_path(void)
const
char
*
prog
=
Py_GetProgramName
();
char
argv0_path
[
MAXPATHLEN
+
1
];
char
zip_path
[
MAXPATHLEN
+
1
];
char
lib_pyston_path
[
MAXPATHLEN
+
1
];
// Pyston change
int
pfound
,
efound
;
/* 1 if found; -1 if found build directory */
char
*
buf
;
size_t
bufsz
;
...
...
@@ -591,16 +597,6 @@ calculate_path(void)
bufsz
+=
strlen
(
zip_path
)
+
1
;
bufsz
+=
strlen
(
exec_prefix
)
+
1
;
// Pyston change: add from_cpython/Lib and lib_pyston
// Prefix contains at this point the full path to 'from_cpython/Lib'
strcpy
(
lib_pyston_path
,
prefix
);
// go from ./from_cpython/Lib to ./lib_pyston
reduce
(
lib_pyston_path
);
reduce
(
lib_pyston_path
);
joinpath
(
lib_pyston_path
,
"lib_pyston"
);
bufsz
+=
strlen
(
lib_pyston_path
)
+
1
;
bufsz
+=
strlen
(
prefix
)
+
1
;
/* This is the only malloc call in this file */
buf
=
(
char
*
)
PyMem_Malloc
(
bufsz
);
...
...
@@ -621,17 +617,7 @@ calculate_path(void)
/* Next is the default zip path */
strcat
(
buf
,
zip_path
);
// Pyston change
// add from_cpython/Lib
strcat
(
buf
,
delimiter
);
strcat
(
buf
,
prefix
);
// add lib_pyston
strcat
(
buf
,
delimiter
);
strcat
(
buf
,
lib_pyston_path
);
strcat
(
buf
,
delimiter
);
/* Next goes merge of compile-time $PYTHONPATH with
* dynamically located prefix.
...
...
lib_pyston/CMakeLists.txt
deleted
100644 → 0
View file @
0814d218
# Copy any changed lib_pyston sources:
file
(
GLOB_RECURSE LIBPYSTON_SRCS .
"*.py"
)
set
(
LIBPYSTON_TARGETS
""
)
foreach
(
STDLIB_FILE
${
LIBPYSTON_SRCS
}
)
file
(
RELATIVE_PATH FN_REL
${
CMAKE_SOURCE_DIR
}
${
STDLIB_FILE
}
)
set
(
TARGET
${
CMAKE_BINARY_DIR
}
/
${
FN_REL
}
)
add_custom_command
(
OUTPUT
${
TARGET
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
STDLIB_FILE
}
${
TARGET
}
DEPENDS
${
STDLIB_FILE
}
COMMENT
"Copying
${
FN_REL
}
"
)
set
(
LIBPYSTON_TARGETS
${
LIBPYSTON_TARGETS
}
${
TARGET
}
)
endforeach
(
STDLIB_FILE
)
add_custom_target
(
copy_libpyston ALL DEPENDS
${
LIBPYSTON_TARGETS
}
)
install
(
FILES
${
LIBPYSTON_SRCS
}
DESTINATION lib_pyston
)
lib_pyston/cPickle.py
deleted
100644 → 0
View file @
0814d218
from
pickle
import
*
lib_pyston/marshal.py
deleted
100644 → 0
View file @
0814d218
# Very simple stub for the marshal module.
# - pickle imports marshal
def
loads
(
*
args
,
**
kw
):
raise
NotImplementedError
()
test/extra/avro_test.py
View file @
75d73197
...
...
@@ -16,7 +16,7 @@ subprocess.check_call(["wget", url], cwd=ENV_NAME)
subprocess
.
check_call
([
"tar"
,
"-zxf"
,
"avro-1.7.7.tar.gz"
],
cwd
=
ENV_NAME
)
env
=
os
.
environ
env
[
"PYTHONPATH"
]
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"site-packages"
))
env
[
"PYTHONPATH"
]
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"
lib/python2.7/
site-packages"
))
# this tests also fail when run in cpython with nose.
# pytest makes two of this work but we can't currently run pytest...
...
...
test/extra/flask_test.py
View file @
75d73197
...
...
@@ -17,7 +17,7 @@ create_virtenv(ENV_NAME,
"markupsafe == 0.23"
]
,
force_create
=
True
)
sys
.
path
.
append
(
ENV_NAME
+
"/site-packages"
)
sys
.
path
.
append
(
ENV_NAME
+
"/
lib/python2.7/
site-packages"
)
from
flask
import
Flask
,
Markup
from
jinja2
import
Template
...
...
test/extra/pyopenssl_test.py
View file @
75d73197
...
...
@@ -5,7 +5,7 @@ from test_helper import create_virtenv, run_test
ENV_NAME
=
os
.
path
.
abspath
(
"pyopenssl_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
))
NOSETESTS_EXE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"bin"
,
"nosetests"
))
PYOPENSSL_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"site-packages"
,
"OpenSSL"
))
PYOPENSSL_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"
lib"
,
"python2.7"
,
"
site-packages"
,
"OpenSSL"
))
packages
=
[
"nose==1.3.7"
,
"pycparser==2.13"
,
"cryptography==1.0.1"
,
"pyopenssl==0.15.1"
,
"pyasn1==0.1.7"
,
"idna==2.0"
,
"six==1.9.0"
,
"enum34==1.0.4"
,
"ipaddress==1.0.14"
,
"cffi==1.1.0"
]
create_virtenv
(
ENV_NAME
,
packages
,
force_create
=
True
)
...
...
test/extra/sqlalchemy_0.5_smalltest.py
View file @
75d73197
...
...
@@ -34,7 +34,6 @@ python_exe = os.path.abspath(ENV_NAME + "/bin/python")
sys
.
path
.
append
(
SQLALCHEMY_DIR
+
"/lib"
)
sys
.
path
.
insert
(
0
,
SQLALCHEMY_DIR
)
sys
.
path
.
append
(
ENV_NAME
+
"/site-packages"
)
sys
.
path
.
append
(
ENV_NAME
+
"/lib/python2.7/site-packages"
)
os
.
chdir
(
SQLALCHEMY_DIR
)
...
...
test/integration/pycrypto_test.py
View file @
75d73197
...
...
@@ -33,7 +33,7 @@ print "-- Installing pycrypto"
subprocess
.
check_call
([
sys
.
executable
,
"setup.py"
,
"install"
,
"--prefix=install"
],
stdout
=
devnull
)
print
"-- Testing pycrypto"
sys
.
path
.
append
(
"install/site-packages"
)
sys
.
path
.
append
(
"install/
lib/python2.7/
site-packages"
)
test_string
=
"test string"
.
ljust
(
16
)
...
...
test/integration/sqlalchemy_smalltest.py
View file @
75d73197
...
...
@@ -33,7 +33,6 @@ python_exe = os.path.abspath(ENV_NAME + "/bin/python")
sys
.
path
.
append
(
SQLALCHEMY_DIR
+
"/lib"
)
sys
.
path
.
insert
(
0
,
SQLALCHEMY_DIR
)
sys
.
path
.
append
(
ENV_NAME
+
"/site-packages"
)
sys
.
path
.
append
(
ENV_NAME
+
"/lib/python2.7/site-packages"
)
os
.
chdir
(
SQLALCHEMY_DIR
)
...
...
virtualenv
@
db70fc50
Subproject commit
c48a89b5c43cbb19d87c6f8467fdfa7fbc3438a9
Subproject commit
db70fc5084483b636b4bbf05519f4d69a2c741fa
test/test_extension/CMakeLists.txt
View file @
75d73197
...
...
@@ -5,7 +5,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build/lib.linux-x86_64-2.7
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/basic_test.pyston.so
COMMAND
${
CMAKE_BINARY_DIR
}
/pyston setup.py build --build-lib
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS pyston copy_stdlib
copy_libpyston
basic_test.c descr_test.c slots_test.c type_test.c api_test.c
DEPENDS pyston copy_stdlib basic_test.c descr_test.c slots_test.c type_test.c api_test.c
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_custom_target
(
ext_cpython DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/build/lib.linux-x86_64-2.7/basic_test.so
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment