Permalink
Browse files

Remove obsolete util_opy.py.

We are now sharing core/util.py.

Surprisingly, this introduced a change in the compiled output of
_regtest/src/util_opy.py!  The compilers source code leaks through to
the thing being compiled!

I think this must because of the way consts are handled.  When you are
compiling a const, it might be looked up in global interpreter state.
If the same constant is not in the interpreter because util_opy.py is no
longer imported, then the results can be different.

Haven't fixed this diff yet:

$ ./regtest.sh verify-golden
--- _regtest/dis-md5.golden.txt 2018-03-17 20:12:45.245834622 -0700
+++ -   2018-03-17 23:11:28.941012975 -0700
@@ -34,7 +34,7 @@
    823 5a440f929760bbd1f36d3bfa4b3779f8 _tmp/regtest/core/word_eval_test.pyc
    834 4a3120879710a4fd9f9d6039e4dade55 _tmp/regtest/opy/compiler2/consts.pyc
    845 0eea196e032e82f3ddc932265ce3b640 _tmp/regtest/asdl/arith_ast.pyc
-   909 b82e6bdb2652220742231fbe2bd14221 _tmp/regtest/opy/util_opy.pyc
+   899 0dd9d5f5018f43b257a438ad9680d1c1 _tmp/regtest/opy/util_opy.pyc
   1010 338f3f9966140f857e952f610a3918db _tmp/regtest/spec/bin/read_from_fd.pyc
  • Loading branch information...
Andy Chu
Andy Chu committed Mar 18, 2018
1 parent 3284fda commit eff7f400d1ea648e567a99244aecd36012409d1a
Showing with 5 additions and 57 deletions.
  1. +1 −1 bin/opy_.py
  2. +1 −1 opy/count.sh
  3. +1 −2 opy/opy_main.py
  4. +2 −1 opy/regtest.sh
  5. +0 −52 opy/util_opy.py
View
@@ -13,9 +13,9 @@
from core import args
from core import util
from opy.util_opy import log
from opy import opy_main
log = util.log
# TODO: move to quick ref?
_OPY_USAGE = 'Usage: opy_ MAIN [OPTION]... [ARG]...'
View
@@ -15,7 +15,7 @@ _count() {
# transformer -> ast -> compiler -> byte code
all() {
echo COMMON
echo opy_main.py util_opy.py | _count
echo opy_main.py | _count
echo
echo LEXER, PARSER GENERATOR, AND GRAMMR
View
@@ -29,10 +29,9 @@
# Disabled for now because byterun imports 'six', and that breaks the build.
#from .byterun import execfile
from .util_opy import log
from core import args
from core import util
log = util.log
# From lib2to3/pygram.py. This takes the place of the 'symbol' module.
View
@@ -63,9 +63,10 @@ manifest() {
# 19 seconds on lisa. This should be a benchmark.
compile() {
local pat=${1:-}
local dest=_tmp/regtest
mkdir -p $dest
time manifest | ./build.sh compile-manifest $dest
time manifest | egrep "$pat" | ./build.sh compile-manifest $dest
}
checksum() {
View

This file was deleted.

Oops, something went wrong.

0 comments on commit eff7f40

Please sign in to comment.