-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Explicit git Haxelib dependencies in referenced projects can not be overridden with 'dev' #572
Comments
Sorry for the wrong depot Simon. |
This issue is somewhat related: #249. Right now, dev libraries are handled the same for both |
I was mistaken, the --library specification without the git behaviour seemed to fix the issue but no longer does. I agree, the hxml and haxelib.json should use the same spec. Here's the behaviour I'm seeing: if the git version is mentioned anywhere in the dependency library chain, then it will use that instead of the dev version. Maybe there's an ordering issue which makes it random, but I haven't been able to identify it. The next step I guess is to look at the code. To be clear, this is a behaviour I'm seeing with the haxe compilation interaction with haxelib. |
You can test this out more easily by running Based on what I know about the code, the libraries are resolved in order, so if a |
Ok, that seems to be what I'm seeing as well. I you specify a --library unversioned BEFORE it's every included in any dependency, it seems to block being overridden. This behaviour is very non-obvious and would point to the versioning / dev specification system being insufficient to handle version mismatches in the dependency chain, as you describe. I'm not sure how'd I'd fix this tbh. I'm going to think about it for a bit. I think it's much more obvious for regular version conflicts, the 'dev' wrinkle makes it much less transparent. It would be nice to at least know when a library version is being 'shadowed' |
I think some of these concerns will be resolved once a better library resolution system arrives, which will allow locking library versions within a project so it is clear which versions are going to be used. Hopefully, such a system will make is easier to handle dev libraries as well. The issue is that haxe does not allow multiple versions of the same package/module in a single compilation, so having conflicting library dependencies is a problem that haxelib cannot solve, which is why it just gives an error. It cannot really do anything else in such a situation, which is why I say it's better to avoid specifying dependency versions in Instead, you can have a --library somelib:git:https://github.com/person/something_else.git
--library otherlib:1.2.0 You can then ensure the correct versions are installed using
Unfortunately, this does not really solve the issue for a library author trying to recommend a version of a dependency that works. |
What I've done is create a 'devlibs.hxml' that I include in my compilation first and add any dev libs to it. Works ok for now. |
The issue that I have is that some of the dependencies are only in GitHub, or require using the latest git version, so installing them manually is a pain. I thought I'd figured out a nice way of doing it with the library.json files. The hack above seems to work ok as a patch until a better system is in place. |
And..... my work around stopped working for no obvious reason. I'll give up on the .json dependencies for now. |
If you have a library with a haxelib.json
And then in a project .hxml you have:
--library something
And then run the following:
haxelib dev something_else ../something_else
Compiling will still look for the git version even though you have specified dev in haxelib. There doesn't seem to be a way, at a project level, to override specified dependencies in haxelib.
haxe compile.hxml
If I'm missing something let me know.
There is a work around:
If you add the dev library to the project level .hxml it will pick up the dev version.
This is not obvious behaviour.
The text was updated successfully, but these errors were encountered: