lime icon indicating copy to clipboard operation
lime copied to clipboard

Builds with HXP Project files are not more possible in Lime begining from 7.4.0

Open NipponSunrise opened this issue 5 years ago • 14 comments

Hi everybody,

besides that the documentation for HXP project file is not consistent with the reality (package names, fields), the possibility of building project with HXP has been broken at all in version 7.4.0.

Command: haxelib run lime build Project.hxp flash -verbose

The code:

import lime.tools.*;

class Project extends HXProject {
    public function new() {
        super();
    }
}

Result:

Called from lime/_internal/backend/native/NativeCFFI.hx line 605
Called from lime/system/CFFI.hx line 172
Called from lime/system/CFFI.hx line 306
Uncaught exception - Could not find NekoAPI interface.

Downgrading to 7.3.0 solves the problem.

NipponSunrise avatar Jun 18 '19 16:06 NipponSunrise

I believe that this is supervention of that refactoring https://github.com/openfl/lime/commit/20f626dab8041381b76d6d202d483ae93ee48662

NipponSunrise avatar Jun 18 '19 23:06 NipponSunrise

Fast fix before patch is to make a copy of /lib/lime/7,5,0/lib named /lib/lime/7,5,0/ndll

NipponSunrise avatar Jun 18 '19 23:06 NipponSunrise

Have you tried updating to the latest HXP and doing a lime rebuild tools?

aprothman avatar Jun 19 '19 19:06 aprothman

Everything is up to date. Installed from scratch. Actually, I did a research and the result of that research in the comments above. I solved the situation for my own case. And hope you guys will solve it in next release.

The problem, obviously, in libraries folder name and foregoing refactoring.

NipponSunrise avatar Jun 19 '19 19:06 NipponSunrise

I had the same issue in Windows when I first upgraded lime to 7.5.0. I solved it the same way you did by copying the lib folder. When I started to debug it, I realized that my HXP was out of sync. After updating, I no longer experience this problem in Windows.

aprothman avatar Jun 19 '19 19:06 aprothman

Yesterday I installed all from scratch.

>haxelib list hxp
hxp: [1.1.2]

as far as I see here, 1.1.2 is the latest one

NipponSunrise avatar Jun 19 '19 19:06 NipponSunrise

May be you should try to do the same, I mean a clean install. I guess you will see the bug as it is.

NipponSunrise avatar Jun 19 '19 19:06 NipponSunrise

I'm having the same issue.

PXshadow avatar Jul 02 '19 09:07 PXshadow

It still here. In current release it can be solved by coping folder ndll from haxe/lib/lime/7,7,0/ to haxe/lib/lime/7,7,0/src.

src
|--cs
|--haxe
|--Lime
|--ndll

NipponSunrise avatar Feb 08 '20 12:02 NipponSunrise

I'm not having this issue using current Lime + OpenFL haxelib releases.

Perhaps the issue may occur if you have an old Lime dev version with a "lib" directory? "lib" is not included in current releases

jgranick avatar Feb 12 '20 23:02 jgranick

I'm not having this issue using current Lime + OpenFL haxelib releases.

Perhaps the issue may occur if you have an old Lime dev version with a "lib" directory? "lib" is not included in current releases

Please, read my last comment above yours. There is no reference to lib folder in there.

The bug is still reproducible with initial conditions mentioned in the first post with the latest environment installed from scratch which is Openfl 8.9.6 and Lime 7.7.0.

Ad-hoc fix is to make a copy of ndll folder from haxe/lib/lime/7,7,0/ to haxe/lib/lime/7,7,0/src.

NipponSunrise avatar Feb 13 '20 07:02 NipponSunrise

Does this still happen in 7.9.0?

(Like Joshua, I can't reproduce the issue.)

player-03 avatar Oct 29 '21 00:10 player-03

This still happens for me on Windows with lime 7.9.0 and openfl 9.1.0, haxe 4.2.5. Linux works fine.

Here's a repo that is PiratePig with an .hxp which repros the issue.

> openfl build html5
Called from lime/_internal/backend/native/NativeCFFI.hx line 609
Called from lime/system/CFFI.hx line 172
Called from lime/system/CFFI.hx line 306
Uncaught exception - Could not find NekoAPI interface.

haxelib list from my machine:

actuate: [1.8.9]
box2d: [1.2.3]
format: 3.4.2 [3.5.0]       
hxcpp-debugger: [1.0.6]     
hxcpp: 3.4.188 4.0.4 [4.2.1]
hxnodejs-ws: [5.2.3]
hxnodejs: [12.1.0]
hxp: 1.0.5 [1.2.2]
layout: [1.2.1]
lime-samples: [7.0.0]
lime: 7.0.0 7.2.0 7.5.0 [7.9.0]
modular: [0.10.15]
openfl-samples: 8.4.0 [8.7.0]
openfl: 8.4.1 8.7.0 [9.1.0]

The suggested workaround of copying ndll to src resolves the issue.

atom-b avatar Apr 27 '22 14:04 atom-b

Well that error isn't very informative. That's annoying. Here's a way to get a little more info:

> set OPENFL_LOAD_DEBUG=1
> openfl build html5

(Note: set only persists for the current command prompt session. You could use setx if you wanted to make it permanent.)

But I doubt even that will be enough. If I'm reading the source code correctly, the only difference is it'll print "Result : null" before crashing with the same message. What I believe to be the problem section has no logging.

Solution: let's insert our own logging.

if (result == null)
{
	trace("========================= " + library + "@" + method + " =========================");
	trace(__sysName());
	var slash = (__sysName().substr(7).toLowerCase() == "windows") ? "\\" : "/";
	trace(slash);
	var haxelib = __findHaxelib("lime");
	trace(haxelib);

	if (haxelib != "")
	{
		trace(haxelib + slash + "ndll" + slash + __sysName() + slash + library);
		result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + slash + library, library, method, args);
		trace(result);

		if (result == null)
		{
			trace(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library);
			result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library, library, method, args);
			trace(result);
		}
	}
}

Once the logging is added, make sure to run lime rebuild tools before building PiratePig again.

player-03 avatar Jun 03 '22 17:06 player-03

Sorry for bumping this, but it still occurs in Lime 8.0.0.

I can't build a simple hxp project on Windows (11, 64-bit), I get the same error like in the original post. (NativeCFFI.hx line 613)

I'd be happy to copy the required ndll's to wherever they're needed, but I'm afraid that's not something I can ask for the rest of the team/testers to do, so a solution would be great.

The HXP project is such a powerful thing, but currently unusable (works flawlessly on macOS, though)

Thanks.

Igazine avatar Nov 01 '22 18:11 Igazine

I recall discussing a similar issue last year. If it really is the same, you might be able to fix it by adding C:/HaxeToolkit/haxe/lib/lime/8,0,0/ndll/Windows64/ to your PATH. (Adjusted based on where you installed Lime, of course.)

Failing that, the easiest answer seems to be copying lime.ndll. Either copy lime/ndll/ into lime/src/ as mentioned above, or copy lime.ndll in particular into the same folder as project.hxp.

player-03 avatar Nov 01 '22 18:11 player-03