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

'which' is deprecated in Debian sid #88

Closed
wants to merge 1 commit into from

Conversation

kingdonb
Copy link
Contributor

I did some research and it seems there is no canonical implementation of Which in ruby standard lib proper, but there is ptools that adds which to the File class. This is really tricky to diagnose, because they didn't just soft-deprecate it, (it seems it has been replaced with a non-functioning version that emits the warning instead of the path to the target, or at least the emitting of the warning seems to have side-effects that were hard to trace back from my recollection...)

So for users who have this issue on their systems, it manifests as unexplained failure and this is basically the only thing I found particularly worthy of sending back as a PR, from the changes I made in my fork! HTH

Using the `which` binary on a Debian sid installation today emits
deprecation warnings that suggest using `command -v` instead.

Unfortunately I found that on my MacOS install I found that
/usr/bin/command is a shell script:

builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}

as well as a shell builtin:
$ command -v command
command

...which is not helpful from Ruby.

I did some research and it seems there is no canonical implementation of
Which in ruby standard lib proper, but there is ptools that adds which
to the File class.

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
@camertron
Copy link
Member

Oof, sorry about that @kingdonb! I remember writing this code and feeling a bit weird about shelling out to which, but it was the easiest thing to do at the time, so I just left it.

I like your solution, but I'm hesitant to add another gem to kuby-core, especially to bring in just one method. What would you think about copy/pasting the which method from ptools? It looks like ptools is licensed under Artistic 2.0. I believe copy/pasting is ok under the licensing terms, with proper attribution back to the original.

@kingdonb
Copy link
Contributor Author

I wasn't going to suggest that, but it's what I was thinking too...

@camertron
Copy link
Member

I ended up copying the code from ptools into kuby-core. Updated code is in master, should be releasing this week :)

@camertron camertron closed this May 2, 2022
@kingdonb
Copy link
Contributor Author

kingdonb commented May 2, 2022

Amazing, I have a new Rails 7.1 project and I was thinking about trying to use Kuby to deploy it 💯 Thanks for the heads-up!

@kingdonb kingdonb deleted the contrib-0.16 branch May 2, 2022 18:54
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.

None yet

2 participants