SUPERAndroidAnalyzer / super

Secure, Unified, Powerful and Extensible Rust Android Analyzer
https://superanalyzer.rocks/
GNU General Public License v3.0
421 stars 59 forks source link

Could not compile `super-analyzer` #155

Closed Patryck95 closed 6 years ago

Patryck95 commented 6 years ago

Hi I'm trying to compile your tool but I am getting some compile errors. I have Rust installed and after I have made the clone of your repository when I try to compile it this is the output.

Caused by:
 process didn't exit successfully: 
`rustc --crate-name super src/main.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=unwind -C lto --cfg feature="beta" --cfg feature="default" -C metadata=3121010ed65ae2e4 -C extra-filename=-3121010ed65ae2e4 --out-dir /home/ana/Documents/TOOLS/super/super-master/target/release/deps -L dependency=/home/ana/Documents/TOOLS/super/super-master/target/release/deps --extern handlebars=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libhandlebars-ad4de72bb2afc0a7.rlib --extern bytecount=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libbytecount-dbe0bdf0398f553e.rlib --extern log=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/liblog-38f2cb87c33befee.rlib --extern clap=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libclap-e4f92d5c0fe1683d.rlib --extern sha1=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libsha1-b40b6f937d0ee685.rlib --extern colored=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libcolored-cac7ccbc92fbe0b9.rlib --extern sha2=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libsha2-375fc052cb50ec2e.rlib --extern regex=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libregex-c81e97f03964db6a.rlib --extern abxml=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libabxml-7b5a7eb5fa6b93c9.rlib --extern serde=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libserde-e38caa568d68478e.rlib --extern serde_json=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libserde_json-2037d9614a4de218.rlib --extern lazy_static=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/liblazy_static-c4a411d36e25699e.rlib --extern chrono=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libchrono-479d7873d1c1590e.rlib --extern rustc_serialize=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/librustc_serialize-257aa7a69213e244.rlib --extern env_logger=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libenv_logger-f9791a6afc0f2255.rlib --extern open=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libopen-bf329b65d660e5f9.rlib --extern xml=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libxml-47468703bbe9e72a.rlib --extern toml=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libtoml-d542d9f81818eb05.rlib --extern md5=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/libmd5-e9ce2a6c3a32c256.rlib --extern error_chain=/home/ana/Documents/TOOLS/super/super-master/target/release/deps/liberror_chain-41856b8c67d4c760.rlib -L native=/home/ana/Documents/TOOLS/super/super-master/target/release/build/backtrace-sys-53363fa956ad627d/out/.libs -L native=/home/ana/Documents/TOOLS/super/super-master/target/release/build/bzip2-sys-cffd836f46489f8b/out -L native=/home/ana/Documents/TOOLS/super/super-master/target/release/build/miniz-sys-89dd1f7f8ba050df/out` (exit code: 101)
Razican commented 6 years ago

Hi!

Thank you for reporting the issue, sorry for not being able to reply earlier. Could you please check a couple of things?

Also, I see that your error output starts with Caused by:. This is usually not the first line of an error output, could you please paste the whole output after the invocation of cargo build or cargo run?

Thanks!

Patryck95 commented 6 years ago

Hi, The rustc -vV command gave me:

rustc 1.23.0 (766bd11c8 2018-01-01)
binary: rustc
commit-hash: 766bd11c8a3c019ca53febdcd77b2215379dd67d
commit-date: 2018-01-01
host: x86_64-unknown-linux-gnu
release: 1.23.0
LLVM version: 4.0

The complete output is:

