-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow passing configure options without being a real file #235
Conversation
By removing the `is_file` check we allow installing extensions like this: ```bash bin/pickle install --source --with-configure-options <(echo --with-rdkafka=/opt/homebrew/opt/librdkafka) rdkafka ``` No more need to create a file with the options first.
console option?
…On Thu, Jul 29, 2021, 6:04 PM Ruud Kamphuis ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/Base/Abstracts/Console/Command/BuildCommand.php
<#235 (comment)>:
> @@ -101,7 +101,7 @@ protected function buildOptions(Package $package, InputInterface $input, OutputI
$force_opts = $input->getOption('with-configure-options');
if ($force_opts) {
- if (!file_exists($force_opts) || !is_file($force_opts) || !is_readable($force_opts)) {
+ if (!file_exists($force_opts) || !is_readable($force_opts)) {
Does somebody know why this variable is snake_case instead of camelCase?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#235 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACE6KGGXHHJ57DS72XCTU3T2EYSVANCNFSM5BGHHWYA>
.
|
I remember something about console arguments and options using this as a
norm. Also in 2021 it can use the defined CS :)
…On Thu, Jul 29, 2021, 6:35 PM Ruud Kamphuis ***@***.***> wrote:
@pierrejoye <https://github.com/pierrejoye> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACE6KD4LUCY5MPCXMYXJILT2E4ILANCNFSM5BGHHWYA>
.
|
In Pickle? AFAIK there is no other way than configuration with So I would suggest to merge this, as it allows for a better UX. |
Can this be merged? |
What about replacing || !is_file($force_opts) with || !(is_file($force_opts) || is_link($force_opts)) instead of removing that check? |
We can try, but why does this has to be so strict? If it's readable, it's fine, right? Otherwise an error will be thrown for something unexpected. |
PS: $ php -r 'var_dump(is_file($argv[1]) || is_link($argv[1]));' .
bool(false)
$ php -r 'var_dump(is_file($argv[1]) || is_link($argv[1]));' <(echo 'this is a test')
bool(true)
|
Because it may be a directory. Another alternative would be to replace |
@mlocati Applied your feedback :) Thanks! |
Thanks @mlocati 💙 |
I tried it out with 0.7.5 but it doesn't work anymore:
|
What's the error? Is something like this one?
If so, the error should be fixed by #237 |
@mlocati I'll test it now |
Sorry for not posting the error immediately, that was my intention. This is what I get:
|
That's really strange... Here's what I have in an Ubuntu 20.04 with PHP 7.4:
(and that error is fixed by #237) What's your environment? |
macOS Big Sur PHP 8.0 |
@ruudk What do you have if you run this command in a terminal window? php -r 'var_dump($argv);' <(echo ciao) |
|
So, this is a problem of the mac, not of pickle... |
I don't know how this suddenly happened because when I proposed the PR I obviously tested this and it worked. |
Oke, the problem is with Fish Shell. It works properly in Bash:
|
When I try 0.7.5 in Bash I get:
|
I have a different error:
Could you check if this works for you? php -r 'var_dump(file_get_contents(str_replace("/dev/", "php://", $argv[1])));' <(echo ciao) |
Yes!
Also in Fish:
|
Great, thanks for confirming! So, #237 should fix the issue |
Thanks for being so persistent in solving this 👏 |
I've just published version 0.7.6 with the related patch. |
By removing the
is_file
check we allow installing extensions like this:bin/pickle install --source \ --with-configure-options <(echo --with-rdkafka=/opt/homebrew/opt/librdkafka) rdkafka
No more need to create a file with the options first 🎉