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
php: add config.php.mysqlnd option #31170
Conversation
Looks like the Travis build failed due to #20491 |
Got the error: |
Error was due to a misplaced |
4ca8251
to
d04eb04
Compare
d04eb04
to
41cd4f2
Compare
Well, Travis seems to be failing and I don't think it's my fault (famous last words), so I will try merging master in later. |
A downside of your approach is that |
@@ -11,6 +11,8 @@ let | |||
|
|||
let php7 = lib.versionAtLeast version "7.0"; | |||
mysqlHeaders = mysql.lib.dev or mysql; | |||
mysqlndSupport = config.php.mysqlnd or false; | |||
mysqlBuildInputs = if mysqlndSupport then [] else [ mysqlHeaders ]; |
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.
- mysqlBuildInputs = if mysqlndSupport then [] else [ mysqlHeaders ];
+ mysqlBuildInputs = lib.optional (!mysqlndSupport) mysqlHeaders;
UPDATE fixed conditions
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.
You've reversed the condition.
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.
Applied in 1cff740
To be completely honest, I have no idea how the
Can you clarify what you mean by 'I was not able to achieve what you are trying to do here with it'? Thanks for taking the time to review this PR, @orivej @Mic92 |
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.
Can you clarify what you mean by 'I was not able to achieve what you are trying to do here with it'?
I've read the definition of composableDerivation
and tried to move mysqlnd
into cfg
. In the end this failed because I could not read cfg
from flags and I could not affect one flag from another.
@orivej Ah ok. I believe I tried the same thing originally and experienced the same issue. |
Motivation for this change
Adds support for PHP's native MySQL driver. See #31167 - issues using mysqlclient. This PR is meant as an example for my proposal.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)I've only tested that the extensions loaded and displayed the proper driver version, not it's actual functionality, nor any of the other PHP functionality.