Repository: rcoh/angle-grinder (language: rust)

Issue:
no longer builds on non-x86/arm architectures
since switching to rustls, this will no longer build on any architectures other than x86 and arm, since `ring` is not portable


Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 3436e90..41cda7a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -47,7 +47,6 @@ dependencies = [
  "regex",
  "self_update",
  "serde",
- "serde_derive",
  "serde_json",
  "strfmt",
  "strsim",
@@ -1752,6 +1751,9 @@ name = "serde"
 version = "1.0.114"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3"
+dependencies = [
+ "serde_derive",
+]
 
 [[package]]
 name = "serde_cbor"
diff --git a/Cargo.toml b/Cargo.toml
index 7fe3368..57710cd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,9 @@ extended-description = """Angle-grinder allows you to parse, aggregate, sum, ave
                         aggregation. The results will live update in your terminal as data is processed. \
                         Angle grinder is a bare bones functional programming language coupled with a pretty terminal UI."""
 
+[features]
+default = ["self_update"]
+
 [dependencies]
 jemallocator = "0.3.2"
 serde_json = "1.0.33"
@@ -32,7 +35,7 @@ ordered-float = "2.0"
 failure = "0.1.3"
 structopt = "0.2"
 human-panic = "1.0.1"
-self_update = { version = "0.19.0", features = ["rustls"], default_features = false }
+self_update = { version = "0.19.0", features = ["rustls"], default_features = false, optional = true }
 num-derive = "0.2.3"
 num-traits = "0.2.6"
 annotate-snippets = { version = "0.5.0", features = ["ansi_term"] }
@@ -43,8 +46,7 @@ logfmt = "0.0.2"
 strfmt = "0.1.6"
 include_dir = "0.2.1"
 toml = "0.4.10"
-serde = "1.0.82"
-serde_derive = "1.0.82"
+serde = { version = "1.0", features = ["derive"] }
 chrono = "0.4"
 dtparse = "1.1"
 
diff --git a/src/alias.rs b/src/alias.rs
index 44ef236..d8e338d 100644
--- a/src/alias.rs
+++ b/src/alias.rs
@@ -7,6 +7,7 @@
 use lazy_static::lazy_static;
 
 use include_dir::Dir;
+use serde::Deserialize;
 
 const ALIASES_DIR: Dir = include_dir!("aliases");
 
diff --git a/src/bin/agrind.rs b/src/bin/agrind.rs
index 7d49028..41ca90b 100644
--- a/src/bin/agrind.rs
+++ b/src/bin/agrind.rs
@@ -3,8 +3,9 @@ use annotate_snippets::snippet::Snippet;
 use atty::Stream;
 use human_panic::setup_panic;
 use quicli::prelude::*;
+
+#[cfg(feature = "self_update")]
 use self_update;
-use self_update::cargo_crate_version;
 use std::env;
 use std::fs::File;
 use std::io;
@@ -32,6 +33,7 @@ struct Cli {
     #[structopt(group = "main")]
     query: Option<String>,
 
+    #[cfg(feature = "self_update")]
     /// Update agrind to the latest published version Github (https://github.com/rcoh/angle-grinder)
     #[structopt(long = "self-update", group = "main")]
     update: bool,
@@ -93,6 +95,7 @@ impl ErrorReporter for TermErrorReporter {
 fn main() -> CliResult {
     setup_panic!();
     let args = Cli::from_args();
+    #[cfg(feature = "self_update")]
     if args.update {
         return update();
     }
@@ -147,17 +150,19 @@ fn parse_output(output_param: &str) -> Result<OutputMode, InvalidArgs> {
     }
 }
 
+#[cfg(feature = "self_update")]
 fn update() -> CliResult {
+    let crate_version = self_update::cargo_crate_version!();
     let status = self_update::backends::github::Update::configure()
         .repo_owner("rcoh")
         .repo_name("angle-grinder")
         .bin_name("agrind")
         .show_download_progress(true)
-        .current_version(cargo_crate_version!())
+        .current_version(crate_version)
         .build()?
         .update()?;
 
-    if cargo_crate_version!() == status.version() {
+    if crate_version == status.version() {
         println!(
             "Currently running the latest version publicly available ({}). No changes",
             status.version()
diff --git a/src/lib.rs b/src/lib.rs
index ab94f3a..fcf1bc6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,8 +2,6 @@
 extern crate failure;
 #[macro_use]
 extern crate include_dir;
-#[macro_use]
-extern crate serde_derive;
 extern crate atty;
 extern crate nom_locate;
 extern crate num_derive;


Test patch:
diff --git a/tests/integration.rs b/tests/integration.rs
index 038f443..fe6cbdf 100644
--- a/tests/integration.rs
+++ b/tests/integration.rs
@@ -5,7 +5,7 @@ extern crate pulldown_cmark;
 extern crate test_generator;
 extern crate toml;
 
-use serde_derive::Deserialize;
+use serde::Deserialize;
 use test_generator::test_resources;
 
 mod code_blocks;