Skip to content

Commit

Permalink
Allow specifying a channel for the system rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
jflatow committed Jul 31, 2021
1 parent c882c95 commit 7f4cf2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rustler_mix/lib/rustler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ defmodule Rustler do
## Configuration options
* `:cargo` - Specify how to envoke the rust compiler. Options are:
- `:system` (default) - use `cargo` from the system (must by in `$PATH`)
- `:system` (default) - use `cargo` from the system (must be in `$PATH`)
- `{:system, <channel>}` - use `cargo` from the system with the given channel
- `{:rustup, <version>}` - use `rustup` to specify which channel to use.
Available options include: `:stable`, `:beta`, `:nightly`, or a string
which specifies a specific version (i.e. `"1.39.0"`).
Expand Down
2 changes: 1 addition & 1 deletion rustler_mix/lib/rustler/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ defmodule Rustler.Compiler do
end

defp make_base_command(:system), do: ["cargo", "rustc"]
defp make_base_command({:system, channel}), do: ["cargo", channel, "rustc"]
defp make_base_command({:bin, path}), do: [path, "rustc"]

defp make_base_command({:rustup, version}) do
if Rustup.version() == :none do
throw_error(:rustup_not_installed)
Expand Down

0 comments on commit 7f4cf2f

Please sign in to comment.