-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Divergence with Clojure CLI script when determining default config directory #114
Comments
Can you please summarize the issue here so I don't have to dig into external links? Also it would save me time if you could make explicit what is the current + expected behavior and if there should be a change somewhere, possibly with multiple alternative solutions. |
The summary is in the description already: Because |
Oh yeah and we ran into this because the nix build environment on Darwin ends up with diverging results between the two in practice (see NixOS/nixpkgs#257473 (comment)). |
If you agree, I can cook up a PR for this later, too! |
Please double-check how the CLI checks for the home dir on Windows. |
It seems in Windows |
let's make the change, PR welcome |
The original bash script uses the `HOME` environment variable[1] to determine the user's home directory while we were using thee `user.home` JVM property on non-windows platforms. This turns out to not be equivalent (see e.g. JDK-8280357[2] for a recent issue caused by this). So instead, we now also use the environment variable. As it turns out, the original Powershell script also first checks the `HOME` environment variable[3] before falling back to `USERPROFILE` (which is what we were using so far), so we also align that to ensure equivalent behavior. This also means we can drop the "workaround" comment here since it no longer is one. Closes borkdude#114. [1] https://github.com/clojure/brew-install/blob/b03428b1b31a8d60573a284d6971fbd3db7b748d/src/main/resources/clojure/install/clojure#L280 [2] https://bugs.openjdk.org/browse/JDK-8280357 [3] https://github.com/clojure/brew-install/blob/dabb82bd011b0510006dd88464f350052adb69b5/src/main/resources/clojure/install/ClojureTools.psm1#L254-L258
The original bash script uses the `HOME` environment variable[1] to determine the user's home directory while we were using thee `user.home` JVM property on non-windows platforms. This turns out to not be equivalent (see e.g. JDK-8280357[2] for a recent issue caused by this). So instead, we now also use the environment variable. As it turns out, the original Powershell script also first checks the `HOME` environment variable[3] before falling back to `USERPROFILE` (which is what we were using so far), so we also align that to ensure equivalent behavior. This also means we can drop the "workaround" comment here since it no longer is one. Closes borkdude#114. [1] https://github.com/clojure/brew-install/blob/b03428b1b31a8d60573a284d6971fbd3db7b748d/src/main/resources/clojure/install/clojure#L280 [2] https://bugs.openjdk.org/browse/JDK-8280357 [3] https://github.com/clojure/brew-install/blob/dabb82bd011b0510006dd88464f350052adb69b5/src/main/resources/clojure/install/ClojureTools.psm1#L254-L258
The original bash script uses the `HOME` environment variable[1] to determine the user's home directory while we were using thee `user.home` JVM property on non-windows platforms. This turns out to not be equivalent (see e.g. JDK-8280357[2] for a recent issue caused by this). So instead, we now also use the environment variable. As it turns out, the original Powershell script also first checks the `HOME` environment variable[3] before falling back to `USERPROFILE` (which is what we were using so far), so we also align that to ensure equivalent behavior. This also means we can drop the "workaround" comment here since it no longer is one. Closes borkdude#114. [1] https://github.com/clojure/brew-install/blob/b03428b1b31a8d60573a284d6971fbd3db7b748d/src/main/resources/clojure/install/clojure#L280 [2] https://bugs.openjdk.org/browse/JDK-8280357 [3] https://github.com/clojure/brew-install/blob/dabb82bd011b0510006dd88464f350052adb69b5/src/main/resources/clojure/install/ClojureTools.psm1#L254-L258
The original bash script uses the `HOME` environment variable[1] to determine the user's home directory while we were using thee `user.home` JVM property on non-windows platforms. This turns out to not be equivalent (see e.g. JDK-8280357[2] for a recent issue caused by this). So instead, we now also use the environment variable. As it turns out, the original Powershell script also first checks the `HOME` environment variable[3] before falling back to `USERPROFILE` (which is what we were using so far), so we also align that to ensure equivalent behavior. This also means we can drop the "workaround" comment here since it no longer is one. Closes borkdude#114. [1] https://github.com/clojure/brew-install/blob/b03428b1b31a8d60573a284d6971fbd3db7b748d/src/main/resources/clojure/install/clojure#L280 [2] https://bugs.openjdk.org/browse/JDK-8280357 [3] https://github.com/clojure/brew-install/blob/dabb82bd011b0510006dd88464f350052adb69b5/src/main/resources/clojure/install/ClojureTools.psm1#L254-L258
The original bash script uses the `HOME` environment variable[1] to determine the user's home directory while we were using thee `user.home` JVM property on non-windows platforms. This turns out to not be equivalent (see e.g. JDK-8280357[2] for a recent issue caused by this). So instead, we now also use the environment variable. As it turns out, the original Powershell script also first checks the `HOME` environment variable[3] before falling back to `USERPROFILE` (which is what we were using so far), so we also align that to ensure equivalent behavior. This also means we can drop the "workaround" comment here since it no longer is one. Closes #114. [1] https://github.com/clojure/brew-install/blob/b03428b1b31a8d60573a284d6971fbd3db7b748d/src/main/resources/clojure/install/clojure#L280 [2] https://bugs.openjdk.org/browse/JDK-8280357 [3] https://github.com/clojure/brew-install/blob/dabb82bd011b0510006dd88464f350052adb69b5/src/main/resources/clojure/install/ClojureTools.psm1#L254-L258
As @jlesquembre figured out, there is a divergence with how the Clojure CLI shell script constructs the default directory. This is caused by difference in how the user home directory is determined:
deps.clj
uses theuser.home
JVM property while the shell script uses theHOME
environment variable. This has potentially different results on macOS (see link).The text was updated successfully, but these errors were encountered: