salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
229 stars 49 forks source link

Springboot rule doesn't work on Windows: write_bazelrun_env.sh: /bin/bash^M: bad interpreter: No such file or directory #186

Open beastie1888 opened 9 months ago

beastie1888 commented 9 months ago

Hey there,

trying to build our project on Windows but I got:

bash.exe failed: error executing command (from target //my/project/target) C:\WINDOWS\system32\bash.exe -c ... (remaining 1 argument skipped) /bin/bash: external/rules_spring/springboot/write_bazelrun_env.sh: /bin/bash^M: bad interpreter: No such file or directory

We are using the springboot rule but it seems new lines are not properly interpreted in Windows.

plaird commented 9 months ago

Thanks for the report. I don't know if anyone has successfully built with _rulesspring on Windows. We have had #25 in the backlog for years, but otherwise it has been quiet.

I recently gave up maintainer duties for another open source project I owned, with the idea that I could shift more attention to rules_spring. I want to implement some new features, which would include a rewrite in a non-bash implementation. But I don't have a roadmap yet.

beastie1888 commented 9 months ago

Thank you for your answer. I also checked to see if my git client is adding the carriage return symbol to the files. I opened my bazel workspace directory and all source files had a carriage return at the end of each line. So, I reconfigured git to NOT add it when fetching the code, reinstalled bazel, but it failed the same way. Will post here if I find anything.