warning: path `/home/ana/Documents/TOOLS/super/super-master/src/main.rs` was erroneously implicitly accepted for binary `super`,
please set bin.path in Cargo.toml
   Compiling sha1 v0.2.0
   Compiling strsim v0.6.0
   Compiling void v1.0.2
   Compiling byteorder v1.0.0
   Compiling pest v0.3.3
   Compiling ansi_term v0.9.0
   Compiling podio v0.1.5
   Compiling md5 v0.3.5
   Compiling lazy_static v0.2.8
   Compiling vec_map v0.8.0
   Compiling bytecount v0.1.6
   Compiling fake-simd v0.1.2
   Compiling odds v0.2.25
   Compiling encoding_index_tests v0.1.4
   Compiling byte-tools v0.1.3
   Compiling log v0.3.8
   Compiling open v1.2.0
   Compiling utf8-ranges v1.0.0
   Compiling rustc-serialize v0.3.24
   Compiling typenum v1.5.2
   Compiling serde v0.9.15
   Compiling unicode-width v0.1.4
   Compiling bitflags v0.7.0
   Compiling rustc-demangle v0.1.4
   Compiling quick-error v1.2.0
   Compiling num-traits v0.1.39
   Compiling cfg-if v0.1.1
   Compiling unicode-segmentation v1.1.0
   Compiling libc v0.2.24
   Compiling dtoa v0.4.1
   Compiling bitflags v0.9.1
   Compiling itoa v0.3.1
   Compiling gcc v0.3.51
   Compiling regex-syntax v0.4.1
   Compiling unreachable v0.1.1
   Compiling colored v1.5.1
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling encoding-index-korean v1.20141219.5
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling encoding-index-japanese v1.20141219.5
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling nodrop v0.1.9
   Compiling xml-rs v0.4.1
   Compiling num-integer v0.1.34
   Compiling thread-id v3.1.0
   Compiling atty v0.2.2
   Compiling term_size v0.3.0
   Compiling time v0.1.37
   Compiling memchr v1.0.1
   Compiling miniz-sys v0.1.9
   Compiling backtrace-sys v0.1.11
   Compiling bzip2-sys v0.1.5
   Compiling serde_json v0.9.10
   Compiling toml v0.3.2
   Compiling encoding v0.2.33
   Compiling thread_local v0.3.3
   Compiling num-iter v0.1.33
   Compiling textwrap v0.6.0
   Compiling aho-corasick v0.6.3
   Compiling msdos_time v0.1.5
   Compiling generic-array v0.7.2
   Compiling num v0.1.39
   Compiling clap v2.25.0
   Compiling regex v0.2.2
   Compiling digest-buffer v0.3.1
   Compiling digest v0.5.2
   Compiling chrono v0.3.0
   Compiling flate2 v0.2.19
   Compiling sha2 v0.5.3
   Compiling bzip2 v0.3.2
   Compiling zip v0.2.3
   Compiling backtrace v0.3.2
   Compiling error-chain v0.10.0
   Compiling env_logger v0.4.3
   Compiling handlebars v0.25.3
   Compiling abxml v0.2.0
   Compiling super-analyzer v0.4.1 (file:///home/ana/Documents/TOOLS/super/super-master)
warning: unknown lint: `while_truem`
 --> src/main.rs:4:83
  |
4 |     plugin_as_library, unused_allocation, trivial_numeric_casts, unused_features, while_truem,
  |                                                                                   ^^^^^^^^^^^
  |
  = note: #[warn(unknown_lints)] on by default

warning: unknown lint: `filter_map`
 --> src/main.rs:7:5
  |
7 |     filter_map, used_underscore_binding, option_map_unwrap_or, option_map_unwrap_or_else,
  |     ^^^^^^^^^^

warning: unknown lint: `used_underscore_binding`
 --> src/main.rs:7:17
  |
7 |     filter_map, used_underscore_binding, option_map_unwrap_or, option_map_unwrap_or_else,
  |                 ^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `option_map_unwrap_or`
 --> src/main.rs:7:42
  |
7 |     filter_map, used_underscore_binding, option_map_unwrap_or, option_map_unwrap_or_else,
  |                                          ^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `option_map_unwrap_or_else`
 --> src/main.rs:7:64
  |
7 |     filter_map, used_underscore_binding, option_map_unwrap_or, option_map_unwrap_or_else,
  |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `mutex_integer`
 --> src/main.rs:8:5
  |
8 |     mutex_integer, mut_mut, mem_forget)]
  |     ^^^^^^^^^^^^^

warning: unknown lint: `mut_mut`
 --> src/main.rs:8:20
  |
8 |     mutex_integer, mut_mut, mem_forget)]
  |                    ^^^^^^^

warning: unknown lint: `mem_forget`
 --> src/main.rs:8:29
  |
8 |     mutex_integer, mut_mut, mem_forget)]
  |                             ^^^^^^^^^^

warning: unknown lint: `enum_glob_use`
  --> src/main.rs:10:49
   |
10 | #![warn(missing_docs, variant_size_differences, enum_glob_use, if_not_else,
   |                                                 ^^^^^^^^^^^^^

warning: unknown lint: `if_not_else`
  --> src/main.rs:10:64
   |
10 | #![warn(missing_docs, variant_size_differences, enum_glob_use, if_not_else,
   |                                                                ^^^^^^^^^^^

warning: unknown lint: `invalid_upcast_comparisons`
  --> src/main.rs:11:5
   |
11 |     invalid_upcast_comparisons, items_after_statements, non_ascii_literal, nonminimal_bool,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `items_after_statements`
  --> src/main.rs:11:33
   |
11 |     invalid_upcast_comparisons, items_after_statements, non_ascii_literal, nonminimal_bool,
   |                                 ^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `non_ascii_literal`
  --> src/main.rs:11:57
   |
11 |     invalid_upcast_comparisons, items_after_statements, non_ascii_literal, nonminimal_bool,
   |                                                         ^^^^^^^^^^^^^^^^^

warning: unknown lint: `nonminimal_bool`
  --> src/main.rs:11:76
   |
11 |     invalid_upcast_comparisons, items_after_statements, non_ascii_literal, nonminimal_bool,
   |                                                                            ^^^^^^^^^^^^^^^

warning: unknown lint: `pub_enum_variant_names`
  --> src/main.rs:12:5
   |
12 |     pub_enum_variant_names, shadow_reuse, shadow_same, shadow_unrelated, similar_names,
   |     ^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `shadow_reuse`
  --> src/main.rs:12:29
   |
