-
Notifications
You must be signed in to change notification settings - Fork 70
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
Expand instructions for using custom-compiled elixir #63
Conversation
README.md
Outdated
|
||
``` | ||
ln -s /path/to/elixir ~/.asdf/installs/elixir/master | ||
asdf reshim elixir master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hack and is not the recommended way of doing things. You should instead use the path:<path>
version format to specify that you want to use your own version of Elixir https://asdf-vm.com/#/core-configuration?id=tool-versions Doing this will still allow you to checkout any version of Elixir and recompile on the fly without having to reconfigure asdf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed a hack but I don't think you have to reconfigure asdf if you change version or recompile elixir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, plus asdf local elixir master
is much cleaner than asdf local elixir path:/let/me/remember/the/path/to/my/elixir/repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With either approach (linking as shown here, or using the path:<path>
syntax in your .tool-versions
file) you will be free to checkout different refs and recompile Elixir without having to change anything else.
Manually altering anything inside your asdf data dir (~/.asdf/
) is not recommended. asdf is simple enough that it will recognize the master
directory if you create it, but it's ultimately hack. If you try to uninstall master
asdf will probably try to delete whatever you have in your /path/to/elixir
(I've not tried this, but I don't think we guard against this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheFirstAvenger you shouldn't need to run that command very often. Once you've got the version set for your project you shouldn't ever need to run that command again. If you find yourself needing to use that version in a lot of different projects, you can set that as the global version, or define an shell alias for that asdf local
command to make it easier to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also ref:master
, but I don't think that is what you want here - https://www.amberbit.com/blog/2017/10/30/trying-out-upcoming-elixir-releases/
@nathanl @TheFirstAvenger @ericmj Is there any reason why |
I wonder if adding the concept of local aliases to asdf would be the right route, i.e. |
@TheFirstAvenger generally if something can be done with the asdf API it should be done outside of asdf. So in the case of aliases, it is probably better to define shell aliases or functions to help with this. Something like:
|
I think there is an argument to be made that the My take is that it should be a supported feature to do I think there is also value in supporting I'd be happy to make the PR for the above, but I'd be interested to hear the arguments as to why it isn't desirable to do so first. If it is just a matter of not having time, that's understandable, and solvable; but if it's something fundamental, that would be good to know. |
Agreed with @bitwalker here. I won't type |
Ok, so a little history on the
@bitwalker the goal of asdf is to make version management simple, that usually results in it being fairly easy to use too, but being easy to use is a side affect of being simple and well designed.
It is fundamental.
The
@whatyouhide I must be misunderstanding you. You won't type @nathanl thanks for the PR. I'm going to merge all of your changes except for the part about |
I'm definitely aware of the correspondence between simple/easy, my point was that as a user, those qualities mean different things than they do as a maintainer. Specifically, with my user hat on the "ease" in which I can avoid using multiple tools to do one thing (version management), and the "simplicity" of something that doesn't use any magic, just simple OS primtives, are the reasons why I chose it.
I'm not convinced that it is as complex as you expect. Supporting options with
I will of course have to investigate to see if there are limitations here, but if that's the case, then if I need to maintain my own shell script to add this capability, I'm not opposed to that idea, but it does seem rather fundamental to Do you have suggestions for tools for alias management? The shell is plainly inadequate for this out of the box, as creating arbitrarily-long lived aliases and destroying them on the fly is not something you get for free.
I think there are two usage patterns, distinct from one another: First is the use you are talking about, where users are installing versions and saving It would be absolutely possible for the
Again, I think it is absolutely possible to deal with this edge case in a sane way, probably by warning when the
This is really the responsibility of the users managing aliases though, just like it would be if they implemented this functionality manually. The benefit of having it in
I use them very frequently when switching between builds with different things I'm testing. Granted, I'm a bit of a special case as a open source maintainer with a lot of projects with a large matrix of languages and versions to work across - but that is precisely why I use
He does that once, and then uses the alias from then onward, which is the point, he only needs to type the verbose command the one time. We can move this discussion to an issue if you'd like, perhaps it would be better to do that so that you can point other users there one way or the other. I don't want to pressure you on this, if you still aren't convinced, then I will find a solution one way or the other, but I had hoped we might find consensus of some kind. |
Thanks to @TheFirstAvenger and @bitwalker for explaining this to me