--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- Re-enabling compilation recursively for an umbrella project that might include tasks other than “compile.elixir” proved far more complex than it should be.
Re-enabling compiler tasks is tricky because they are dynamic in nature and are different for each project. What we really need is a way to run a task without checking if it was previously ran.
There’s no API for mutating the state of a loaded Mix project, nor is there a way to trigger Mix to dispose of its internal state and call the methods on the loaded Mix.Project module over again to regenerate its internal state.
I’m not sure allowing this would be a good idea, we can’t expect to be able to reload everything in Mix. If you change your mix.exs file it would be better to just restart your iex session.
I notice that a lot of Mix tasks have “business-logic” code that exists only within the task (deps.compile is annoying for this, but it’s not that bad compared to some libraries like Exrm, where the entire release process lives inside the release task module), and where every function other than run/1 is private.
Good criticism, we should be better in this regard. Keep in mind though that we may not want to expose all of the task internals. Updating tasks without breaking backwards compatibility would become a lot harder.
Hex breaks terribly when you do certain things that are required in more complex Mix operations (like popping a project so you end up with an empty Mix.ProjectStack, and then adding a new project and calling more tasks.) I had to dig into Hex’s state to remove a reference it keeps to some Mix-internal state (that gets destroyed, presumably) so it would continue to operate.
Can you explain a bit more what causes Hex to break?
Built on top of such a zero-install capability, and given OTP, I could expose something like Application.upgrade(new_depspec), which could download the new version of an application, and then do a hot-upgrade from the running version right into it.
Except for the simplest OTP applications, doing an hot code upgrade which just reloads modules would certainly cause the application to crash. To properly upgrade an application you need an appup file with instructions on how to do it and any processes that changes it state would need code to upgrade the state. Very few libraries provide the necessary things to upgrade themselves. Upgrades are very complicated and need extensive testing, you should only do them if you really have to. Automating them without writing application specific code is impossible.
- Re-enabling compilation recursively for an umbrella project that might include tasks other than “compile.elixir” proved far more complex than it should be.
Re-enabling compiler tasks is tricky because they are dynamic in nature and are different for each project. What we really need is a way to run a task without checking if it was previously ran.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/T2RUVsI5v4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
If you remove the call to Application.delete_env(:hex, :registry_tid) from my toy project, Hex crashes when Mix tries to use it in Mix.Dep.Fetcher after a sequence of uninstalling a loaded dep, and then installing it again. If I recall, it’s crashing on the Hex.Registry.stop/0 that happens at the end of the fetch. For some reason :registry_tid is still set, but the ETS table to which it refers has already been released.
The registry is never stopped after it’s started unless we are trying to update it. There should be no need to delete env vars. Can you open an issue on Hex with the stacktrace and explanation what you are doing to cause the crash.