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

Add Troubleshooting section #18

Closed
wants to merge 2 commits into from
Closed

Add Troubleshooting section #18

wants to merge 2 commits into from

Conversation

hamen
Copy link

@hamen hamen commented Jan 23, 2024

I'm running this using WSL on Windows. I tried to run:

./gradlew spotlessApply

and I encountered some issue that would be worth nothing down to help more people.

@SigmanZero
Copy link
Contributor

Hello, on Windows I believe you should use the gradlew.bat script instead.

@SigmanZero SigmanZero closed this Feb 14, 2024
@hamen
Copy link
Author

hamen commented Feb 14, 2024

Hi Nevin, I'm running it on Windows Subsystem for Linux (WSL). It's an Ubuntu 22.04 system, so the gradle.bat is not the right file to use in this scenario.
The documentation I added covers the scenario where you use WSL and your cloned repo is on the Windows partition. It's a fairly common scenario if you develop on Windows.

@rock3r
Copy link

rock3r commented Feb 14, 2024

@hamen out of curiosity, did you check out the repo on Windows, and then ran into the issue when running Gradle from WSL? If that's the case, the easiest fix is not to share repos between Windows and WSL — annoying, I know, but you're bound to run into many such line ending issues if you do. Ask me how I know 😆

The alternative is to set the core.autocrlf property to false for the repo when checking out, but that will result in a repo that only works on Windows and not on WSL. Unfortunately, there is no easy way to set up a project on a shared folder that will work both for Windows and WSL — or at least, I have never found one. It's always either working for Windows, or WSL.

The solution you propose is ok but might result in git saying the file has changed.

@hamen
Copy link
Author

hamen commented Feb 14, 2024

I indeed cloned the repo using Android Studio. Unfortunately, I tried core.autocrlf unsuccessfully.
I understand that my solution could be considered suboptimal in the greater scheme, but it would be one less obstacle to receive external contributions to the project.

@rock3r
Copy link

rock3r commented Feb 14, 2024

I reckon it's useful but needs to be caveated with the "if you're on Windows, and you checked out the repo on Windows, and you're trying to build it from WSL, then...". The issue, and the workaround you documented, is going to apply to any Gradle project, not just Socialite.

Arguably, it's a very niche setup, and someone who is advanced enough to do this, should already have figured out how to fix this issue as it'll apply to all their projects in the same situation. Ultimately, it's up to the maintainers to decide whether this is relevant enough for the audience of this repo. It's not a bad addition, imo.

@SigmanZero
Copy link
Contributor

Oops, thank you for the clarifications @hamen, I had misunderstood the issue.

@SigmanZero SigmanZero reopened this Feb 14, 2024
We're not sure what the company policy is around recommending dos2unix specifically, so I've updated the text to just mention the possible root cause and a path forward.
@yaraki
Copy link
Contributor

yaraki commented Feb 15, 2024

I reckon it's useful but needs to be caveated with the "if you're on Windows, and you checked out the repo on Windows, and you're trying to build it from WSL, then...". The issue, and the workaround you documented, is going to apply to any Gradle project, not just Socialite.

Arguably, it's a very niche setup, and someone who is advanced enough to do this, should already have figured out how to fix this issue as it'll apply to all their projects in the same situation. Ultimately, it's up to the maintainers to decide whether this is relevant enough for the audience of this repo. It's not a bad addition, imo.

I agree with this. The situation is not specific to this project, so it feels weird to mention it in this readme.

@yaraki yaraki closed this Feb 15, 2024
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

Successfully merging this pull request may close these issues.

4 participants