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

Unable to compile bat on Windows from Git #2991

Open
clin1234 opened this issue Jun 6, 2024 · 3 comments
Open

Unable to compile bat on Windows from Git #2991

clin1234 opened this issue Jun 6, 2024 · 3 comments
Labels
bat-as-a-library Related to bat-as-a-library bug Something isn't working windows Issue is related to the Windows build of bat

Comments

@clin1234
Copy link

clin1234 commented Jun 6, 2024

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 clin1234 added the bug Something isn't working label Jun 6, 2024
@clin1234 clin1234 changed the title Unable to compile bat on Windows from Git with all features Unable to compile bat on Windows from Git Jun 6, 2024
@keith-hall keith-hall added the upstream-error A bug in an upstream component label Jun 7, 2024
@keith-hall
Copy link
Collaborator

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

@clin1234
Copy link
Author

clin1234 commented Jun 7, 2024

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

@keith-hall keith-hall added windows Issue is related to the Windows build of bat bat-as-a-library Related to bat-as-a-library and removed upstream-error A bug in an upstream component labels Jun 8, 2024
@folknor
Copy link

folknor commented Aug 1, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bat-as-a-library Related to bat-as-a-library bug Something isn't working windows Issue is related to the Windows build of bat
Projects
None yet
Development

No branches or pull requests

3 participants