Commit 3a5b3e50 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #591 from kmod/debugging

Specify all package versions in virtualenv_test
parents 66592930 2f4688eb
......@@ -1122,6 +1122,7 @@ AST_Module* caching_parse_file(const char* fn) {
return parse_file(fn);
}
static const int MAX_TRIES = 5;
std::vector<char> file_data;
int tries = 0;
......@@ -1138,8 +1139,11 @@ AST_Module* caching_parse_file(const char* fn) {
file_data.push_back(buf[i]);
if (read == 0) {
if (ferror(fp))
if (ferror(fp)) {
if (tries == MAX_TRIES)
fprintf(stderr, "Error reading %s: %s\n", cache_fn.c_str(), strerror(errno));
good = false;
}
break;
}
}
......@@ -1153,8 +1157,8 @@ AST_Module* caching_parse_file(const char* fn) {
if (good) {
if (strncmp(&file_data[0], getMagic(), MAGIC_STRING_LENGTH) != 0) {
if (VERBOSITY()) {
printf("Warning: corrupt or non-Pyston .pyc file found; ignoring\n");
if (VERBOSITY() || tries == MAX_TRIES) {
fprintf(stderr, "Warning: corrupt or non-Pyston .pyc file found; ignoring\n");
}
good = false;
}
......@@ -1168,8 +1172,8 @@ AST_Module* caching_parse_file(const char* fn) {
int expected_total_length = MAGIC_STRING_LENGTH + LENGTH_LENGTH + CHECKSUM_LENGTH + length;
if (expected_total_length != file_data.size()) {
if (VERBOSITY()) {
printf("Warning: truncated .pyc file found; ignoring\n");
if (VERBOSITY() || tries == MAX_TRIES) {
fprintf(stderr, "Warning: truncated .pyc file found; ignoring\n");
}
good = false;
} else {
......@@ -1188,8 +1192,8 @@ AST_Module* caching_parse_file(const char* fn) {
}
if (checksum != 0) {
if (VERBOSITY())
printf("pyc checksum failed!\n");
if (VERBOSITY() || tries == MAX_TRIES)
fprintf(stderr, "pyc checksum failed!\n");
good = false;
}
}
......@@ -1204,12 +1208,15 @@ AST_Module* caching_parse_file(const char* fn) {
assert(rtn->type == AST_TYPE::Module);
return ast_cast<AST_Module>(rtn);
}
if (tries == MAX_TRIES)
fprintf(stderr, "Returned NULL module?\n");
good = false;
}
assert(!good);
tries++;
RELEASE_ASSERT(tries <= 5, "repeatedly failing to parse file");
RELEASE_ASSERT(tries <= MAX_TRIES, "repeatedly failing to parse file");
if (!good) {
assert(!fp);
file_data.clear();
......
......@@ -21,7 +21,15 @@ set -e
set -ux
python -c 'import __future__'
python -c 'import sys; print sys.executable'
pip install bcrypt==1.1.0 python-gflags==2.0 sqlalchemy==1.0.0 Pillow==2.8.1 decorator==3.4.2 oauth2client==1.4.11
# The first entry of each line is the main thing we're testing; the rest are dependencies.
# List the dependencies explicitly so that we can enforce specific revisions; these were the
# versions that got installed as of 6/5/15
pip install bcrypt==1.1.0 cffi==1.1.0 six==1.9.0 pycparser==2.13
pip install python-gflags==2.0
pip install sqlalchemy==1.0.0
pip install Pillow==2.8.1
pip install decorator==3.4.2
pip install oauth2client==1.4.11 httplib2==0.9.1 pyasn1==0.1.7 pyasn1-modules==0.0.5 rsa==3.1.4
python -c 'import bcrypt; assert bcrypt.__version__ == "1.1.0"; assert bcrypt.hashpw("password1", "$2a$12$0123456789012345678901").endswith("I1hdtg4K"); print "bcrypt seems to work"'
python -c 'import gflags; print "gflags imports"'
python -c 'import sqlalchemy; print "sqlalchemy imports"'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment