Skip to content
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

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

Closed
NipponSunrise opened this issue Jun 18, 2019 · 17 comments

Comments

@NipponSunrise
Copy link

NipponSunrise commented Jun 18, 2019

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 NipponSunrise changed the title Builds with HXP Project files are not more possible in Lime 7.5.0 Builds with HXP Project files are not more possible in Lime begining from 7.4.0 Jun 18, 2019
@NipponSunrise
Copy link
Author

I believe that this is supervention of that refactoring 20f626d

@NipponSunrise
Copy link
Author

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

@aprothman
Copy link
Contributor

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

@NipponSunrise
Copy link
Author

NipponSunrise commented Jun 19, 2019

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.

@aprothman
Copy link
Contributor

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.

@NipponSunrise
Copy link
Author

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
Copy link
Author

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

@PXshadow
Copy link
Contributor

PXshadow commented Jul 2, 2019

I'm having the same issue.

@NipponSunrise
Copy link
Author

NipponSunrise commented Feb 8, 2020

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

@jgranick
Copy link
Member

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

@NipponSunrise
Copy link
Author

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.

@player-03
Copy link
Contributor

Does this still happen in 7.9.0?

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

@atom-b
Copy link
Contributor

atom-b commented Apr 27, 2022

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.

@player-03
Copy link
Contributor

player-03 commented Jun 3, 2022

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.

@Igazine
Copy link

Igazine commented Nov 1, 2022

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.

@player-03
Copy link
Contributor

player-03 commented Nov 1, 2022

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
Copy link
Contributor

Update: #1615 is about to be released, so from now on our official answer can be "compile with -eval."

Closing this because the original problem (HXP projects not working on some devices) is resolved. That said, if anyone finds any information about what's wrong with Neko, we could start a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants