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

Can't compile problem #2

Closed
younger-1 opened this issue Oct 19, 2021 · 2 comments
Closed

Can't compile problem #2

younger-1 opened this issue Oct 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@younger-1
Copy link

OS: Arch Linux on Windows 10 x86_64
Kernel: 5.10.16.3-microsoft-standard-WSL2
Log:

❯ cargo install --git=https://github.com/rhysd/hgrep
    Updating git repository `https://github.com/rhysd/hgrep`
  Installing hgrep v0.1.3 (https://github.com/rhysd/hgrep#37082f52)
    Updating `sjtu` index
   Compiling libc v0.2.104
   Compiling autocfg v1.0.1
   Compiling cfg-if v1.0.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling lazy_static v1.4.0
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.80
   Compiling pkg-config v0.3.20
   Compiling serde_derive v1.0.130
   Compiling log v0.4.14
   Compiling regex-syntax v0.6.25
   Compiling serde v1.0.130
   Compiling crossbeam-utils v0.8.5
   Compiling encoding_index_tests v0.1.4
   Compiling regex-automata v0.1.10
   Compiling hashbrown v0.11.2
   Compiling proc-macro-hack v0.5.19
   Compiling once_cell v1.8.0
   Compiling same-file v1.0.6
   Compiling crc32fast v1.2.1
   Compiling crossbeam-epoch v0.9.5
   Compiling fnv v1.0.7
   Compiling ryu v1.0.5
   Compiling bitflags v1.3.2
   Compiling termcolor v1.1.2
   Compiling ucd-trie v0.1.3
   Compiling safemem v0.3.3
   Compiling encoding_rs v0.8.29
   Compiling adler v1.0.2
   Compiling linked-hash-map v0.5.4
   Compiling rayon-core v1.9.1
   Compiling scopeguard v1.1.0
   Compiling serde_json v1.0.68
   Compiling version_check v0.9.3
   Compiling xml-rs v0.8.4
   Compiling bugreport v0.4.1
   Compiling base64 v0.13.0
   Compiling unicode-width v0.1.9
   Compiling itoa v0.4.8
   Compiling dtoa v0.4.8
   Compiling strsim v0.10.0
   Compiling std_prelude v0.2.12
   Compiling anyhow v1.0.44
   Compiling lazycell v1.3.0
   Compiling textwrap v0.14.2
   Compiling shell-escape v0.1.5
   Compiling bat v0.18.3
   Compiling bytecount v0.6.2
   Compiling either v1.6.1
   Compiling ansi_term v0.12.1
   Compiling indexmap v1.7.0
   Compiling num-traits v0.2.14
   Compiling memoffset v0.6.4
   Compiling num-integer v0.1.44
   Compiling miniz_oxide v0.4.4
   Compiling rayon v1.5.1
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling encoding-index-korean v1.20141219.5
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling encoding-index-japanese v1.20141219.5
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling thread_local v1.1.3
   Compiling walkdir v2.3.2
   Compiling pest v2.1.3
   Compiling line-wrap v0.1.1
   Compiling yaml-rust v0.4.5
   Compiling error-chain v0.12.4
   Compiling path_abs v0.5.1
   Compiling encoding v0.2.33
   Compiling semver-parser v0.10.2
   Compiling aho-corasick v0.7.18
   Compiling bstr v0.2.17
   Compiling grep-matcher v0.1.5
   Compiling os_str_bytes v4.2.0
   Compiling content_inspector v0.2.4
   Compiling atty v0.2.14
   Compiling terminal_size v0.1.17
   Compiling num_cpus v1.13.0
   Compiling memmap2 v0.3.1
   Compiling quote v1.0.10
   Compiling jobserver v0.1.24
   Compiling crossbeam-channel v0.5.1
   Compiling semver v0.11.0
   Compiling encoding_rs_io v0.1.7
   Compiling flate2 v1.0.22
   Compiling regex v1.5.4
   Compiling clap v3.0.0-beta.5
   Compiling cc v1.0.71
   Compiling grep-searcher v0.1.8
   Compiling crossbeam-deque v0.8.1
   Compiling chrono v0.4.19
   Compiling globset v0.4.8
   Compiling console v0.14.1
   Compiling grep-regex v0.1.9
   Compiling console v0.15.0
   Compiling clap_generate v3.0.0-beta.5
   Compiling sys-info v0.9.0
   Compiling onig_sys v69.7.1
   Compiling pcre2-sys v0.2.5
   Compiling ansi_colours v1.0.4
   Compiling git-version-macro v0.3.5
   Compiling grep-cli v0.1.6
   Compiling ignore v0.4.18
   Compiling git-version v0.3.5
   Compiling pcre2 v0.2.3
   Compiling grep-pcre2 v0.1.5
   Compiling bincode v1.3.3
   Compiling plist v1.2.1
   Compiling serde_yaml v0.8.21
   Compiling clircle v0.3.0
   Compiling onig v6.3.0
   Compiling syntect v4.6.0
   Compiling hgrep v0.1.3 (/home/young/.cargo/git/checkouts/hgrep-76d18114b713642b/37082f5)
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope
  --> src/main.rs:22:38
   |
22 |         .global_setting(AppSettings::ColoredHelp)
   |                                      ^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> src/main.rs:242:19
    |
242 |         "bash" => generate::<Bash, _>(&mut app, "hgrep", &mut stdout),
    |                   ^^^^^^^^^^^^^^^^^^^ --------  -------  ----------- supplied 3 arguments
    |                   |
    |                   expected 4 arguments
    |
note: function defined here
   --> /home/young/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> src/main.rs:243:18
    |
243 |         "zsh" => generate::<Zsh, _>(&mut app, "hgrep", &mut stdout),
    |                  ^^^^^^^^^^^^^^^^^^ --------  -------  ----------- supplied 3 arguments
    |                  |
    |                  expected 4 arguments
    |
note: function defined here
   --> /home/young/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> src/main.rs:244:25
    |
244 |         "powershell" => generate::<PowerShell, _>(&mut app, "hgrep", &mut stdout),
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^ --------  -------  ----------- supplied 3 arguments
    |                         |
    |                         expected 4 arguments
    |
note: function defined here
   --> /home/young/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> src/main.rs:245:19
    |
245 |         "fish" => generate::<Fish, _>(&mut app, "hgrep", &mut stdout),
    |                   ^^^^^^^^^^^^^^^^^^^ --------  -------  ----------- supplied 3 arguments
    |                   |
    |                   expected 4 arguments
    |
note: function defined here
   --> /home/young/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> src/main.rs:246:21
    |
246 |         "elvish" => generate::<Elvish, _>(&mut app, "hgrep", &mut stdout),
    |                     ^^^^^^^^^^^^^^^^^^^^^ --------  -------  ----------- supplied 3 arguments
    |                     |
    |                     expected 4 arguments
    |
note: function defined here
   --> /home/young/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^

Some errors have detailed explanations: E0061, E0599.
For more information about an error, try `rustc --explain E0061`.
error: failed to compile `hgrep v0.1.3 (https://github.com/rhysd/hgrep#37082f52)`, intermediate artifacts can be found at `/tmp/cargo-installWmUcTi`

Caused by:
  could not compile `hgrep` due to 6 previous errors
@rhysd
Copy link
Owner

rhysd commented Oct 19, 2021

That's because this project is currently using clap 3.0.0-beta.4 through Cargo.lock and 3.0.0-beta.5 was released just 2 days ago. I'll try to update the dependency.

https://crates.io/crates/clap/versions

@rhysd rhysd added the bug Something isn't working label Oct 19, 2021
@rhysd rhysd closed this as completed in 22d71c7 Oct 19, 2021
@rhysd
Copy link
Owner

rhysd commented Oct 19, 2021

Please try cargo install again. Now it should be fixed with the latest version v0.1.4.

rhysd added a commit that referenced this issue Oct 21, 2021
syntect printer is about 4.64x faster than bat printer thanks to
parallelism

```
> hyperfine './hgrep --syntect Arg ../../clap-rs/clap/src' './hgrep Arg ../../clap-rs/clap/src'
Benchmark #1: ./hgrep --syntect Arg ../../clap-rs/clap/src
  Time (mean ± σ):     227.4 ms ±   3.5 ms    [User: 931.8 ms, System: 37.7 ms]
  Range (min … max):   222.3 ms … 233.5 ms    13 runs

Benchmark #2: ./hgrep Arg ../../clap-rs/clap/src
  Time (mean ± σ):      1.055 s ±  0.006 s    [User: 1.045 s, System: 0.041 s]
  Range (min … max):    1.043 s …  1.063 s    10 runs

Summary
  './hgrep --syntect Arg ../../clap-rs/clap/src' ran
    4.64 ± 0.08 times faster than './hgrep Arg ../../clap-rs/clap/src'
```
rhysd added a commit that referenced this issue Oct 22, 2021
Benchmark: 3% faster

```
Benchmark #1: ./before -p syntect Arg ../../clap-rs/clap/src
  Time (mean ± σ):     292.9 ms ±   2.7 ms    [User: 1.169 s, System: 0.035 s]
  Range (min … max):   289.8 ms … 297.9 ms    10 runs

Benchmark #2: ./after -p syntect Arg ../../clap-rs/clap/src
  Time (mean ± σ):     283.9 ms ±   4.2 ms    [User: 1.111 s, System: 0.036 s]
  Range (min … max):   277.3 ms … 293.6 ms    10 runs

Summary
  './after -p syntect Arg ../../clap-rs/clap/src' ran
    1.03 ± 0.02 times faster than './before -p syntect Arg ../../clap-rs/clap/src'
```
rhysd added a commit that referenced this issue Oct 28, 2021
This reduces output size in our tests as follows:

```
./testdata/syntect/ansi16_colors.out                 923 ->  918 (0.544% smaller)
./testdata/syntect/ansi256_colors.out               1232 -> 1122 (9.803% smaller)
./testdata/syntect/background.out                   1959 -> 1564 (25.25% smaller)
./testdata/syntect/default.out                      1451 -> 1264 (14.79% smaller)
./testdata/syntect/emoji.out                        1495 -> 1289 (15.98% smaller)
./testdata/syntect/emoji_bg.out                     2273 -> 1777 (27.91% smaller)
./testdata/syntect/empty_lines.out                  1705 -> 1518 (12.31% smaller)
./testdata/syntect/empty_lines_bg.out               2904 -> 2269 (27.98% smaller)
./testdata/syntect/first_only.out                   2837 -> 2235 (26.93% smaller)
./testdata/syntect/hard_tab.out                     2088 -> 1597 (30.74% smaller)
./testdata/syntect/japanese_background.out          2237 -> 1741 (28.48% smaller)
./testdata/syntect/japanese_default.out             1612 -> 1388 (16.13% smaller)
./testdata/syntect/long_line.out                    2338 -> 2096 (11.54% smaller)
./testdata/syntect/long_line_bg.out                 3172 -> 2578 (23.04% smaller)
./testdata/syntect/multi_chunks_bg.out              7824 -> 5171 (51.30% smaller)
./testdata/syntect/multi_chunks_default.out         4366 -> 3425 (27.47% smaller)
./testdata/syntect/multi_chunks_no_grid.out         3701 -> 2703 (36.92% smaller)
./testdata/syntect/multi_line_numbers.out           3338 -> 2815 (18.57% smaller)
./testdata/syntect/no_grid.out                       894 ->  688 (29.94% smaller)
./testdata/syntect/no_grid_background.out           1374 ->  960 (43.12% smaller)
./testdata/syntect/no_wrap_background.out           2500 -> 1890 (32.27% smaller)
./testdata/syntect/no_wrap_default.out              1920 -> 1582 (21.36% smaller)
./testdata/syntect/no_wrap_no_grid.out              1357 -> 1000 (35.69% smaller)
./testdata/syntect/region_at_end_of_line.out        1665 -> 1420 (17.25% smaller)
./testdata/syntect/region_at_end_of_line_bg.out     2239 -> 1722 (30.02% smaller)
./testdata/syntect/region_at_line_start.out         1581 -> 1375 (14.98% smaller)
./testdata/syntect/tab_width_2.out                  2098 -> 1607 (30.55% smaller)
./testdata/syntect/theme.out                        1453 -> 1304 (11.42% smaller)
./testdata/syntect/whole_line.out                   1286 -> 1191 (7.976% smaller)
./testdata/syntect/wide_char_region.out             1465 -> 1278 (14.63% smaller)
./testdata/syntect/wide_char_region_bg.out          1964 -> 1569 (25.17% smaller)
./testdata/syntect/wrap_3_lines_emoji.out           2253 -> 2029 (11.03% smaller)
./testdata/syntect/wrap_ansi256.out                 1646 -> 1448 (13.67% smaller)
./testdata/syntect/wrap_between_bg.out              2641 -> 2031 (30.03% smaller)
./testdata/syntect/wrap_between_text.out            2047 -> 1709 (19.77% smaller)
./testdata/syntect/wrap_break_wide_char.out         2252 -> 1876 (20.04% smaller)
./testdata/syntect/wrap_break_wide_char_bg.out      3081 -> 2257 (36.50% smaller)
./testdata/syntect/wrap_emoji.out                   2044 -> 1706 (19.81% smaller)
./testdata/syntect/wrap_emoji_zwj.out               2067 -> 1729 (19.54% smaller)
./testdata/syntect/wrap_japanese_after.out          2536 -> 2065 (22.80% smaller)
./testdata/syntect/wrap_japanese_before.out         2537 -> 2066 (22.79% smaller)
./testdata/syntect/wrap_japanese_louise.out         5738 -> 5532 (3.723% smaller)
./testdata/syntect/wrap_jp_louise_bg.out            6617 -> 6203 (6.674% smaller)
./testdata/syntect/wrap_jp_louise_no_grid.out       4996 -> 4771 (4.715% smaller)
./testdata/syntect/wrap_match_at_second_line.out    2207 -> 1793 (23.08% smaller)
./testdata/syntect/wrap_match_at_second_line_bg.out 2793 -> 2107 (32.55% smaller)
./testdata/syntect/wrap_middle_of_spaces.out        2051 -> 1713 (19.73% smaller)
./testdata/syntect/wrap_middle_of_tab.out           2029 -> 1691 (19.98% smaller)
./testdata/syntect/wrap_middle_of_text.out          2049 -> 1711 (19.75% smaller)
./testdata/syntect/wrap_middle_text_bg.out          2641 -> 2031 (30.03% smaller)
./testdata/syntect/wrap_no_grid.out                 1481 -> 1124 (31.76% smaller)
./testdata/syntect/wrap_region_accross_line.out     2219 -> 1805 (22.93% smaller)
./testdata/syntect/wrap_region_jp_accross_line.out  2225 -> 1811 (22.86% smaller)
./testdata/syntect/wrap_region_line_end.out         1838 -> 1577 (16.55% smaller)
./testdata/syntect/wrap_region_line_start.out       1820 -> 1575 (15.55% smaller)
./testdata/syntect/wrap_theme.out                   2045 -> 1783 (14.69% smaller)
./testdata/syntect/wrap_twice.out                   2656 -> 2186 (21.50% smaller)
./testdata/syntect/wrap_whole_3_lines.out           1763 -> 1650 (6.848% smaller)
```

CPU performance does not change.

Benchmark:

```
group                         after                                  before
-----                         -----                                  ------
syntect::package-lock.json    1.01   722.0±36.85ms        ? ?/sec    1.00   711.9±33.71ms        ? ?/sec
syntect::ripgrep-large        1.01    430.9±8.01ms        ? ?/sec    1.00    428.4±7.48ms        ? ?/sec
syntect::ripgrep-small        1.01    110.5±1.35ms        ? ?/sec    1.00    109.7±1.14ms        ? ?/sec
syntect::ripgrep-tiny         1.00     49.5±0.38ms        ? ?/sec    1.00     49.4±0.30ms        ? ?/sec
```

Command:

```
> hyperfine './before -p syntect Arg ../../clap-rs/clap/src' './after -p syntect Arg ../../clap-rs/clap/src'
Benchmark #1: ./before -p syntect Arg ../../clap-rs/clap/src
  Time (mean ± σ):     292.3 ms ±   3.7 ms    [User: 1.192 s, System: 0.040 s]
  Range (min … max):   285.2 ms … 299.8 ms    10 runs

Benchmark #2: ./after -p syntect Arg ../../clap-rs/clap/src
  Time (mean ± σ):     290.9 ms ±   3.2 ms    [User: 1.180 s, System: 0.041 s]
  Range (min … max):   285.1 ms … 294.6 ms    10 runs

Summary
  './after -p syntect Arg ../../clap-rs/clap/src' ran
    1.00 ± 0.02 times faster than './before -p syntect Arg ../../clap-rs/clap/src'
```

but writing the output to terminal seems improved by around 6~10%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants