halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
455 stars 86 forks source link

Use BSD stat on macOS even if sha256sum is installed #108

Closed joschi closed 3 years ago

joschi commented 4 years ago

Fixes #107

bdellegrazie commented 3 years ago

@halcyon any chance of getting this merged please? We're seeing the same issue on some of our developer's systems for exactly the same reason (gnu coreutils on MacOS path overriding BSD stat)

halcyon commented 3 years ago

Yes @bdellegrazie . Sorry about this falling through the cracks, I didn't see this. I'll review it now.

halcyon commented 3 years ago

@bdellegrazie After looking carefully on my mac, I'd like to understand more. Why is /usr/local/opt/coreutils/libexec/gnubin part of PATH? Is homebrew being used to install/manage coreutils?. This looks like it could be an environment configuration issue.

bdellegrazie commented 3 years ago

@halcyon Developers frequently install coreutils via brew and normally these are only visible on the path via their g prefix (e.g. gstat) however there is documentation on how to "replace" BSD utilities with their GNU equivalents to simplify some development focused activities. This is a matter of personal preference and relates to their specific use-case.

You're absolutely correct that its a configuration issue but it's also not something that can be easily worked around by the user without significant impact. The simplest solution, since we're expecting BSD type utilities is to explicitly specify the path which will ensure the correct behaviour.

An alternate option might be to get ASDF to expose common functions for these types of tools which can be overridden by a user who installs coreutils and maps it in the path. That would arguably solve this problem for all plugins but is substantially higher complexity.

joschi commented 3 years ago

@halcyon Anything we can do to move this PR forward?