haxetink / tink_macro

The macro toolkit
MIT License
57 stars 17 forks source link

Breaking changes due to pointing to latest tink_core #35

Closed Shaylin closed 3 years ago

Shaylin commented 3 years ago

Hello,

We've got some projects using slightly older versions of tink_macro. We've encountered an unexpected issue when installing haxelibs for our projects due to the latest version of tink_core being pulled down, and causing breaking changes.

Would it be possible to fix the versions in this projects haxelib.json to avoid breaking changes sneaking in like this? image

Thanks.

kLabz commented 3 years ago

Hi, I suppose you're using haxelib rather than lix. A workaround that could help you:

haxelib install --skip-dependencies tink_macro 1.2.3

This won't try to pull latest tink_core

I think I added this for the exact same reason: tink libs pulling more recent versions than wanted xD

Shaylin commented 3 years ago

Thanks for the workaround @kLabz

We have a way of working around it for now. Just wanted to raise this issue for the future. Especially for folks who don't use lix. Haxelib itself really doesn't have any way to freeze child dependencies like npm, so ideally we could get this version fixed in the future.

back2dos commented 3 years ago

Unfortunately, haxelib doesn't allow for a better solution from our end. If we pin the tink_core dependency to any particular version, haxelib will squarely refuse all attempts to use any different version of tink_core, even if they might be compatible anyway - which is highly likely: I've just run the tests for tink_macro with different versions of tink_core and they pass all the way back to 1.5.0 (released in 2016).

If you're using haxelib, the best solution is to have something like a dependencies.hxml with specific library versions, e.g.:

-lib tink_core:1.5.0
-lib tink_macro:0.15.0

You can use that in your builds and haxelib install dependencies.hxml will also install the required versions (plus a few more, but that rarely causes a problem).

FWIW, lix users have the same problem. But in lix, you can use a library together with a dependency that would be incompatible as per the dependent's haxelib.json. So really, leaving the tink_core version unconstrained is more in the interest of haxelib than lix users ;)