elves / elvish

Powerful scripting language & versatile interactive shell

Home Page:https://elv.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I use EPM to point to older versions of a dependency?

crinklywrappr opened this issue · comments

Guys, I'm a big dummy. This issue has come up a few times and no matter how many times I read the epm reference page I never get it.

I maintain rivendell. Recently it received an update for Elvish 0.19 which leaves it broken for earlier versions of Elvish.

For now, I want to stick to 0.18 on my laptop. Don't ask why.

So, how do I use epm:install to point to an earlier commit?

Or, maybe I need to clone the project locally and git reset to a particular commit. It looks like I can point epm:install to my local repo since epm supports rsync. How, though? I can't get it to work.

I re-discovered the trick to rsync. It's kinda cool. Still, if I add instructions to the README for 0.18 users, that seems a bit lengthy.

There's no support for pointing to a specific commit now, unfortunately. It shouldn't be too hard to add that feature though, epm is an Elvish module https://github.com/elves/elvish/blob/master/pkg/mods/epm/epm.elv

I wholeheartedly agree that a solution to this problem is needed. Especially since I'm always running a bleeding edge developer version of Elvish. But, before anyone rushes off to add support to epm for pinning to a specific version I would caution that some discussion is probably warranted regarding how it would work. For example, there is prior art in other projects, including Go, to consider. There is also the question of having epm automatically pick the appropriate version of a Elvish module based on the current Elvish version. And what does that mean if someone (like me) is always running a bleeding edge development version? How much of a burden do we want to impose on Elvish module publishers to tag their releases and what form should that take? Perhaps we want to to keep things simple initially by always having epm fetch the latest commit of a module unless the user explicitly specifies a commit ID. What are the implications for a more sophisticated approach implemented in the future? Where is the commit ID stored so subsequent epm:upgrade commands do not inadvertently upgrade a pinned module version? And probably a lot of other questions I haven't thought of.