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

php: add config.php.mysqlnd option #31170

Merged
merged 4 commits into from Nov 11, 2017
Merged

php: add config.php.mysqlnd option #31170

merged 4 commits into from Nov 11, 2017

Conversation

jbboehr
Copy link
Contributor

@jbboehr jbboehr commented Nov 3, 2017

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

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.

@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 3, 2017

Looks like the Travis build failed due to #20491

@jbboehr jbboehr changed the title php: add config.php.mysqlnd option [WIP] php: add config.php.mysqlnd option Nov 4, 2017
@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 4, 2017

Got the error: configure: error: Cannot find MySQL header files under . Note that the MySQL client library is not bundled anymore!

@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 6, 2017

Error was due to a misplaced =

@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 6, 2017

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.

@jbboehr jbboehr changed the title [WIP] php: add config.php.mysqlnd option php: add config.php.mysqlnd option Nov 8, 2017
@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 8, 2017

Travis should be passing now.

@orivej @Mic92 Any thoughts on this PR?

@orivej
Copy link
Contributor

orivej commented Nov 8, 2017

A downside of your approach is that config.php.mysqld is set aside from other configuration options and is not as easily discoverable. I have not seen composableDerivation machinery before, and I was not able to achieve what you are trying to do here with it. @MarcWeber, could you help us?

@@ -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 ];
Copy link
Member

@Mic92 Mic92 Nov 8, 2017

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

Copy link
Contributor

@orivej orivej Nov 8, 2017

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 1cff740

@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 9, 2017

A downside of your approach is that config.php.mysqld is set aside from other configuration options and is not as easily discoverable

To be completely honest, I have no idea how the cfg section or composableDerivation work. I would've added it to the cfg section but the enable switches need to be passed the value mysqlnd, and there was a precedent for passing it in in the location I chose in this PR.

I have not seen composableDerivation machinery before, and I was not able to achieve what you are trying to do here with it.

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

Copy link
Contributor

@orivej orivej left a 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.

@jbboehr
Copy link
Contributor Author

jbboehr commented Nov 9, 2017

@orivej Ah ok. I believe I tried the same thing originally and experienced the same issue.

@orivej orivej merged commit 4b6f20c into NixOS:master Nov 11, 2017
@jbboehr jbboehr deleted the php-mysqlnd-m branch February 14, 2018 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants