enso-org / dataframes

A library for working with tabular data in Luna.
https://luna-lang.org
MIT License
6 stars 5 forks source link

Crash on Table.read when using Dataframes built from sources from Luna Studio #110

Closed mwu-tow closed 5 years ago

mwu-tow commented 5 years ago

The following crashes Luna Empire when I use Dataframes built from sources:

import Std.Base
import Std.Foreign.C.Value

import Dataframes.Internal.Utils
import Dataframes.Array
import Dataframes.Table
import Dataframes.Types
import Dataframes.Internal.Test.Test

«0»def main:
    «1»Table . read "./data/tricky.csv"
    None

It works when using packaged Dataframes. It works also with shell luna. Confirmed on Ubuntu 18.04.

mwu-tow commented 5 years ago

Confirmed on Fedora 28. No issue on Windows.(

mikusp commented 5 years ago

It would be helpful if you provided stack trace of crash

mwu-tow commented 5 years ago

The crash is coming from Dataframes module initialization:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
mwu-tow commented 5 years ago

O believe it should work once PYTHONHOME and PYTHONPATH are appropriately set. But what really puzzles me is why it works in shell luna (and tests executable) but fails only in luna-empire.

mwu-tow commented 5 years ago

Actually I pinned the issue. PYTHONHOME and PYTHONPATH are for some reason set in luna-empire process to some stupid values. That cause Python interpreter to look for its standard library in wrong place and refuse to setup what causes Dataframes in turn to fail to load and the issue observed.

The question remains why the luna-empire has these variables set.

mwu-tow commented 5 years ago

And I think we have the culprit: https://github.com/AppImage/AppImageKit/blob/appimagetool/master/src/AppRun.c#L169

sylwiabr commented 5 years ago

@mwu-tow we can deal with it setting proper variable in runner/supervisor