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

Help installing buildifier into WSL #284

Open
frankie-frank-frank opened this issue Nov 22, 2022 · 1 comment
Open

Help installing buildifier into WSL #284

frankie-frank-frank opened this issue Nov 22, 2022 · 1 comment

Comments

@frankie-frank-frank
Copy link

Whenever I open buildifier in VSCode, I get a pop-up requiring me to download the buildifier setup for linting. However, when I download the amd-64 executable file and run it, I get a blank screen. Can anyone give me a simple descriptive guide on how to go about getting buildifier installed on windows and making it accessible in my wsl project?

@hypdeb
Copy link
Contributor

hypdeb commented Nov 27, 2023

Here is how I do it: you need to download a version of buildifier inside the WSL. You can do it in your home directory for example:

cd ~
wget https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64

I have a bin directory inside my user directory where my bazelisk installation also resides. I copy `buildifier there too like so:

mv buildifier-linux-amd64 ./bin/buildifier

And then you should make sure that the path to this folder is on your path, for example by adding this line to the .bashrc file in an Ubuntu distribution. If you're connected to your WSL using VS Code, you can directly open it in there

code ~/.bashrc

and add the following line at the end of it:

export PATH=~/bin:$PATH

Finally, you need to add the execute permission to the buildifier executable using chmod:

chmod +x ~/bin/buildifier

Finally, restart VS code and you should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants