-
Notifications
You must be signed in to change notification settings - Fork 784
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
Plugin named erlang already added #66
Comments
That is strange. I have not experienced that issue. That error message you got from asdf is only printed when that directory (~/.asdf/plugins/erlang) already exists. Is there a way you can check if that directory exists? If it already exists then that is the problem. Even if the directory is empty asdf will still consider it a fully installed plugin. Also, in you script I see you extracting versions from the .tool-versions file and then installing them. You shouldn't need to do that. Try doing something like this (untested code):
Where |
Thanks for the reply. I'm currently caching Thanks for the .tool-versions tip.The file should already be in the current directory, so that should simplify things.
|
You could try not caching those directories, but that will slow your build down. Another disadvantage of caching is that you might be using an old version of the Erlang and Elixir plugins, though this may not be an issue, and could be a benefit if things change significantly. Assuming your fine with adding a second or two to your build time, I would probably not cache the plugin dirs and reinstall them for each build. |
Okay. But it still makes sense to cache |
I'm honestly not sure. I haven't ever used asdf for CI builds before. My guess is that's probably wise (if you upgrade Erlang/Elixir versions the installs would be in different directories so the caching shouldn't interfere). |
@asdf-vm/maintainers Any thoughts here? I haven't ever used asdf with caching like this. Do you guys see any pitfalls? |
That's okay. I'll probably just remove all caching of the asdf stuff for now and see how it goes. Thanks for your help. |
@nathany Thanks for the feedback! For now, could you just try something like this please?
@asdf-vm/maintainers Do you think it is better to exit with 0 or not when the plugin already existed? As it did not actually add the plugin, a non-zero code makes more sense to me. What do you think? |
Non-zero for skipped installs makes sense to me. |
@tuvistavie Thanks, I'll give it a try. Not caching the installs added 10 minutes to my test run. |
It's working well. Thanks everyone. |
@tuvistavie Non-zero exit for a plugin already installed is very appropriate. Also @kdisneur's has a blog post about using asdf on CircleCI - https://kevin.disneur.me/archives/2015-06-14-elixir-on-circleci.html |
I just sent a message to @kdisneur on Twitter to ask him if he could update his blog with the above check! https://twitter.com/tuvistavie/status/745473152101191681 |
Thanks @tuvistavie, I forgot to update the blog post when this change was released. Mistake fixed, should be all good now 👍 |
@kdisneur Thank you very much! 😄 |
Thanks @kdisneur. For comparison, this is my current machine:
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
dependencies:
cache_directories:
- ~/.asdf
- deps
- _build
override:
- if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi
- asdf plugin-list | grep -q erlang || asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git
- asdf plugin-list | grep -q elixir || asdf plugin-add elixir https://github.com/HashNuke/asdf-elixir.git
- asdf install
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix deps.compile
test:
override:
- MIX_ENV=test mix do compile --warnings-as-errors, test --include remote |
Hi. I've been using asdf for about 4 months now on CircleCI. Today it started giving me this error. Is there anything that changed in asdf that could have caused this, and any suggestions to work around it?
The code that I'm running looks like this (hasn't changed):
The directories that I'm caching also hasn't changed:
I did a clean rebuild (cleared the cache) last week. Not sure if that's related.
The text was updated successfully, but these errors were encountered: