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
mix archive.install fails in fetching optional dependencies #7577
Comments
You can install phoenix as an archive? Shouldn't the archive be |
@Eiji7 it makes sense. We first install phoenix a dependency which means optional dependencies are not retrieved. We may need an internal flag here although that may require changes to Hex. |
I agree that it probably shouldn't crash but what's the use case here? It's not clear to me if optional dependencies should be fetched and used or not fetched and ignored. |
@ericmj optional dependencies are always fetched on the parent but because we fetch Phoenix as a dependency, the optional deps are not fetched. |
Right, I understand what is happening, but what should happen? Optional dependencies are in fact optional so maybe they should not be fetched. We can't use phoenix and ecto as examples because they were not intended as archives. Until we have a use case it's not clear what the fix should be. |
Yes, but not every repository have
No? https://hexdocs.pm/phoenix/installation.html#phoenix
I would like to install some packages (with mix tasks) as archives. Good examples here are |
@ericmj it should behave the same as if i git cloned phoenix and ran |
Yes :). The phoenix installer is a separate project that has no dependencies and works with
I would not recommend this. Archives will only work in special circumstances and if the project was not intended to be used as an archive it will likely not work well. Archives only use their dependencies during compilation so they will not be included in the archive itself because they would otherwise conflict with the dependencies in your projects. It's unlikely that credo and inch_ex will work correctly since they both use poison as dependency. |
Good point 👍 |
I want to install archives just for special circumstances. Any package which task analyses project code or generates code based on current working directory should not be a problem to install as archive. At least packages which I'm manually installing are not a problem.
And that's perfect, I don't wish for more 😃
They works for me without any problem with just few really simple commands:
However I can see problem which you tries to say. Normally I would agree, but packages which focuses only on things like code analyze and generating code does affect other projects as much as normal libraries. They are mostly or only used for tasks and there is no problem for projects to update a major version of such dependency, so they could be updated really often and if tasks works then everything is ok. This could be a problem if such package is no longer maintained or is really rarely updated. |
That's a bad idea because now poison in your project is going to conflict with the packages installed in your system. For example, you could even write a library, starting using poison, forget to add it as a dependency since you have locally installed, and then find it out only when you push your code. Global packages are a bad idea and we should in no way be promoting those. The reason why we need to fix this issue is not because of archives, because as @ericmj said, they are not supposed to have dependencies anyway, but because escript.install will have this same issue. |
It's why I do not install many archives. I'm installing only those which applies to all / most of all my projects. btw. those 4 packages I installed just now (temporary) to test if them work at same time to write a response to @ericmj Anyway before release I'm running Ubuntu VM, copying install script and run, so I'm installing asdf, erlang, elixir and finally clone my repo and run And anyway, anyway my projects are using |
Closing in favor of #7835. |
Installing dialyxir globally can cause trouble when working with projects that depend on dialyxir for themself as jeremyjh#273 and jeremyjh#274 have shown. Also there is this comment by @josevalim suggesting to not promote installing archives too much as well: elixir-lang/elixir#7577 (comment)
Environment
Funtoo Linux current x86-64bit on intel64-ivybridge
Current behavior
Installing archives from hex or git/github source fails in fetching optional dependencies.
For example
inch_ex
does not fails, butecto
orphoenix
fails.Expected behavior
All archives should be installed.
Example error
The text was updated successfully, but these errors were encountered: