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

Give warnings and errors when building from source on powershell. (Windows 10) resulting into fail build. #1973

Closed
reiend opened this issue Apr 6, 2022 · 31 comments · Fixed by #3190
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug O-windows Operating system: Windows

Comments

@reiend
Copy link

reiend commented Apr 6, 2022

Windows 10
Powershell 7.2.2
With gcc and g++ installed(MingW). installed using choco intall
rust was installed using choco install rust

To replicate the issue.
use windows 10
use powershell
install rust via choco install rust
install mingw via choco install
git clone https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

the warning and errors will occur on building[208-214]
see image below

image
image
image
image

@reiend reiend changed the title Give warnings and errors when building from source on powershell. (Windows 10) Give warnings and errors when building from source on powershell. (Windows 10) resulting into fail build. Apr 6, 2022
@the-mikedavis
Copy link
Member

C:\Devs\OpenSource\helix\runtime\grammars/sources\json\src\parser.c

looks like there's be a hard-coded /. Will take a look in a bit.

@the-mikedavis the-mikedavis added C-bug Category: This is a bug A-helix-term Area: Helix term improvements labels Apr 6, 2022
@reiend
Copy link
Author

reiend commented Apr 7, 2022

thanks for making a fix @the-mikedavis , but it still throws warnings and errors.
I tried building different source from the commit history one from april - december . but none of them works.
it always gives me the same error "Failed to run custom build for helix-term v....."

@reiend
Copy link
Author

reiend commented Apr 7, 2022

this is the last source that I build from history
https://github.com/helix-editor/helix/tree/7438db66ae93c9164fdc29bdf31bd9b8ef861efb
will try to build more.

@reiend
Copy link
Author

reiend commented Apr 7, 2022

@the-mikedavis did I miss something from the installation? I'm starting to think the issue exist on my end.

@the-mikedavis
Copy link
Member

What versions of gcc and g++ do you have installed?

@reiend
Copy link
Author

reiend commented Apr 8, 2022

What versions of gcc and g++ do you have installed?

g++, gcc - 11.2.0
rustc - 1.59.0

@reiend
Copy link
Author

reiend commented Apr 8, 2022

I try building one from November - June 2021 still no luck.
it still throwing the same error. "Failed to run custom build for helix-term v....."
but the difference this time is it doesn't give me any warnings about an unused function or macro.

@the-mikedavis
Copy link
Member

I believe what's failing is the compilation command for tree-sitter gramamrs (here). Maybe the windows build is missing a flag?

@the-mikedavis the-mikedavis added the O-windows Operating system: Windows label Apr 8, 2022
@reiend
Copy link
Author

reiend commented Apr 8, 2022

I'm sorry @the-mikedavis, I can't help you with the code. but now that you mentioned it. at the end it specifically mentioned that it can't find the directory for the tree-sitter. base on my recent build from source from November - June 2021. I encountered something similar, an error that has something to do with tree-sitter, it mention something about installing things recursively, submodules and empty directory.

I use this source https://github.com/helix-editor/helix/tree/0af8928d630ada730402ad182e8d36a5db06a142 (Oct 3, 2021)(0af8928)

image

@the-mikedavis
Copy link
Member

Yeah a while back we were using git submodules for tree-sitter repositories. For old revisions you'll need to use git submodule update --init --recursive to make sure they're checked out before building.

@reiend
Copy link
Author

reiend commented Apr 9, 2022

@the-mikedavis Just an update. still failing when you build it from source using native windows, so I tried different approaches (still throwing the tree-sitter error).

building it using wsl2 (ubuntu 20.04) went just fine, however when you change the theme :theme it throws an error about theme not supported required true color something like that.

installing it using scoop was so smooth, I encountered no issues at all.

@the-mikedavis
Copy link
Member

Oh curious, I wonder if this is just a problem with compatibility with MinGW then 🤔

It sounds like on the wsl2/ubuntu setup you'll need to add a config to force true-color support: https://docs.helix-editor.com/configuration.html

[editor]
true-color = true

@reiend
Copy link
Author

reiend commented Apr 9, 2022

I forgot to mention that I use MinGW too on wsl2/ubuntu for gcc/g++.
if that's the case, it seems weird that it works correctly.

oh my bad. I didn't finish reading the 0.4 Configuration part docs.

@Antonio-Bennett
Copy link

I'm getting this error on WSL2 latest version of rustic installed.

@reiend
Copy link
Author

reiend commented Apr 21, 2022

I'm getting this error on WSL2 latest version of rustic installed.

@Antonio-Bennett make sure you have gcc/g++ compiler on wsl2.

@Antonio-Bennett
Copy link

@reiend i do :( not sure why it started happening because it worked before then I switched to set it up with my forked repo and after it stopped working completely even with the main repo. Using homebrew rn but it doesn't get latest changes quickly

@reiend reiend closed this as completed Apr 21, 2022
@reiend reiend reopened this Apr 21, 2022
@reiend
Copy link
Author

reiend commented Apr 21, 2022

@reiend i do :( not sure why it started happening because it worked before then I switched to set it up with my forked repo and after it stopped working completely even with the main repo. Using homebrew rn but it doesn't get latest changes quickly

weird.

I tried building it again on native windows but still give the same error above.

@reiend
Copy link
Author

reiend commented Apr 21, 2022

@Antonio-Bennett you can try installing via scoop, downsides is, it doesn't have the latest commits

@Antonio-Bennett
Copy link

@reiend what's the difference to just continuing to use homebrew? I get to stay in wsl with homebrew though

@reiend
Copy link
Author

reiend commented Apr 21, 2022

@reiend what's the difference to just continuing to use homebrew? I get to stay in wsl with homebrew though

what is the helix version on homebrew?
if it's 22.3 most likely you will encounter some minor issues. where the fixes is on the latest commits.
on my end I encounter highlighting issues on jsx. it was solve here #1921.

@slinlee
Copy link
Contributor

slinlee commented Apr 21, 2022

@reiend did you try cargo clean yet?

@reiend
Copy link
Author

reiend commented Apr 22, 2022

@reiend did you try cargo clean yet?

@slinlee I didn't, I'll try this out, thanks.

@Antonio-Bennett
Copy link

Tried cargo clean still same error for me also tried doing git submodule update --force --init --recursive --depth 1 --jobs 8 before running cargo install

@reiend
Copy link
Author

reiend commented Apr 22, 2022

same It didn't work.

@crokenx
Copy link

crokenx commented Apr 25, 2022

Hi, I'm with the same errors from treesitter.

@kirawi
Copy link
Member

kirawi commented Apr 25, 2022

Are all of you using GCC? I use clang and I'm able to compile normally, and I think MSVC worked too.

@crokenx
Copy link

crokenx commented Apr 26, 2022

Ok I tryed something.

I was trying to run rustlings exercises and rust keep saying me that I have to install vs 2019 or vs 2022, I downloaded the installer for vs 2022 and selected the c++ tools, try the rustlings watch command and everything started working just fine, next I went to helix files and run again the commands, "cargo install --path helix-term" to be exactly, and it works, hx command is now in my path and I can continue with the normal installation of helix. As @kirawi noted I was trying with GCC. I don't know why but there's the problem with all of this.

@Antonio-Bennett
Copy link

Hmm seems to be using clang and still getting this error
image

@crokenx
Copy link

crokenx commented Apr 28, 2022

Hmm seems to be using clang and still getting this error image

I didn't use clang, I installed c++ tools with the help of vs 2022. The error you are getting seems to be related to the shell you are using because the path in the terminal is not finding clang compiler.

@txtyb
Copy link

txtyb commented Jun 9, 2022

It seems that although we are using MingW, the compiler still received arguments in MSVC style.
Temperory workaround: delete these lines, and then cargo install --path helix-term.

@kirawi
Copy link
Member

kirawi commented Jun 19, 2022

We could try having separate arguments for an MingW toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug O-windows Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants