Skip to content

Conversation

@TechnikTil
Copy link

Related Issues

Fixes #2004

Description

When compiling a lime project while using a local haxelib repository, the extraParams.hxml in lime is skipped.
This causes AssetsMacro.embedBytes() to never run on haxe.io.Bytes, causing #2004.

To fix this, I have moved those flags over to include.xml.

This is my first PR to here, so let me know if I should do something different in the future!

Signed-off-by: TechnikTil <techniktil@tilnotdrip.org>
@player-03
Copy link
Contributor

player-03 commented Dec 17, 2025

Odd. Looking at the generated hxml files, it generates -cp /path/to/global/Haxelib/lime/8,3,0/src. This implies that, for whatever reason, Lime deliberately bypasses the local repo, and includes the globally-installed copy. Edit: No, that was a quirk of how I tested it. But the below stands.

Normally, haxelib path would include the contents of extraParams.hxml. However, this bypass code evidently does not. I'll see if I can track it down.

@player-03
Copy link
Contributor

Ok, found it. If a path override is defined, it won't call haxelib path. This happens here and here in this case, but can happen for any number of reasons.

if (Haxelib.pathOverrides.exists(name))
{
var path = Haxelib.pathOverrides.get(name);
var jsonPath = Path.combine(path, "haxelib.json");
var added = false;
try
{
if (FileSystem.exists(jsonPath))
{
var json = Json.parse(File.getContent(jsonPath));
if (Reflect.hasField(json, "classPath"))
{
path = Path.combine(path, json.classPath);
}
var haxelibName = json.name;
compilerFlags = ArrayTools.concatUnique(compilerFlags, ["-D " + haxelibName + "=" + json.version], true);
}
}
catch (e:Dynamic) {}
var param = "-cp " + path;
compilerFlags.remove(param);
compilerFlags.push(param);
}

Since this can happen to more libraries than just Lime, I think the correct solution is to include extraParams.hxml, not to move the extra params on a case-by-case basis.

@TechnikTil
Copy link
Author

Since this can happen to more libraries than just Lime, I think the correct solution is to include extraParams.hxml, not to move the extra params on a case-by-case basis.

Should I edit the PR to do so then?
Or should I just close this

@player-03
Copy link
Contributor

Check out #2010 and if that fixes it for you, we can close this one.

@TechnikTil
Copy link
Author

Yup that works perfectly, thank you so much!

@TechnikTil TechnikTil closed this Dec 18, 2025
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

Successfully merging this pull request may close these issues.

Bug: Embedded Sounds causes an exception with Haxelib local repo

2 participants