+1 for the proposal
+1 for including package version/additional options in cache location
I often find myself wanting to demonstrate a pattern or debug something
outside of the context of whatever full application I'm currently working
on, so this would be super useful. I like low-friction, so I'd appreciate
if all of the following forms were accepted
Mix.install([
:jason, # lazy
{:decimal, "~> 1.0"}, # versioned
{:my_lib, github: "user/repo"} # options
])
On Thursday, January 21, 2021 at 7:11:48 AM UTC-8 Fernando Tapia Rico wrote:
> +1 to the proposal
>
> +1 to add Elixir/Erlang versions as part of the cache dir structure
>
> Another suggestion: I would explain in the documentation how to pass
> configuration to the dependencies :)
>
> On Thu, 21 Jan 2021 at 15:49, José Valim <[email protected]> wrote:
>
>> > The latter solution could most easily be solved by using /tmp and
>> making a new folder each iex instance that calls mix install (possibly also
>> respecting the cache dir flag options)
>>
>> Good points.
>>
>> That's kind of how the current implementation works. The cache is in tmp
>> and the cache key is the MD5 of the deps given to install. This means that
>> the cache is most likely to be used only by the current script. So it
>> reduces the odds of interference between scripts. Otherwise you will have
>> to fetch and compile dependencies every time the script runs, which would
>> be too slow.
>>
>> Issues like Elixir version and Erlang version can be solved in two ways:
>> 1. don't do anything because Mix already solves those or 2. add those to
>> the cache key - either as part of the directory structure (my vote) or as
>> part of the MD5 computation.
>>
>> We could also support explicit naming for better control over the cache -
>> but I would wait for those until people effectively run into cache issues,
>> if ever. :)
>>
>>
>>
>> On Thu, Jan 21, 2021 at 3:35 PM Jonathan Arnett <[email protected]>
>> wrote:
>>
>>> I am also a fan of the proposal. One addendum that I would like to
>>> suggest is adding a flag to IEx such that a library can be "installed" when
>>> the shell starts.
>>>
>>> e.g.
>>> iex --install :decimal
>>> On 1/21/21 9:01 AM, Anil Kulkarni wrote:
>>>
>>> I love the general idea. I think it's a great solution for
>>> copy/paste/run needs that a scripting language should have.
>>>
>>> I do have a question about the caching packages across runs. What is the
>>> motivation? Is it to increase performance, or are there other reasons?
>>>
>>> My concern is that inevitably there will be issues with the cache. It
>>> reminds me of global pip requirements, global npm installs etc.
>>>
>>> Some issues I have personally run into with these solutions ( python and
>>> js) include:
>>>
>>> 1) the cache size increasing and needing to manually trim it. Consider
>>> popping a shell into a production environment to fix an issue. You
>>> wouldn'twant to leave stuff behind.
>>>
>>> 2) Managing dependencies across language upgrades (e.g. updating node to
>>> 15.5, what happens to the dependencies? What happens for sxs (side by side)
>>>
>>> 3. Inconsistencies due to caching, especially with node. E.g. Needing to
>>> blow away the cache and download fresh to fix an issue
>>>
>>> 4. Fire corruption due to other programs needing to nuke the cache
>>>
>>> 5. Issues that arise when backing up and then trying to restore to a
>>> different home folder (I had a python dependency hard code the path an
>>> install)
>>>
>>> 6. File permission changes, especially when switching between different
>>> users on chroot'd terminals
>>>
>>> Some of these issues are going to be a problem anyways, but I think that
>>> caching provides another avenue for things go wrong.
>>>
>>> My suggestion would be to either add explicit cache management
>>> functionality to elixir - including which path it lives, and blowing away
>>> the cache or to not use one for now.
>>>
>>> The former could look like this:
>>> ELIXIR_CACHE_DIR=/foo iex
>>> (eg set an environment var then call iex) or with parameters passed in
>>> iex --cache-dir
>>> iex --clear-cache
>>>
>>> The latter solution could most easily be solved by using /tmp and making
>>> a new folder each iex instance that calls mix install (possibly also
>>> respecting the cache dir flag options)
>>>
>>> -Anil
>>>
>>> On Jan 21, 2021, at 05:02, Felipe Stival <[email protected]> wrote:
>>>
>>>
>>> +1 for this proposal.
>>>
>>> On Thu, Jan 21, 2021, 09:54 Jon Rowe <[email protected]> wrote:
>>>
>>>> I plus one this proposal, it’s similar (for scripts at least) to what
>>>> Ruby has with bundler inline mode, I like this because such techniques
>>>> allow you to create single file reproductions of issues, which are great
>>>> for bug reports in PRs.
>>>>
>>>> Cheers
>>>> Jon
>>>> ----------------
>>>> [email protected]
>>>> https://jonrowe.co.uk
>>>>
>>>> On 21 January 2021 at 12:18, eksperimental wrote:
>>>>
>>>> `Mix.install(:decimal)` should also work out of the box IMO.
>>>>
>>>> On Thu, 21 Jan 2021 03:18:44 -0800 (PST)
>>>> "[email protected]" <[email protected]> wrote:
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "elixir-lang-core" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/elixir-lang-core/dejalu-217-a7302266-156c-46d8-86f9-089e2065af2b%40jonrowe.co.uk
>>>>
>>>> <https://groups.google.com/d/msgid/elixir-lang-core/dejalu-217-a7302266-156c-46d8-86f9-089e2065af2b%40jonrowe.co.uk?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2ByRtG-XGWkSADPXHzOLZ8AJ4g73DxEjC_8Jp1b3-sHKAg%40mail.gmail.com
>>>
>>> <https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2ByRtG-XGWkSADPXHzOLZ8AJ4g73DxEjC_8Jp1b3-sHKAg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/elixir-lang-core/0100017725401617-8cdc5c5f-8434-42d6-a3b5-0272cbf65824-000000%40email.amazonses.com
>>>
>>> <https://groups.google.com/d/msgid/elixir-lang-core/0100017725401617-8cdc5c5f-8434-42d6-a3b5-0272cbf65824-000000%40email.amazonses.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/elixir-lang-core/62020d79-4f44-38d5-65e7-a786808da633%40gmail.com
>>>
>>> <https://groups.google.com/d/msgid/elixir-lang-core/62020d79-4f44-38d5-65e7-a786808da633%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JFHs6stz5sHvFabZXP%2BS3HXMLN8PKd%2BVNJ%3DmwbF8-J_A%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JFHs6stz5sHvFabZXP%2BS3HXMLN8PKd%2BVNJ%3DmwbF8-J_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/650a3b88-ae00-4a4b-836c-0dccc1470b71n%40googlegroups.com.