Skip to content
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 elixir.bat to erl.exe with arguments to workaround mix quoting bug on Windows #789

Merged
merged 2 commits into from Aug 12, 2017

Conversation

KronicDeth
Copy link
Owner

Fixes #603

Changelog

Enhancements

  • Format MixRunningStateUtil and fix warnings.

Bug Fixes

  • elixir.bat in at least Elixir 1.5.1, will not properly parse a mix path with spaces in it on Windows even when the path has outer quotes (see elixir.bat can't use quoted mix path as argument elixir-lang/elixir#6455). It is not possible to use inner quotes, as you can do in cmd.exe, using the JetBrains and Java libraries hat auto-matically quote, so instead bypass the bad quoting in elixir.bat by doing what elixir.bat does: call erl.exe with all the SDK ebin paths added with -pa, then -noshell -s elixir start_cli to run Elixir and-extra to run requires (-r), mix and its tasks.

Fixes #603
See also elixir-lang/elixir#6455.

`elixir.bat` in at least Elixir 1.5.1, will not properly parse a mix
path with spaces in it on Windows even when the path has outer quotes.
It is not possible to use inner quotes, as you can do in cmd.exe, using
the JetBrains and Java libraries hat auto-matically quote, so instead
bypass the bad quoting in `elixir.bat` by doing what `elixir.bat` does:
call `erl.exe` with all the SDK ebin paths added with `-pa`, then
`-noshell -s elixir start_cli` to run Elixir and -extra to run requires
(`-r`), mix and it's task.
@KronicDeth KronicDeth added this to the v6.0.0 milestone Aug 12, 2017
@KronicDeth KronicDeth self-assigned this Aug 12, 2017
@KronicDeth KronicDeth merged commit 8933d32 into master Aug 12, 2017
@KronicDeth KronicDeth deleted the 603 branch August 12, 2017 23:57
KronicDeth added a commit that referenced this pull request Aug 13, 2017
KronicDeth added a commit that referenced this pull request Sep 10, 2017
Elixir SDK will now have an Internal Erlang SDK, which can be supplied
one of two ways:

1. If `intellij-erlang` is installed: its Erlang SDK can be used
2. Otherwise: the Erlang SDK for Elixir SDK from this plugin can be used

Either Internal Erlang SDK's home path is used to locate the `erl` (or
`erl.exe` on Windows) executable and it is used to run Elixir; bypassing
the `elixir` (or `elixir.bat` on Windows) script.  Instead, as was done
in #789, the ebin directories for the Elixir SDK are passed as `-pa`
options to `erl`.

The Elixir SDK's configuration becomes more important: the classpath
entries are now the list of `ebin` directories to pass to `erl` using
`-pa` instead of scanning for ebins in the homepath, so additional code
paths can be added to the Classpaths configuration and they will be used
when running `mix` and `mix test`.  The classpaths will be initialized
to the ebin directories under the home path.
@KronicDeth KronicDeth mentioned this pull request Sep 10, 2017
KronicDeth added a commit that referenced this pull request Sep 10, 2017
Elixir SDK will now have an Internal Erlang SDK, which can be supplied
one of two ways:

1. If `intellij-erlang` is installed: its Erlang SDK can be used
2. Otherwise: the Erlang SDK for Elixir SDK from this plugin can be used

Either Internal Erlang SDK's home path is used to locate the `erl` (or
`erl.exe` on Windows) executable and it is used to run Elixir; bypassing
the `elixir` (or `elixir.bat` on Windows) script.  Instead, as was done
in #789, the ebin directories for the Elixir SDK are passed as `-pa`
options to `erl`.

The Elixir SDK's configuration becomes more important: the classpath
entries are now the list of `ebin` directories to pass to `erl` using
`-pa` instead of scanning for ebins in the homepath, so additional code
paths can be added to the Classpaths configuration and they will be used
when running `mix` and `mix test`.  The classpaths will be initialized
to the ebin directories under the home path.
KronicDeth added a commit that referenced this pull request Sep 10, 2017
Elixir SDK will now have an Internal Erlang SDK, which can be supplied
one of two ways:

1. If `intellij-erlang` is installed: its Erlang SDK can be used
2. Otherwise: the Erlang SDK for Elixir SDK from this plugin can be used

Either Internal Erlang SDK's home path is used to locate the `erl` (or
`erl.exe` on Windows) executable and it is used to run Elixir; bypassing
the `elixir` (or `elixir.bat` on Windows) script.  Instead, as was done
in #789, the ebin directories for the Elixir SDK are passed as `-pa`
options to `erl`.

The Elixir SDK's configuration becomes more important: the classpath
entries are now the list of `ebin` directories to pass to `erl` using
`-pa` instead of scanning for ebins in the homepath, so additional code
paths can be added to the Classpaths configuration and they will be used
when running `mix` and `mix test`.  The classpaths will be initialized
to the ebin directories under the home path.
KronicDeth added a commit that referenced this pull request Sep 10, 2017
Elixir SDK will now have an Internal Erlang SDK, which can be supplied
one of two ways:

1. If `intellij-erlang` is installed: its Erlang SDK can be used
2. Otherwise: the Erlang SDK for Elixir SDK from this plugin can be used

Either Internal Erlang SDK's home path is used to locate the `erl` (or
`erl.exe` on Windows) executable and it is used to run Elixir; bypassing
the `elixir` (or `elixir.bat` on Windows) script.  Instead, as was done
in #789, the ebin directories for the Elixir SDK are passed as `-pa`
options to `erl`.

The Elixir SDK's configuration becomes more important: the classpath
entries are now the list of `ebin` directories to pass to `erl` using
`-pa` instead of scanning for ebins in the homepath, so additional code
paths can be added to the Classpaths configuration and they will be used
when running `mix` and `mix test`.  The classpaths will be initialized
to the ebin directories under the home path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mix path is not quoted correctly on Windows
1 participant