Permalink
Browse files

Add a more detailed error message when the app bundle can't be imported.

Fixes issue #47.

Also:

- Fix the wild table sorting.  It was broken after removing the columns
  about timing.
- Add web code to the line count.  csv2html.py is new for the OSH 0.2
  release.
- Fix a build issue with osh-quick-ref.  This build step outputs both
  code that goes in the app bundle and docs that go in _release/VERSION.
  • Loading branch information...
Andy Chu
Andy Chu committed Nov 7, 2017
1 parent 538b1f2 commit 77d096c111e2c890eb7a1e081af11c3dc4c53622
Showing with 31 additions and 9 deletions.
  1. +16 −2 Python-2.7.13/Modules/main.c
  2. +6 −3 build/doc.sh
  3. +4 −0 scripts/count.sh
  4. +5 −1 scripts/release.sh
  5. +0 −3 test/wild_report.py
@@ -243,6 +243,16 @@ static int RunMainFromImporter(char *filename)
}
// TODO: Stat the file and show its size?
static void FatalAppBundleError(char* filename, int sts) {
fprintf(stderr, "FATAL: couldn't import from app bundle '%s' (%d)\n",
filename, sts);
fprintf(stderr, "Stripping the oil.ovm binary may cause this error.\n");
fprintf(stderr, "See https://github.com/oilshell/oil/issues/47\n");
exit(1);
}
/* Main program */
#ifdef OVM_MAIN
@@ -344,14 +354,18 @@ Ovm_Main(int argc, char **argv)
// NOTE: This seems like it could be simplified to RunModule(MAIN_NAME,
// 0), but it caused a SystemError exception from runpy.
sts = RunMainFromImporter(ovm_path);
assert(sts != -1); // failed import
if (sts != 0) { // failed import
FatalAppBundleError(ovm_path, sts);
}
OVM_VERBOSE_LOG("status of RunMainFromImporter: %d\n", sts);
} else {
// Try detecting and running a directory or .zip file first.
Py_InitializeEx(0 /*install_sigs*/, filename /*sys_path*/);
PySys_SetArgv(argc-1, argv+1);
sts = RunMainFromImporter(filename);
assert(sts != -1); // failed import
if (sts != 0) { // failed import
FatalAppBundleError(filename, sts);
}
OVM_VERBOSE_LOG("(!run_self) status of RunMainFromImporter: %d\n", sts);
// Not a .zip file. Run a plain .pyc file.
View
@@ -60,8 +60,9 @@ _quick-ref() {
x-quick-ref() {
local prog=$1
local out_dir=$2
local html_out=_release/VERSION/doc/$prog-quick-ref.html
local html_out=$out_dir/doc/$prog-quick-ref.html
local text_out_dir=_build/$prog-quick-ref
local py_out=_devbuild/${prog}_help.py
@@ -124,11 +125,13 @@ EOF
}
osh-quick-ref() {
x-quick-ref osh "$@"
local out_dir=${1:-_build}
x-quick-ref osh $out_dir
}
oil-quick-ref() {
x-quick-ref oil "$@"
local out_dir=${1:-_build}
x-quick-ref oil $out_dir
}
markdown2html() {
View
@@ -40,6 +40,10 @@ all() {
ls tools/*.py | filter-py | xargs wc -l | sort --numeric
echo
echo 'WEB'
ls web/*.js web/*/*.{js,py} | xargs wc -l | sort --numeric
echo
echo 'OTHER UNIT TESTS'
wc -l {build,test,asdl,tools}/*_test.py | sort --numeric
echo
View
@@ -393,7 +393,11 @@ build-tree() {
cp -v _build/release-date.txt oil-version.txt $root
# Docs
build/doc.sh osh-quick-ref
# NOTE: This action is also run in the build. It generates code that goes in
# the binary.
build/doc.sh osh-quick-ref _release/VERSION
build/doc.sh install
build/doc.sh release-index $root/index.html
View
@@ -138,7 +138,6 @@ def MakeHtmlGroup(title_str, body_str):
{.section dirs}
<table id="dirs">
<colgroup> <!-- for table-sort.js -->
<col type="number">
<col type="number">
<col type="number">
<col type="number">
@@ -203,8 +202,6 @@ def MakeHtmlGroup(title_str, body_str):
<col type="number">
<col type="case-insensitive">
<col type="number">
<col type="number">
<col type="number">
<col type="case-insensitive">
<col type="case-insensitive">
</colgroup>

0 comments on commit 77d096c

Please sign in to comment.