12 |     pub_enum_variant_names, shadow_reuse, shadow_same, shadow_unrelated, similar_names,
   |                             ^^^^^^^^^^^^

warning: unknown lint: `shadow_same`
  --> src/main.rs:12:43
   |
12 |     pub_enum_variant_names, shadow_reuse, shadow_same, shadow_unrelated, similar_names,
   |                                           ^^^^^^^^^^^

warning: unknown lint: `shadow_unrelated`
  --> src/main.rs:12:56
   |
12 |     pub_enum_variant_names, shadow_reuse, shadow_same, shadow_unrelated, similar_names,
   |                                                        ^^^^^^^^^^^^^^^^

warning: unknown lint: `similar_names`
  --> src/main.rs:12:74
   |
12 |     pub_enum_variant_names, shadow_reuse, shadow_same, shadow_unrelated, similar_names,
   |                                                                          ^^^^^^^^^^^^^

warning: unknown lint: `single_match_else`
  --> src/main.rs:13:5
   |
13 |     single_match_else, string_add, string_add_assign, unicode_not_nfc, unseparated_literal_suffix,
   |     ^^^^^^^^^^^^^^^^^

warning: unknown lint: `string_add`
  --> src/main.rs:13:24
   |
13 |     single_match_else, string_add, string_add_assign, unicode_not_nfc, unseparated_literal_suffix,
   |                        ^^^^^^^^^^

warning: unknown lint: `string_add_assign`
  --> src/main.rs:13:36
   |
13 |     single_match_else, string_add, string_add_assign, unicode_not_nfc, unseparated_literal_suffix,
   |                                    ^^^^^^^^^^^^^^^^^

warning: unknown lint: `unicode_not_nfc`
  --> src/main.rs:13:55
   |
13 |     single_match_else, string_add, string_add_assign, unicode_not_nfc, unseparated_literal_suffix,
   |                                                       ^^^^^^^^^^^^^^^

warning: unknown lint: `unseparated_literal_suffix`
  --> src/main.rs:13:72
   |
13 |     single_match_else, string_add, string_add_assign, unicode_not_nfc, unseparated_literal_suffix,
   |                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `use_debug`
  --> src/main.rs:14:5
   |
14 |     use_debug, wrong_pub_self_convention, doc_markdown)]
   |     ^^^^^^^^^

warning: unknown lint: `wrong_pub_self_convention`
  --> src/main.rs:14:16
   |
14 |     use_debug, wrong_pub_self_convention, doc_markdown)]
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown lint: `doc_markdown`
  --> src/main.rs:14:43
   |
14 |     use_debug, wrong_pub_self_convention, doc_markdown)]
   |                                           ^^^^^^^^^^^^

warning: unknown lint: `missing_docs_in_private_items`
  --> src/main.rs:16:10
   |
16 | #![allow(missing_docs_in_private_items, unknown_lints, print_stdout, stutter, option_unwrap_used,
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/results/mod.rs:144:17
    |
144 |                 self.warnings.insert(vuln);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: lint level defined here
   --> src/main.rs:5:84
    |
5   |     unused_parens, unused_comparisons, unused_extern_crates, unused_import_braces, unused_results,
    |                                                                                    ^^^^^^^^^^^^^^

error: unused result
   --> src/results/mod.rs:147:17
    |
147 |                 self.low.insert(vuln);
    |                 ^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/results/mod.rs:150:17
    |
150 |                 self.medium.insert(vuln);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/results/mod.rs:153:17
    |
153 |                 self.high.insert(vuln);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/results/mod.rs:156:17
    |
156 |                 self.critical.insert(vuln);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/config.rs:294:13
    |
294 |             package_path.set_extension("apk");
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused result
   --> src/config.rs:679:21
    |
679 | /                     self.permissions.insert(PermissionConfig::new(
680 | |                         permission,
681 | |                         criticality,
682 | |                         label,
683 | |                         description,
684 | |                     ));
    | |_______________________^

error: aborting due to 7 previous errors
error: Could not compile `super-analyzer`.
To learn more, run the command again with --verbose.

I have tried to compiled it with the package from the releases but it gives me the same problem.

Razican commented 6 years ago

It looks like the master branch is no longer building in newer Rust versions. You can use Rust 1.18.0 to build the master branch (it was the latest tested version against this branch) or you could try the develop branch, that works with the latest Rust version but still has some bugs that are preventing the release of the 0.5.0 version. To use Rust 1.18.0, if you are using rustup, you can simply run the following:

$ rustup toolchain install 1.18.0
$ cd path/to/super
$ rustup override add 1.18.0
$ cargo clean
$ cargo build

If you want to try the develop branch, you can run git checkout develop in the repository path and then build it with cargo build. You could even use Rust 1.24.1, the latest version.

There is another third option if what you want is just to use the software. In the releases page you can probably find a package for your distribution, let me know if this is not the case.

Patryck95 commented 6 years ago

I will use Rust 1.18.0. Thanks for your help.

Razican commented 6 years ago

Sure, no problem!