-
Notifications
You must be signed in to change notification settings - Fork 54
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
mupen64plus-input-raphnetraw: don't hard-code pkg-config #296
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use this. "which" is less likely to be installed than "pkg-config".
"command -v" is a portable (POSIX mandated) equivalent to "which".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mupen64plus-core also uses
which
there though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then mupen64plus-core, too, is wrong. :)
My attention was attracted here because @orbea implemented this change for Gentoo and I reviewed that change. I'm not directly familiar with this ecosystem though I am always happy to provide tips such as this one when I'm made aware of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Informative reading :) https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I'd consider using
which
to be wrong per se, especially considering how widespread the usage of that command is in general.It's just a dependency which exists, it's neither right or wrong in my opinion, and changing it for the sake of changing it is possible but I don't feel like it matters much because almost every linux system has
which
available or installed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used multiple Linux distros where it wasn't available by default.
It is most commonly seen on Debian specifically because Debian has a policy guide saying that the "which" program which they privately wrote from scratch must be installed in the base system in order to be available in dpkg postinst scripts. And sure enough... Debian is trying to purge the use of "which" so they can finally drop that. :)
People often tend to code for Debian specifically. It's unfortunate. The assumption is that since Debian is the numerically largest number of Linux systems, that writing software for "Debian" is the same as writing software for "Linux".
That's an opinion.
I informed you of a fact, however. It is "factual* that it's wrong, and that you cannot even assume that "which" will return success when the command exists and an error when it doesn't. You can't assume it only prints stdout on success. You can't assume its results make sense for your current environment (rather than reading the rc scripts from your interactive shell). You can't assume a lot of things.
It's also quite weird to force people to install a specific dependency in order to query if an entirely different command exists on PATH, since if a user has to manually install something anyway they might as well manually install pkg-config itself. Given the shell can do this built-in... why not use the builtin?
What's the appeal of adding an additional third party dependency that is commonly not installed when the base operating system has a more reliable alternative already?
It's an incredibly simple change, anyway. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only true if you don't consider having to upstream the patch for each project which RMG uses which uses that command, it's time consuming for no real gain.
But if you consider this to be a simple change, then feel free to do so for each upstream project yourself.