New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review/Retire pycontrib #3399

Open
skef opened this Issue Jan 7, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@skef
Copy link

skef commented Jan 7, 2019

I've been looking into the contents of pycontrib, mostly because graphicore shows warnings on my system.

graphicore itself is way out of date. It would be fairly easy to make it somewhat less so. Most of the meat of it is in graphicore/ipython_shell.py, and there is a more contemporary version of that interface at https://gitlab.gnome.org/GNOME/accerciser/blob/master/plugins/ipython_view.py . Unfortunately that version only works up to IPython 5, or at least it is broken for version 7, which is what I have on my system. Fixing it is not straightforward. excepthook.py may be an implicit piece of graphicore -- it's referenced in ipython_view.py and not anywhere else obvious.

gdraw/__init__.py needs a one-line fix (to the import) but gdraw/gdraw.py is probably a lost cause. It's trying be a bridge for python gtk-based UI elements to gdraw, but it hasn't been updated to match FontForge's gtk-based implementation, so it's playing games at the X level (asking for an xid for example). I'm not sure anything it does is even necessary now -- I got graphicore 1/4 working without it.

I can't vouch for gdraw/_gdraw.py, but it's definitely wizard-level stuff.

simple/load-font-and-show-name.py works fine for me. Whether run with fontforge or python, simple/expand-a.py gets just past the line that prints "new ..." and dumps core like this:

Core was generated by `fontforge ./expand-a.py'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00007ff3d7e0fb7b in PyObject_GetAttr () from /usr/lib/libpython3.7m.so.1.0
(gdb) where
#0  0x00007ff3d7e0fb7b in PyObject_GetAttr () at /usr/lib/libpython3.7m.so.1.0
#1  0x00007ff3d7e4cd3a in _PyEval_EvalFrameDefault () at /usr/lib/libpython3.7m.so.1.0
#2  0x00007ff3d7d93b59 in _PyEval_EvalCodeWithName () at /usr/lib/libpython3.7m.so.1.0
#3  0x00007ff3d7d94a94 in PyEval_EvalCodeEx () at /usr/lib/libpython3.7m.so.1.0
#4  0x00007ff3d7d94abc in PyEval_EvalCode () at /usr/lib/libpython3.7m.so.1.0
#5  0x00007ff3d7ebec44 in  () at /usr/lib/libpython3.7m.so.1.0
#6  0x00007ff3d7ec086e in PyRun_FileExFlags () at /usr/lib/libpython3.7m.so.1.0
#7  0x00007ff3d7ec1c25 in PyRun_SimpleFileExFlags () at /usr/lib/libpython3.7m.so.1.0
#8  0x00007ff3d7ec3e67 in  () at /usr/lib/libpython3.7m.so.1.0
#9  0x00007ff3d7d5f6a8 in Py_Main () at /usr/lib/libpython3.7m.so.1.0
#10 0x00007ff3d9a4ce14 in PyFF_Main (argc=2, argv=0x7fff63992398, start=1) at python.c:18748
#11 0x00007ff3d9a7fb39 in _CheckIsScript (argc=2, argv=0x7fff63992398) at scripting.c:10959
#12 0x00007ff3d9a7fbb6 in CheckIsScript (argc=2, argv=0x7fff63992398) at scripting.c:10977
#13 0x00007ff3da344586 in fontforge_main (argc=2, argv=0x7fff63992398) at startui.c:1072
#14 0x000055fcdc29213a in main (argc=2, argv=0x7fff63992398) at main.c:39

Someone might want to glance at that.

webcollab.py is on its surface in somewhat better shape. web-test-collab.py needs parentheses for its print line, but otherwise parses. I get these errors:

Joined session, font name: Untitled1
web-test-collab: starting up...
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module 'socket.io'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/usr/share/fontforge/nodejs/collabwebview/server.js:12:10)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
kf5.kio.core: couldn't create slave: "klauncher said: Error loading '/usr/lib/qt/plugins/kf5/kio/http.so'."
kf5.kio.widgets: KRun(0x55fdfa0f3ce0) ERROR (stat): 173   "Unable to create io-slave. klauncher said: Error loading '/usr/lib/qt/plugins/kf5/kio/http.so'."

But they're so specific to my environment that it's hard to know what would happen other systems.

Recommendation: At a minimum put graphicore somewhere that won't generate errors.

@frank-trampe

This comment has been minimized.

Copy link
Contributor

frank-trampe commented Jan 7, 2019

Are you getting these errors just bootstrapping, configuring, and making with no special options? What platform?

@skef

This comment has been minimized.

Copy link

skef commented Jan 7, 2019

My platform is Arch Linux. I've been building the git repo code with a PKGBUILD very close to that used to build FontForge as currently shipped with Arch, where the build function is:

build() {
    cd "${gitname}"
    export LIBZMQ_LIBS=-lzmq
    ./bootstrap --force
    ./configure \
        --prefix=/usr \
        --enable-debug \
        --mandir=/usr/share/man \

    make
}

One result of this is that the python scripts I describe wind up in /usr/share/fontforge/python.

graphicore produces warnings every time the program starts up. The other programs only cause problems when explicitly run. But the fundamental issue is that Arch now uses Python 3(.7) by default and much of this code dates from the Python 2 era.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment