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

Drop dependency on 'which' crate #295

Merged
merged 1 commit into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rustler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ rustler_sys = { path = "../rustler_sys", version = "~2.0" }

[build-dependencies]
lazy_static = "1.4"
which = "3"

[package.metadata.release]

Expand Down
6 changes: 1 addition & 5 deletions rustler/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use std::process::Command;
extern crate lazy_static;
use lazy_static::lazy_static;

extern crate which;
use which::which;

lazy_static! {
// keep this sorted by version number
static ref NIF_VERSION: Vec<&'static str> = vec![
Expand All @@ -24,14 +21,13 @@ fn main() {
}

fn get_version_from_erl() -> Option<String> {
let erl = which("erl").ok()?;
let args = vec![
"-noshell",
"-eval",
r#"io:format("~s~n", [erlang:system_info(nif_version)]), init:stop()."#,
];

let version = Command::new(erl).args(&args).output().ok()?.stdout;
let version = Command::new("erl").args(&args).output().ok()?.stdout;

let version = String::from_utf8(version).ok()?;

Expand Down