mirror of
https://github.com/enso-org/enso.git
synced 2025-01-03 14:04:44 +03:00
Hotfix for finding parser library (#10123)
* Hotfix for finding parser library Since ydoc is now started by language server, parser is initialized differently and attempts to find `libenso_parser.so` in `component/runner` rather than `component` directory. * Add fallbacks * fix native image build
This commit is contained in:
parent
e9452ea8ad
commit
ca8d715d5a
@ -21,8 +21,18 @@ public final class Parser implements AutoCloseable {
|
||||
File parser = null;
|
||||
try {
|
||||
var whereAmI = Parser.class.getProtectionDomain().getCodeSource().getLocation();
|
||||
File dir = new File(whereAmI.toURI()).getParentFile();
|
||||
parser = new File(dir, name);
|
||||
var d = new File(whereAmI.toURI()).getParentFile();
|
||||
File path = null;
|
||||
while (d != null) {
|
||||
path = new File(d, name);
|
||||
if (path.exists()) break;
|
||||
d = d.getParentFile();
|
||||
}
|
||||
if (d == null) {
|
||||
throw new LinkageError(
|
||||
"Cannot find parser in " + new File(whereAmI.toURI()).getParentFile());
|
||||
}
|
||||
parser = path;
|
||||
System.load(parser.getAbsolutePath());
|
||||
} catch (URISyntaxException | LinkageError e) {
|
||||
File root = new File(".").getAbsoluteFile();
|
||||
|
Loading…
Reference in New Issue
Block a user