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

phpfpm: eliminate build at evaluation time #23216

Merged
merged 1 commit into from
Feb 26, 2017
Merged

phpfpm: eliminate build at evaluation time #23216

merged 1 commit into from
Feb 26, 2017

Conversation

fkz
Copy link
Contributor

@fkz fkz commented Feb 26, 2017

Motivation for this change

phpfpm currently uses readFile to read the php.ini file from the phpPackage. This causes php to be build at evaluation time.

This eliminates the use of readFile and builds the php.ini at build time.

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
    • Linux
  • 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/) (used the phpfpm service)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@fkz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bjornfor, @ericsagnes and @bluescreen303 to be potential reviewers.

${cfg.phpOptions}
'';

phpIni = pkgs.stdenv.mkDerivation {
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, some variaton of

pkgs.runCommand "php.ini" { inherit (cfg) phpPackage phpOptions; } ''
  cat $phpPackage/etc/php.ini > $out
  echo $phpOptions >> $out
''

Copy link
Member

Choose a reason for hiding this comment

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

You can use passAsFile:

pkgs.runCommand "php.ini" { inherit (cfg) phpPackage phpOptions; passAsFile = [ "phpOptions" ]; } ''
  cat $phpPackage/etc/php.ini $phpOptionsFile > $out
''

phpfpm currently uses `readFile` to read the php.ini file from the
phpPackage. This causes php to be build at evaluation time.

This eliminates the use of readFile and builds the php.ini at build
time.
@fkz
Copy link
Contributor Author

fkz commented Feb 26, 2017

@joachifm @abbradar thanks for your hints; updated my PR accordingly

@globin globin merged commit ae67f06 into NixOS:master Feb 26, 2017
@danbst
Copy link
Contributor

danbst commented Mar 7, 2017

This has broken php.ini customizations via services.phpfpm.phpOptions in 17.03

fpletz added a commit that referenced this pull request Mar 7, 2017
Broken due to #23216.

(cherry picked from commit d7674da)
fpletz added a commit that referenced this pull request Mar 7, 2017
@fpletz
Copy link
Member

fpletz commented Mar 7, 2017

@danbst Fixed. Thanks!

adrianpk added a commit to adrianpk/nixpkgs that referenced this pull request May 31, 2024
Broken due to NixOS#23216.

(cherry picked from commit d7674da)
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

7 participants