bat icon indicating copy to clipboard operation
bat copied to clipboard

Unable to compile bat on Windows from Git

Open clin1234 opened this issue 1 year ago • 3 comments

Running cargo install --all-features --git https://github.com/sharkdp/bat yielded this output:

    Updating git repository `https://github.com/sharkdp/bat`
    Updating git submodule `https://github.com/wiremoons/ada-sublime-syntax`
    Updating git submodule `https://github.com/colinta/ApacheConf.tmLanguage`
    Updating git submodule `https://github.com/asciidoctor/sublimetext-asciidoc.git`
    Updating git submodule `https://github.com/michaelblyons/SublimeSyntax-Crontab`
    Updating git submodule `https://github.com/elMuso/Dartlight.git`
    Updating git submodule `https://github.com/mariozaizar/email.sublime-syntax.git`
    Updating git submodule `https://github.com/315234/SublimeFortran`
    Updating git submodule `https://github.com/euler0/sublime-glsl`
    Updating git submodule `https://github.com/carsonoid/sublime_man_page_support`
    Updating git submodule `https://github.com/ioncodes/LLVM.tmBundle`
    Updating git submodule `https://github.com/leanprover/vscode-lean.git`
    Updating git submodule `https://github.com/paulmillr/LiveScript.tmbundle`
    Updating git submodule `https://github.com/tosher/Mediawiker.git`
    Updating git submodule `https://github.com/SublimeText/NSIS`
    Updating git submodule `https://github.com/brandonwamboldt/sublime-nginx`
    Updating git submodule `https://github.com/pope/SublimeNinja.git`
    Updating git submodule `https://github.com/skozlovf/Sublime-QML`
    Updating git submodule `https://github.com/follesoe/sublime-racket.git`
    Updating git submodule `https://github.com/slim-template/ruby-slim.tmbundle.git`
    Updating git submodule `https://github.com/billymoon/Stylus`
    Updating git submodule `https://github.com/davidhq/SublimeEthereum.git`
    Updating git submodule `https://github.com/zogwarg/SublimeJQ.git`
    Updating git submodule `https://github.com/corneliusio/svelte-sublime`
    Updating git submodule `https://github.com/TheClams/SystemVerilog.git`
    Updating git submodule `https://github.com/dertuxmalwieder/SublimeTodoTxt`
    Updating git submodule `https://github.com/ziglang/sublime-zig-language.git`
    Updating git submodule `https://github.com/victor-gp/cmd-help-sublime-syntax.git`
    Updating git submodule `https://github.com/hesstobi/sublime_gnuplot`
    Updating git submodule `https://github.com/keith-hall/http-request-response-syntax.git`
    Updating git submodule `https://github.com/PolyMeilex/vscode-wgsl.git`
    Updating git submodule `https://github.com/JohnNilsson/awk-sublime`
    Updating git submodule `https://github.com/tvi/Sublime-ARM-Assembly`
    Updating git submodule `https://github.com/zyxar/Sublime-CMakeLists`
    Updating git submodule `https://github.com/sustained/CoffeeScript-Sublime-Plugin`
    Updating git submodule `https://github.com/crystal-lang-tools/sublime-crystal.git`
    Updating git submodule `https://github.com/asbjornenge/Docker.tmbundle`
    Updating git submodule `https://github.com/zaynali53/DotENV`
    Updating git submodule `https://github.com/princemaple/elixir-sublime-syntax/`
    Updating git submodule `https://github.com/elm-community/SublimeElmLanguageSupport`
    Updating git submodule `https://github.com/hoest/sublimetext-fsharp`
    Updating git submodule `https://github.com/dncrews/GraphQL-SublimeText3.git`
    Updating git submodule `https://github.com/Anomareh/PHP-Twig.tmbundle.git`
    Updating git submodule `https://github.com/clintberry/sublime-text-2-ini`
    Updating git submodule `https://github.com/babel/babel-sublime`
    Updating git submodule `https://github.com/Martin819/sublime-jinja2`
error: failed to update submodule `assets/syntaxes/Jinja2`

Caused by:
  cannot checkout to invalid path 'Preferences/Symbol List: Blocks.tmPreferences'; class=Checkout (20)

clin1234 avatar Jun 06 '24 13:06 clin1234

you could try following the advice at https://stackoverflow.com/a/69091906/4473405 to checkout files with names which are not valid on Windows

keith-hall avatar Jun 07 '24 18:06 keith-hall

That works. Now another error: with --all-features, another compilation error:


error[E0599]: no function or associated item named `assert_from_raw_vec` found for struct `RawOsString` in the current scope
    --> src\lessopen.rs:170:38
     |
170  | ...    RawOsString::assert_from_raw_vec(lessopen_output.stdout),
     |                     ^^^^^^^^^^^^^^^^^^^ function or associated item not found in `RawOsString`
     |
note: if you're trying to build a new `RawOsString` consider using one of the following associated functions:
      RawOsString::new
      RawOsString::from_string
      RawOsString::from_encoded_vec_unchecked
    --> C:\Users\ךינשגכהד\.cargo\registry\src\index.crates.io-6f17d22bba15001f\os_str_bytes-7.0.0\src\raw_str.rs:996:5
     |
996  | /     pub fn new<S>(string: S) -> Self
997  | |     where
998  | |         S: Into<OsString>,
     | |__________________________^
...
1017 |       pub fn from_string(string: String) -> Self {
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1043 |       pub unsafe fn from_encoded_vec_unchecked(string: Vec<u8>) -> Sel...
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.
warning: `bat` (lib) generated 1 warning
error: could not compile `bat` (lib) due to 1 previous error; 1 warning emitted
error: failed to compile `bat v0.24.0 (C:\Users\ךינשגכהד\src\bat)`, intermediate artifacts can be found at `C:\Users\ךינשגכהד\src\bat\target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Omitting the flag allows successful compilation

clin1234 avatar Jun 07 '24 21:06 clin1234

I get the same compile error on linux using --all-features. And I also get a small warning just above it;

warning: use of deprecated associated function `os_str_bytes::RawOsString::from_string`: use `new` instead
   --> src/lessopen.rs:115:34
    |
115 |                     RawOsString::from_string(lessopen_stdout),
    |                                  ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

error[E0599]: no function or associated item named `assert_from_raw_vec` found for struct `RawOsString` in the current scope
    --> src/lessopen.rs:170:38
     |
170  |                         RawOsString::assert_from_raw_vec(lessopen_output.stdout),
     |                                      ^^^^^^^^^^^^^^^^^^^ function or associated item not found in `RawOsString`
     |
note: if you're trying to build a new `RawOsString` consider using one of the following associated functions:
      RawOsString::new
      RawOsString::from_string
      RawOsString::from_encoded_vec_unchecked
    --> /home/folk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_str_bytes-7.0.0/src/raw_str.rs:996:5
     |
996  | /     pub fn new<S>(string: S) -> Self
997  | |     where
998  | |         S: Into<OsString>,
     | |__________________________^
...
1017 |       pub fn from_string(string: String) -> Self {
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1043 |       pub unsafe fn from_encoded_vec_unchecked(string: Vec<u8>) -> Self {
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.
warning: `bat` (lib) generated 1 warning
error: could not compile `bat` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...

folknor avatar Aug 01 '24 05:08 folknor