asdf-vm / asdf-elixir Goto Github PK
View Code? Open in Web Editor NEWElixir plugin for asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
Elixir plugin for asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
MacOS 10.13
Erlang ref-maint
1) test compile gets correct line number for UndefinedFunctionError (Kernel.ParallelCompilerTest)
test/elixir/kernel/parallel_compiler_test.exs:119
** (File.Error) could not write to file "/Users/erik/.asdf/installs/elixir/ref-master/lib/elixir/tmp/undef_error.ex": no such file or directory
code: File.write!(file, """
stacktrace:
(elixir) lib/file.ex:830: File.write!/3
test/elixir/kernel/parallel_compiler_test.exs:121: (test)
....
2) test compile does not use incorrect line number when error originates in another file (Kernel.ParallelCompilerTest)
test/elixir/kernel/parallel_compiler_test.exs:94
** (File.Error) could not write to file "/Users/erik/.asdf/installs/elixir/ref-master/lib/elixir/tmp/error_line_a.ex": no such file or directory
code: File.write!(file_a, """
stacktrace:
(elixir) lib/file.ex:830: File.write!/3
test/elixir/kernel/parallel_compiler_test.exs:96: (test)
Hello! I'm getting this error when I try and install the latest release.
louis ~ $ asdf install elixir 1.6.0
/tmp/elixir_build_QiDXpg/elixir-precompiled-1.6.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 243 0 243 0 0 283 0 --:--:-- --:--:-- --:--:-- 283
[/tmp/elixir_build_QiDXpg/elixir-precompiled-1.6.0.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/elixir_build_QiDXpg/elixir-precompiled-1.6.0.zip or
/tmp/elixir_build_QiDXpg/elixir-precompiled-1.6.0.zip.zip, and cannot find /tmp/elixir_build_QiDXpg/elixir-precompiled-1.6.0.zip.ZIP, period.
When attempting to install Elixir 1.3.0 using the ASDF package manager (with the asdf-elixir plugin), I get the following error:
asdf install elixir 1.3.0
/tmp/tmp.jhDRGP3Gto/elixir-precompiled-1.3.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21 0 21 0 0 36 0 --:--:-- --:--:-- --:--:-- 36
[/tmp/tmp.jhDRGP3Gto/elixir-precompiled-1.3.0.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/tmp.jhDRGP3Gto/elixir-precompiled-1.3.0.zip or
/tmp/tmp.jhDRGP3Gto/elixir-precompiled-1.3.0.zip.zip, and cannot find /tmp/tmp.jhDRGP3Gto/elixir-precompiled-1.3.0.zip.ZIP, period.
I just installed asdf on a Digital Ocean VM :
alg@ubuntu:~$ asdf install elixir 1.4.2
/tmp/elixir_build_ROrVTi/elixir-precompiled-1.4.2.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 591 0 591 0 0 1492 0 --:--:-- --:--:-- --:--:-- 1496
100 3693k 100 3693k 0 0 3782k 0 --:--:-- --:--:-- --:--:-- 9007k
alg@ubuntu:~$ asdf global elixir 1.4.2
alg@ubuntu:~$ iex
/home/alg/.asdf/installs/elixir/1.4.2/bin/elixir: 126: exec: erl: not found
alg@ubuntu:~$
I don't mind also installing Erlang but I wonder if this should be something that the Elixir plugin does by itself.
I can install Elixir from source like so with no issue: asdf install elixir ref:v1.8.1
. However, when I try to install it from source with a specific OTP version, I get an error:
$asdf install elixir ref:v1.8.1-otp-21
=> Checking whether specified Elixir release/reference exists...
==> Downloading v1.8.1-otp-21 to /tmp/elixir_build_W70U1J/elixir-ref-v1.8.1-otp-21-src.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 133 0 133 0 0 636 0 --:--:-- --:--:-- --:--:-- 633
100 15 100 15 0 0 7 0 0:00:02 0:00:01 0:00:01 90
==> Making the release
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
I already have OTP 21 installed via ASDF, so maybe I am misunderstanding compiling Elixir with the right OTP version and I don't need to specify that when compiling from source since it will use the OTP version I have installed but I am not sure about that. I assume I would have to specify the OTP version in the install command since it can download a file with the Elixir source for that specific OTP version.
Please correct me if I'm doing something wrong here. Thanks for all of your work on this great plugin!
Release 1.10.0 is out, but asdf install elixir 1.10.0
cannot install this release while asdf install elixir 1.10
can.
Hello!
I've a project that depends on Elixir features that are not released.
Is there a recommended way for managing a manually installed Elixir version alongside the asdf installed versions?
Cheers,
Louis
I have Elixir master branch compiled in directory /Users/james/src/elixir
. It fails with error asdf: No version set for command mix
.
$ asdf local elixir path:/Users/james/src/elixir
$ asdf current
elixir path:/Users/james/src/elixir (set by /Users/james/src/elixir_formatter_playground/.tool-versions)
$ mix
asdf: No version set for command mix
you might want to add one of the following in your .tool-versions file:
elixir 1.9.4-otp-22
$ asdf list elixir
1.9.4-otp-22
asdf version: 0.7.5
asdf-elixir git-hash: fa76a36
If I set as default Elixir version system
like this:
$ cat ~/.tool-versions
elixir system
erlang system
When I try to execute mix deps.get
command I get this error
$ mix deps.get
Could not find Hex, which is needed to build dependency :poison
Shall I install Hex? (if running non-interactively, use: "mix local.hex --force") [Yn] Y
** (File.Error) could not make directory (with -p) "/.mix/archives/hex-0.17.1": no such file or directory
(elixir) lib/file.ex:208: File.mkdir_p!/1
(mix) lib/mix/tasks/archive.install.ex:91: Mix.Tasks.Archive.Install.install/3
(mix) lib/mix/local/installer.ex:107: Mix.Local.Installer.do_install/3
(mix) lib/mix/dep/loader.ex:143: Mix.Dep.Loader.with_scm_and_app/4
(mix) lib/mix/dep/loader.ex:99: Mix.Dep.Loader.to_dep/3
(elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
(mix) lib/mix/dep/loader.ex:302: Mix.Dep.Loader.mix_children/1
(mix) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/0
See PR #38
❯ iex
Erlang/OTP 20 [erts-9.1.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.5.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> open URI.encode_query
Could not open: "/usr/local/Cellar/asdf/0.4.0/installs/elixir/1.5.3/bin/../lib/elixir/lib/uri.ex". File is not available.
There is no lib folder under /usr/local/Cellar/asdf/0.4.0/installs/elixir/1.5.3/lib/elixir
.
Precompiled packages are not providing lib directory.
We have a parallel build process for some of our umbrella applications, and install hex into the build folder for each job. This works well when using esl-erlang and elixir packages from RPMs.
When using asdf sourced erlang and elixir, the following command gives unexpected results:
> MIX_HOME=/home/vagrant/build/my_project/.mix mix local.hex --force
I would expect the result to be the following (the result of RPM-sourced elixir):
* creating /home/vagrant/build/my_project/.mix/archives/hex-0.16.1
However, this is the result when using asdf sourced elixir:
* creating .asdf/installs/elixir/1.4.2/.mix/archives/hex-0.16.1
Please bear with me as I'm only starting to use asdf-elixir
!
The readme states that:
Elixir requires Erlang to be installed. You can use the asdf-erlang plugin to install Erlang versions.
and later:
Be sure to also install the corresponding Erlang/OTP version with asdf-erlang, and to have both selected versions in your .tool-versions file.
I found the installation of Erlang to be very long (presumably from source) though, and I realised that for some reason, if I remove all traces of Erlang on my machine (such as previously installed with brew
, but also installed with asdf-erlang
), asdf-elixir
will install Elixir just fine.
With that version of Elixir, I'm perfectly able to run mix tests
or run my server.
This made me wonder: why is Erlang required, if that's the case? Are there specific things that will break later? Or am I in a situation where Erlang isn't truly required (or just bundled with Elixir, since I understand precompiled binaries bundle Erlang/OTP)?
Thanks for your highlights. Happy to update the readme with whatever I will have learned in the process.
I installed the ExDoc
escript for my project:
$ mix escript.install hex ex_doc
Resolving Hex dependencies...
Dependency resolution completed:
New:
earmark 1.4.3
ex_doc 0.21.3
makeup 1.0.0
makeup_elixir 0.14.0
nimble_parsec 0.5.3
* Getting ex_doc (Hex package)
* Getting earmark (Hex package)
* Getting makeup_elixir (Hex package)
* Getting makeup (Hex package)
* Getting nimble_parsec (Hex package)
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
earmark 1.4.3
makeup 1.0.0
makeup_elixir 0.14.0
nimble_parsec 0.5.3
All dependencies are up to date
==> nimble_parsec
Compiling 4 files (.ex)
Generated nimble_parsec app
==> makeup
Compiling 45 files (.ex)
Generated makeup app
==> earmark
Compiling 1 file (.yrl)
Compiling 2 files (.xrl)
Compiling 3 files (.erl)
Compiling 32 files (.ex)
Generated earmark app
==> makeup_elixir
Compiling 4 files (.ex)
Generated makeup_elixir app
==> ex_doc
Compiling 20 files (.ex)
Generated ex_doc app
Generated escript ex_doc with MIX_ENV=prod
Are you sure you want to install "ex_doc"? [Yn]
* creating /Users/kenny/.asdf/installs/elixir/1.8.0/.mix/escripts/ex_doc
warning: you must append "/Users/kenny/.asdf/installs/elixir/1.8.0/.mix/escripts" to your PATH if you want to invoke escripts by name
I saw the 'escripts support' section in the README but that didn't seem to help:
$ mix escript
* ex_doc
Escripts installed at: /Users/kenny/.asdf/installs/elixir/1.8.0/.mix/escripts
$ ~/.mix/escripts/ex_doc
-bash: /Users/kenny/.mix/escripts/ex_doc: No such file or directory
$ asdf reshim elixir
~/.mix/escripts/ex_doc
-bash: /Users/kenny/.mix/escripts/ex_doc: No such file or directory
$ ls -a ~/
# There's no `.mix` sub-directory in my home directory.
$ asdf reshim elixir 1.8.0
$ !515
$ ~/.mix/escripts/ex_doc
-bash: /Users/kenny/.mix/escripts/ex_doc: No such file or directory
I'm using Bash in the standard macOS Terminal app. Both closing my shell tab and opening a new Terminal window didn't fix this either. Quitting and restarting Terminal didn't help either.
Am I missing something? Is my asdf
Elixir plugin configuration corrupted or incomplete (as suggested by the lack of a ~/.mix
directory on my computer)?
Sorry if this is already solved...
I got this message after installing ex_doc with mix:
warning: you must append "/Users/sylph01/.asdf/installs/elixir/1.5.1/.mix/escripts" to your PATH if you want to invoke escripts by name
PATH
environment variable?asdf install elixir 1.11.3-otp-23
> mix
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
Crash dump is being written to: erl_crash.dump...done
> asdf which mix
/Users/Dylan/.asdf/installs/elixir/1.11.3-otp-23/bin/mix
Dylan@Dylans-Work-MacBook-Pro:~/Desktop/crap
> which mix
/Users/Dylan/.asdf/shims/mix
This does not happen on 1.11.3
and 1.11.3-otp-22
:
Dylan@Dylans-Work-MacBook-Pro:(upgrade/absinthe-to-1.5)~/Development/solve/solvedata/solve/api/src
> asdf shell elixir 1.11.3-otp-23
Dylan@Dylans-Work-MacBook-Pro:(upgrade/absinthe-to-1.5)~/Development/solve/solvedata/solve/api/src
> mix
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
Crash dump is being written to: erl_crash.dump...done
Dylan@Dylans-Work-MacBook-Pro:(upgrade/absinthe-to-1.5)~/Development/solve/solvedata/solve/api/src
> asdf shell elixir 1.11.3-otp-22
Dylan@Dylans-Work-MacBook-Pro:(upgrade/absinthe-to-1.5)~/Development/solve/solvedata/solve/api/src
> mix
Could not find Hex, which is needed to build dependency :credo
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] ^C
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
Am using mac os 11.1
Right now a precompiled package is used when possible. This is great for the speed of building Elixir but has some other issues.
The most significant one is related to changes in OTP 20. OTP 20 changed the format of debug information. This allows features like Exception.blame
to work. That said, Elixir supports OTP versions since 18, so the precompiled package is always compiled on the lowest supported version for compatibility. Unfortunately, this means, even when users have OTP 20, they will use code compiled on OTP 18 and won't get things like Exception.blame
for modules from the standard library.
Always compiling Elixir from source should solve this issue. It shouldn't also be a big issue timewise, given asdf already compiles Erlang from source. Compiling Elixir is almost instantaneous compared to that.
It might be possible we'll get precompiled Elixir for each OTP version, but always compiling from source should be a more future-proof solution.
$ asdf install elixir 1.4.2
/var/folders/h_/6v1myq556nd58yrl567k7gjh0000gn/T//elixir-precompiled-1.4.2.zip
** Resuming transfer from byte position 3796516
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
This error occurs in any version of the elixir. I already installed erlang, node and postgres without problem.
I have installed version 1.4.5 with otp 18 and it seems that I am still using the latest version of otp.
$ asdf local elixir 1.4.5-otp-18
$ mix -v
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Mix 1.4.5
It seems that OTP 20 is loaded instead of 18.
Looks like there is an extra / in the tempfile path.
$ asdf install elixir 1.3
/var/folders/hn/2gyswljs27179p4ddtdvrqkc0000gn/T//elixir-precompiled-1.3.zip
** Resuming transfer from byte position 21
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
[/var/folders/hn/2gyswljs27179p4ddtdvrqkc0000gn/T//elixir-precompiled-1.3.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /var/folders/hn/2gyswljs27179p4ddtdvrqkc0000gn/T//elixir-precompiled-1.3.zip or
/var/folders/hn/2gyswljs27179p4ddtdvrqkc0000gn/T//elixir-precompiled-1.3.zip.zip, and cannot find /var/folders/hn/2gyswljs27179p4ddtdvrqkc0000gn/T//elixir-precompiled-1.3.zip.ZIP, period.
Exenv is a fork of rbenv for elixir which gets used quite a lot in my company. I opened a PR #25 to add support for its .exenv_version
file if legacy_version_file = yes
is present in ~/.asdfrc
I was trying to start a phoenix server with phx.server
or just mix deps.get
but I received error messages from asdf:
$ mix deps.get
Unknown command: `asdf exec elixir /Users/yoonwaiyan/.asdf/shims/mix deps.get`
/usr/local/bin/asdf: line 82: /Users/yoonwaiyan/.asdf/lib/commands/command-help.bash: No such file or directory
Please help.
I'm using Homebrew to manage my asdf and the current version of my asdf is the latest version available:
$ brew info asdf 127 ↵
asdf: stable 0.8.0 (bottled), HEAD
Extendable version manager with support for Ruby, Node.js, Erlang & more
https://asdf-vm.com/
Conflicts with:
homeshick (because asdf and homeshick both install files in lib/commands)
/usr/local/Cellar/asdf/0.8.0_1 (116 files, 243.9KB) *
Poured from bottle on 2021-05-18 at 10:50:59
I'd like to use tools like elixir-ls for my editor, but they rely on the language being compiled from source on the machine.
Since asdf-erlang compiles from source with kerl, I can use elixir-ls to go to the source code of an Erlang symbol. Since asdf-elixir provides precompiled versions only, as far as I know, I can't use it to go to the source code of the Elixir stdlib.
Thanks.
Greetings,
I'm trying to install elixir 1.9 with a specific (well, greater than) version of OTP. OTP-22 is not enough, due to a bug in Erlang 22.0.4 dialyxir fails, unless OTP is 22.0.5 (or greater)
Is there any solution to this?
The current Livebook instructions say that if you're using asdf you need to run asdf reshim elixir
after installing livebook as an escript:
Running Livebook using Escript makes for a very convenient option
for local usage and provides easy configuration via CLI options.mix escript.install hex livebook # Start the Livebook server livebook server # See all the configuration options livebook server --helpAfter you install the escript, make sure you add the directory where
Elixir keeps escripts to your $PATH.
If you installed Elixir withasdf
, you'll need to runasdf reshim elixir
once the escript is built.
Is it possible for asdf-elixir to detect that asdf escript.install
has successfully installed an escript and then automatically reshim? If not that's fine, just figured I'd ask to remove a potential stumbling block. Escripts are always executable binaries so reshiming makes sense (to me). We'd probably have to do it when uninstalling an escript as well.
asdf list-all elixir
also lists 1.3.0
because our version parsing is buggy.
$ asdf list-all elixir
1.3.0
1.2.5
1.2.4
...
Thanks to @Qqwy for reporting this bug.
More details here - #12 (comment)
Steps to reproduce:
asdf install elixir 1.9
and asdf global elixir 1.9
mix deps.get
The command will run continuously. It happens for the following reasons:
mix
at ~/.asdf/plugins/elixir/shims/mix
lacks executable permission. This causes the shell to default to the next available executable, which is the wrapper shim (and the cycle repeats)$PATH
environment (when running the elixir
shim at ~/.asdf/shims/elixir
) is the full OTP version, i.e. 1.9.4-otp-22
. As a result, ~/.asdf/installs/1.9/bin/elixir
isn't in $PATH
and the shell defaults to the next available executable, which is the shim, and the cycle repeats.The latter of these was discovered by making the mix
script in this plugin executable.
after installing elixir 1.7.4 i get erlang error messages
asdf install elixir 1.7.4
asdf local elixir 1.7.4
elixir -v
gives me
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
asdf local elixir 1.7.3
and it works happily as before
Hello! I've seen some unexpected behavior from the elixir
binary that comes with the 1.3.4 distribution. The below issue has a complete description of the problem:
The issue was resolved when I switched to the binary from the elixir repository.
Example .tool-versions
contents:
erlang 22.1
elixir 1.9.4-otp-22
We're seeing reproduce-able failures in a project where Elixir previously installed successfully by running:
asdf uninstall elixir 1.9.4-otp-22
asdf plugin-update elixir
asdf install
Locally the failures look like:
erlang 22.1 is already installed
==> Checking whether specified Elixir release exists...
==> Downloading 1.9.4-otp-22 to /var/folders/8t/bcy9yfg90c56_4m_36wmtyrm0000gp/T//elixir-precompiled-1.9.4-otp-22.zip
** Resuming transfer from byte position 5274462
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
==> Copying release into place
asdf: No version set for command elixir
you might want to add one of the following in your .tool-versions file:
elixir 1.6.1
elixir 1.6.5
elixir 1.6.6
elixir 1.7.3
elixir 1.7.4-otp-21
elixir v1.6.1
elixir v1.7.4
elixir 1.7.3-otp-21
elixir 1.9.1
elixir 1.8
asdf: No version set for command elixir
you might want to add one of the following in your .tool-versions file:
elixir 1.6.1
elixir 1.6.5
elixir 1.6.6
elixir 1.7.3
elixir 1.7.4-otp-21
elixir v1.6.1
elixir v1.7.4
elixir 1.7.3-otp-21
elixir 1.9.1
elixir 1.8
And on CircleCI:
==> Copying release into place
/usr/bin/env: 'elixir': No such file or directory
/usr/bin/env: 'elixir': No such file or directory
My current hunch is that this relates to the double mix
lines here, as it would explain the duplicate error messages: e7e9e5d#diff-81fd2adb13518cfcf88c004b912c4d9fR22
I built a custom copy of elixir
and I am trying to make it available with asdf
, but I get an error.
Did I misread the docs?
$ asdf global elixir path:/Users/mal/elixir/bin/elixir
version path:/Users/mal/elixir/bin/elixir is not installed for elixir
Yet everything else looks right:
$ /Users/mal/elixir/bin/elixir --version
Erlang/OTP 23 [erts-11.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]
Elixir 1.13.0-dev (fb92f7a) (compiled with Erlang/OTP 23)
$ asdf --version
v0.8.0
$ asdf plugin list elixir --urls --refs
elixir https://github.com/asdf-vm/asdf-elixir.git master e6e9a9e
erlang https://github.com/asdf-vm/asdf-erlang.git master f850959
When I used the pre-built versions of Elixir, I have problems running dialyzer:
:dialyzer.run error: Analysis failed with error:
Could not scan the following file(s):
Could not get Core Erlang code for: /Users/hazen/.asdf/installs/elixir/1.7.3/lib/elixir/ebin/elixir_parser.beam
Recompile with +debug_info or analyze starting from source code Could not get Core Erlang code for: /Users/hazen/.asdf/installs/elixir/1.7.3/lib/elixir/ebin/elixir_utils.beam
It looks like I need to build with the +debug_info
flag, but when I look at the source it's not clear what the mechanism is to do that. Is there simply a flag I can pass in?
In addition to the .exenv-version
file, asdf-elixir should also be able to read the Elixir version out of a mix.exs
file in the current directory.
See this related issue for kiex: taylor/kiex#54
Hello! Thanks for the hard work!
I have a question about the statement in the readme file about the behavior when no otp version is specified. The docs say:
The precompiled packages are built against every officially supported OTP version, however if you only specify the elixir version, like 1.4.5, the downloaded binaries will be those compiled against the oldest OTP release supported by that version.
However when testing with a .tool-versions
file that looks like this
erlang 22.1
elixir 1.9.1
I installed using asdf install
.
Running System.otp_release
gives me "22"
from iex where I would expect to see "20" based on the compatibility chart you link and the wording of the explanation.
I know it's possible I'm misinterpreting something - but I'd like to check my understanding. Happy to submit a PR to update the docs for clarity once I understand what I'm missing.
Thank you
Javier
Manjaro linux
Fish shell
After instaling erlang with asdf
asdf install elixir 1.7.3
1 :( 10/17/18 - 2:17
/tmp/elixir_build_9BG4H2/elixir-precompiled-1.7.3.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5229k 100 5229k 0 0 6094k 0 --:--:-- --:--:-- --:--:-- 6087k
ERROR: unzip not found
macOS 10.14.4
erlang 21.3.4
elixir 1.8.1
I'm using spacemacs with the elixir package installed.
Running elixir-format emacs command from emacs-elixir will format the current file and on save hook will also format the file.
Running elixir-format hook in emacs-elixir results in the following error message being displayed:
** (SyntaxError) /Users/josiah/.asdf/shims/mix:3: syntax error before: '.'
(elixir) lib/code.ex:767: Code.require_file/2
The on save hook fails silently.
This problem only seems to crop up when elixir is installed with asdf, when I had elixir installed with brew I had no problems.
Any help pointing me in the right direction is much appreciated :)
Apologies if this is just a mis-use of the tool. But I tried to install asdf plugin-update elixir && asdf install elixir 1.7.4-otp-21
tonight and I ended up getting an error message of:
mmmries-pro:spiff_ex$ asdf install elixir 1.7.4-otp-21
/var/folders/fv/30kptkyd47z4n7mfr9mk_kbc0000gn/T//elixir-precompiled-1.7.4-otp-21.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 243 100 243 0 0 556 0 --:--:-- --:--:-- --:--:-- 556
[/var/folders/fv/30kptkyd47z4n7mfr9mk_kbc0000gn/T//elixir-precompiled-1.7.4-otp-21.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /var/folders/fv/30kptkyd47z4n7mfr9mk_kbc0000gn/T//elixir-precompiled-1.7.4-otp-21.zip or
/var/folders/fv/30kptkyd47z4n7mfr9mk_kbc0000gn/T//elixir-precompiled-1.7.4-otp-21.zip.zip, and cannot find /var/folders/fv/30kptkyd47z4n7mfr9mk_kbc0000gn/T//elixir-precompiled-1.7.4-otp-21.zip.ZIP, period.
If I look at that zip file it's contents are actually plain text XML.
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>FF7CC409363175C5</RequestId><HostId>Ntd7o98IRMWy0sa7B3G4Qr5bxRmsZZJJO2b1m/ESHcRDrGmn4dpRUx/h832qXAOuh6chieBFZzY=</HostId></Error>
Maybe the precompiled versions for other OTP releases haven't been uploaded yet?
I can't seem to install elixir 1.5.1 with OTP 20.1 -
asdf install elixir 1.5.1-otp-20.1
/var/folders/3w/_r0kg92d567_gggr064_wjyh0000gn/T//elixir-precompiled-1.5.1-otp-20.1.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 243 0 243 0 0 519 0 --:--:-- --:--:-- --:--:-- 520
[/var/folders/3w/_r0kg92d567_gggr064_wjyh0000gn/T//elixir-precompiled-1.5.1-otp-20.1.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /var/folders/3w/_r0kg92d567_gggr064_wjyh0000gn/T//elixir-precompiled-1.5.1-otp-20.1.zip or
/var/folders/3w/_r0kg92d567_gggr064_wjyh0000gn/T//elixir-precompiled-1.5.1-otp-20.1.zip.zip, and cannot find /var/folders/3w/_r0kg92d567_gggr064_wjyh0000gn/T//elixir-precompiled-1.5.1-otp-20.1.zip.ZIP, period.
Hi again :)
I can't seem to install elixir ref:v1.12.1 because of a broken curl command that doesn't follow redirects (it seems github hosts the archive on a new domain or something):
# this line doesn't have the -L flag
http_status=$(curl -I -w %{http_code} -s -o /dev/null $download_url)
I didn't investigate it further at this point though, so it may be something else. If I have the time, I will try to create a PR later this week.
Hey,
sort
's -V
option is not available on OSX, and thus our current sort is not as good as it should be. The problem is more evident when using asdf plugin-test
as it will try to install the latest version produced by list-all
.
Shall we recommend other plugin authors to use that sort_version
I shamefully borrowed from rbenv ? It's working perfectly for my asdf-idris plugin.
Running asdf install elixir 1.5.0
gives me the following output:
$ asdf install elixir 1.5.0
/var/folders/3_/2y35bqs91_18dg41g9c_dyv40000gp/T//elixir-precompiled-1.5.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4016k 100 4016k 0 0 33.3M 0 --:--:-- --:--:-- --:--:-- 33.5M
But then:
$ iex
elixir 1.5 not installed
When building anything that depends on an erlang library, mix uses rebar (most of the time). It would be incredibly useful to have rebar and rebar3 in the shims folder for debugging failing builds.
$ asdf install elixir 1.2.3-otp-18
$ asdf local elixir 1.2.3-otp-18
$ elixir -v
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
=INFO REPORT==== 20-Apr-2018::13:17:59 ===
application: logger
exited: {{shutdown,
{failed_to_start_child,'Elixir.GenEvent',
{undef,
[{gen,debug_options,[[]],[]},
{'Elixir.GenEvent',init_it,6,
[{file,"lib/gen_event.ex"},{line,653}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,247}]}]}}},
{'Elixir.Logger.App',start,[normal,[]]}}
type: temporary
{"init terminating in do_boot",{{badmatch,error},[{'Elixir.Kernel.CLI',parse_shared,2,[{file,"lib/kernel/cli.ex"},{line,153}]},{'Elixir.Kernel.CLI','shared_option?',3,[{file,"lib/kernel/cli.ex"},{line,113}]},{'Elixir.Kernel.CLI',main,1,[{file,"lib/kernel/cli.ex"},{line,14}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({{badmatch,error},[{Elixir.Kernel.CLI,parse_shared,2,[{_},{_}]},{Elixir.Kernel.CLI,shared_option?,3,[{_},{_}]},{Elixir.Kernel.CLI,main,1,[{_},{_}]},{init,start_em,1,[]},{i
Crash dump is being written to: erl_crash.dump...done
I was wondering if there's a recommended way to automatically update PATH with the escripts directory of the current elixir version.
Right now, I'm manually adding .asdf/installs/elixir/1.3.0-rc.1/.mix/escripts
to my PATH, but it would be really cool if that happened automatically when switching versions.
Also, asdf rocks. Great work!
I am using asdf-elixir and was playing around with various settings. I discovered that when I use an otp-21 build, I get a failure. Here are my steps:
asdf install elixir 1.7-otp-21
asdf install elixir 1.7-otp-20
➜ okr_app git:(master) ✗ asdf local elixir 1.7-otp-20 && iex
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
vs
➜ okr_app git:(master) ✗ asdf local elixir 1.7-otp-21 && iex
2018-10-17 01:01:26 Loading of ~ts failed: ~p
"/Users/stephenbussey/.asdf/installs/elixir/1.7-otp-21/bin/../lib/iex/ebin/Elixir.IEx.CLI.beam"
badfile
2018-10-17 01:01:26 ~s~n
"beam/beam_load.c(1862): Error loading module 'Elixir.IEx.CLI':\n This BEAM file was compiled for a later version of the run-time system than 20.\n To fix this, please recompile this module with an 20 compiler.\n (Use of opcode 162; this emulator supports only up to 159.)\n"
2018-10-17 01:01:26 crash_report
initial_call: {supervisor_bridge,user_sup,['Argument__1']}
pid: <0.50.0>
registered_name: []
error_info: {error,undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [kernel_sup,<0.36.0>]
message_queue_len: 0
messages: []
links: [<0.37.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 1598
stack_size: 27
reductions: 189
2018-10-17 01:01:26 supervisor_report
supervisor: {local,kernel_sup}
errorContext: start_error
reason: {undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
offender: [{pid,undefined},{id,user},{mfargs,{user_sup,start,[]}},{restart_type,temporary},{shutdown,2000},{child_type,supervisor}]
2018-10-17 01:01:26 crash_report
initial_call: {application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}
pid: <0.35.0>
registered_name: []
error_info: {exit,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [<0.34.0>]
message_queue_len: 1
messages: [{'EXIT',<0.36.0>,normal}]
links: [<0.34.0>,<0.33.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 27
reductions: 243
2018-10-17 01:01:26 std_info
application: kernel
exited: {{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}}},{kernel,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,\"user_sup.erl\"},{line,100}]},{user_sup,init,1,[{file,\"user_sup.erl\"},{line,49}]},{supervisor_bridge,init,1,[{file,\"supervisor_bridge.erl\"},{line,80}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,365}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.
Is there any knowledge on how to avoid this?
The current README contains a typo and some phrases that could be better:
In the subtitle "Check compatability elixir and erlang":
In the "Elixir escripts support" section, the part "This plugin supports elixir escripts adding them to your path just like any other elixir binary." is confusing (took me some time to understand), I think a comma should be added: "This plugin supports elixir escripts , adding them to your path just like any other elixir binary."
I probably worked for a year forgetting that the Elixir version I downloaded is precompiled with a version OTP independent of the erlang version I might have also supplied in my tool-versions file. If I knew that these other Elixir versions existed (via list-all
), I would have chosen the elixir version with the latest OTP version instead of the oldest compatible.
ie,
elixir 1.7.2
erlang 21.0.7
downloads Elixir/OTP 19, and Erlang/OTP 21.
Instead, I should do this:
elixir 1.7.2-otp-21
erlang 21.0.7
downloads Elixir/OTP 21, and Erlang/OTP 21.
But list-all
doesn't show these -otp-*
Elixir versions.
I know it's in the README, but I must've missed it when I first started using the plugin.
Looking at the source, I see that list-all
is fetching the git tags from the Elixir GitHub repo, but downloading the version fetches from hex.pm. Is there a way we can list-all and download from hex.pm?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.