haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Conflicting library versions error is missed when using multiple hxmls

Open tobil4sk opened this issue 9 months ago • 9 comments

If I compile with the following command:

haxe -lib haxelib:4.1.0 -lib haxelib:git --version

I get the expected error Error: Error: Cannot process `haxelib:git`: Library haxelib has two versions included : 4.1.0 and git.

However, if the -lib flags are contained between different hxmls, then haxelib is invoked once per hxml, which means it doesn't catch this error anymore:

haxe a.hxml b.hxml --version
# a.hxml
-lib haxelib:4.1.0
# b.hxml
-lib haxelib:git

This leads to a potentially broken compilation and headaches, as vshaxe reports version 4.1.0, but I might get compiler errors from the git version and really I have a mixture of modules and flags from both versions.

This seems to be a regression since 4.2, possibly due to: #10654.

The correct behaviour is for haxe to call haxelib once per compilation to resolve all libraries at once, which gives haxelib the chance to complain if library versions are conflicting.

tobil4sk avatar Feb 21 '25 00:02 tobil4sk