lime icon indicating copy to clipboard operation
lime copied to clipboard

[BUGFIX] Run Macro Flags when using a local haxelib repository (Move flags to `include.xml`)

Open TechnikTil opened this issue 1 week ago • 1 comments

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!

TechnikTil avatar Dec 17 '25 21:12 TechnikTil

~~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 avatar Dec 17 '25 22:12 player-03

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.

https://github.com/openfl/lime/blob/2032404ff659daf5de854a91a51971f1d9f81aaf/src/lime/tools/HXProject.hx#L1240-L1265

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.

player-03 avatar Dec 17 '25 22:12 player-03

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

TechnikTil avatar Dec 17 '25 23:12 TechnikTil

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

player-03 avatar Dec 17 '25 23:12 player-03

Yup that works perfectly, thank you so much!

TechnikTil avatar Dec 18 '25 14:12 TechnikTil