From 7348f62410d4e4ecca0a444df6527261d75587e6 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 8 Aug 2023 12:52:12 -0400 Subject: [PATCH] Work around `fullPath()` error/edge case. Neko claims that the file passed to `fullPath()` must exist. Usually this isn't enforced, but apparently there are circumstances where it is. https://github.com/HaxeFoundation/neko/blob/c852db0004dafb21515b51ef0c79fd927a74b005/libs/std/sys.c#L571 I didn't take the time to pin down what those circumstances are. Instead I figured it was easiest to just rearrange some code to follow the rule. --- src/lime/tools/HXProject.hx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lime/tools/HXProject.hx b/src/lime/tools/HXProject.hx index 6d9e55ba9..11d337710 100644 --- a/src/lime/tools/HXProject.hx +++ b/src/lime/tools/HXProject.hx @@ -374,7 +374,7 @@ class HXProject extends Script var name = Path.withoutDirectory(Path.withoutExtension(projectFile)); name = name.substr(0, 1).toUpperCase() + name.substr(1); - var tempDirectory = System.getTemporaryDirectory(); + var tempDirectory = FileSystem.fullPath(System.getTemporaryDirectory()); var classFile = Path.combine(tempDirectory, name + ".hx"); System.copyFile(path, classFile); @@ -434,7 +434,7 @@ class HXProject extends Script try { #if (lime && !eval) - var nekoOutput = FileSystem.fullPath(Path.combine(tempDirectory, name + ".n")); + var nekoOutput = Path.combine(tempDirectory, name + ".n"); System.runCommand("", "haxe", args.concat(["--main", "lime.tools.HXProject", "-neko", nekoOutput])); System.runCommand("", "neko", [nekoOutput, inputFile, outputFile]); #else @@ -443,6 +443,7 @@ class HXProject extends Script } catch (e:Dynamic) { + Log.error(Std.string(e)); FileSystem.deleteFile(inputFile); Sys.exit(1); }