Skip to content

Nextcloud: Add phpExtraExtensions#109035

Merged
infinisil merged 4 commits intoNixOS:masterfrom
turion:dev_nextcloud_php
Jan 30, 2021
Merged

Nextcloud: Add phpExtraExtensions#109035
infinisil merged 4 commits intoNixOS:masterfrom
turion:dev_nextcloud_php

Conversation

@turion
Copy link
Copy Markdown
Contributor

@turion turion commented Jan 11, 2021

Motivation for this change

Fixes #107875

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

I tested on my local Nextcloud installation with phpExtraExtensions = all: (with all; [ pdlib bz2 ] );. I could then run the https://apps.nextcloud.com/apps/facerecognition app which needs these extra extensions.

Supersedes #108872.

CC @aanderse @talyz @lheckemann @etu @Ma27 @SuperSandro2000

@turion turion changed the title Dev nextcloud php Nextcloud: Add phpExtraExtensions Jan 11, 2021
@turion turion requested review from Ma27, lheckemann and talyz and removed request for Ma27 and talyz January 11, 2021 17:25
@turion turion force-pushed the dev_nextcloud_php branch from 97fc764 to 6f4bb0a Compare January 11, 2021 17:28
Copy link
Copy Markdown
Member

@aanderse aanderse Jan 11, 2021

Choose a reason for hiding this comment

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

Are apcu, redis, and memcached needed if caching.apcu, caching.redis, and caching.memcached are set to false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Good question. Maybe not. With the new change, we could definitely make these extensions dependent on the options, and it's a good idea if it works.

It seems that the memcached option is actually never used for anything. Is that right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My impression is that in this commit, the extension setting was changed from optionally adding the three caching extensions to always adding them: ed20aae#diff-80ddb2d38f0f6e01125ccb8683381d7be20be1df3dce01e5c200dd74f5173623

So probably the right way forward now is to make them optional again, since this is easy now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No. See nixos/tests/nextcloud/with-mysql-and-memcached.nix.

Are apcu, redis, and memcached needed if caching.apcu, caching.redis, and caching.memcached are set to false?

I don't know. And I'd be especially cautious with apcu as this is something that's something where people often assume that it's "just available".

Is it really worth making this module even more complex to save the closure footprint of a single php extension though?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In that case I would recommend removing those options if they do nothing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. See nixos/tests/nextcloud/with-mysql-and-memcached.nix.

What do you mean? That test manually sets up memcached.

Is it really worth making this module even more complex to save the closure footprint of a single php extension though?

I don't know. Does the PHP extension for redis pull in redis-the-service/package as an additional dependency? Then it would be worth making it configurable. If it's just a few small PHP files, then I agree with @aanderse that the options should be removed, and the documentation adjusted that these extensions can always be assumed to be available.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Ma27 how shall we go forward?

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 11, 2021
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you confirmed whether this is actually fine?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I took this commit from @aanderse . I don't know whether it is correct. It worked on my server, but I didn't tweak this setting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Ma27 as you can see it is applied twice. I looked and confirmed duplicate config was generated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't even evaluate since there's a missing ++.

It may be better to put ++ before a line, then it's also easier to comment a single line out during debugging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Better?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

<xref linkend="opt-..." />.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's confusing. The rest of the document uses the format I took. I don't know what the difference is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The text of the link is generated automatically by <xref />, while it needs to be specified with <link>…</link>. This is used throughout the manuals.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@turion turion force-pushed the dev_nextcloud_php branch from 9005933 to 8adb72e Compare January 20, 2021 19:31
@turion turion requested a review from Ma27 January 20, 2021 19:31
@turion turion force-pushed the dev_nextcloud_php branch from 8adb72e to 1d64cd9 Compare January 20, 2021 20:59
@infinisil infinisil mentioned this pull request Jan 24, 2021
10 tasks
@turion turion force-pushed the dev_nextcloud_php branch from 1d64cd9 to 0ff63a3 Compare January 27, 2021 10:05
@turion
Copy link
Copy Markdown
Contributor Author

turion commented Jan 27, 2021

Rebased onto #110707

@infinisil infinisil merged commit 45a7914 into NixOS:master Jan 30, 2021
@turion turion deleted the dev_nextcloud_php branch July 1, 2021 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make nextcloud php package customizable

5 participants