-
Notifications
You must be signed in to change notification settings - Fork 6
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
NullPointerException on Windows when PATH
is actually Path
#7
Comments
liblit
added a commit
to liblit/WALA
that referenced
this issue
Jan 17, 2023
Also, require that ShellCheck pass for all macOS and Linux builds, not just builds where a `shellcheck` executable can be found. If you want to build WALA, you need to install ShellCheck. Fortunately, [ShellCheck is quite easy to install](https://github.com/koalaman/shellcheck#installing) on all supported platforms. Unfortunately, this ShellCheck plugin [does not work reliably on Windows](felipefzdz/gradle-shellcheck-plugin#7). Until that bug is fixed, it's simpler to just skip ShellCheck on Windows. We still run ShellCheck on macOS and Linux, so there's no risk of a bad shell script slipping into `master`.
liblit
added a commit
to liblit/WALA
that referenced
this issue
Jan 21, 2023
Also, require that ShellCheck pass for all macOS and Linux builds, not just builds where a `shellcheck` executable can be found. If you want to build WALA, you need to install ShellCheck. Fortunately, [ShellCheck is quite easy to install](https://github.com/koalaman/shellcheck#installing) on all supported platforms. Unfortunately, this ShellCheck plugin [does not work reliably on Windows](felipefzdz/gradle-shellcheck-plugin#7). Until that bug is fixed, it's simpler to just skip ShellCheck on Windows. We still run ShellCheck on macOS and Linux, so there's no risk of a bad shell script slipping into `master`.
liblit
added a commit
to wala/WALA
that referenced
this issue
Jan 21, 2023
Also, require that ShellCheck pass for all macOS and Linux builds, not just builds where a `shellcheck` executable can be found. If you want to build WALA, you need to install ShellCheck. Fortunately, [ShellCheck is quite easy to install](https://github.com/koalaman/shellcheck#installing) on all supported platforms. Unfortunately, this ShellCheck plugin [does not work reliably on Windows](felipefzdz/gradle-shellcheck-plugin#7). Until that bug is fixed, it's simpler to just skip ShellCheck on Windows. We still run ShellCheck on macOS and Linux, so there's no risk of a bad shell script slipping into `master`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using
gradle-shellcheck-plugin
version 1.4.6. Theshellcheck
task fails in my Windows installation, reporting the following stack trace:The
NullPointerException
arises here:gradle-shellcheck-plugin/shellcheck/src/main/java/com/felipefzdz/gradle/shellcheck/Shell.java
Line 46 in ba2a8a6
path
is probablynull
on this line. Looking at my Windows machine's environment, I see thatPATH
is not set as an environment variable. Instead,Path
is set. This is valid: Windows environment variables are case-insensitive. Unfortunately, this code to fetch thePATH
environment variable is case sensitive: it will returnnull
ifPath
is set instead ofPATH
.This
prepareEnvironment
function should be modified to copy "path" and "home" with any capitalization:path
,Path
,PaTh
, etc. If you want to keep the subprocess environment as small as possible (recommended), then this case-insensitive propagation could be done only when running on Windows. For Linux and macOS, by contrast, environment variables are case sensitive, so onlyPATH
andHOME
are needed, with exactly that capitalization.The text was updated successfully, but these errors were encountered: