Skip to content

Conversation

@phfroidmont
Copy link

As suggested in #240, adds support for all stable php versions from https://github.com/fossar/nix-phps

@DavHau
Copy link
Member

DavHau commented Mar 4, 2023

Thanks for that.
According to the readme of nix-phps: There is also a php package which is the alias of the default PHP version in Nixpkgs.
Can we ensure that the nixpkgs php remains the preferred choice over the other php packages?

@tinybeachthor pinging you in case you'd like tor review this.

# php with required extensions
php =
if satisfies pkgs.php81.version subsystemAttrs.phpSemver
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
phpPackages = l.attrValues (import inputs.phps).packages.x86_64-linux;

Copy link
Author

Choose a reason for hiding this comment

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

For my own understanding, what does import do here?

Copy link
Member

Choose a reason for hiding this comment

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

Instead of treating inputs.php like a flake, it treats it as a path and imports it. Currently we have a failing CI tests, because under some circumstances inputs.php is a path and not a flake. This is buggy behavior in our backward compat mechanism which I don't intend to fix anymore in favor of the upcoming v1 API changes.

# php with required extensions
php =
if satisfies pkgs.php81.version subsystemAttrs.phpSemver
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
phpPackages = l.attrValues (import inputs.phps).packages.x86_64-linux;

# php with required extensions
php =
if satisfies pkgs.php81.version subsystemAttrs.phpSemver
phpPackages = l.attrValues inputs.phps.packages.x86_64-linux;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably does not make much difference, maybe passing system attribute here instead of hard-coding x86_64-linux.

@phfroidmont
Copy link
Author

php being first on the list it will be the first considered if I'm not mistaken.
Still, I can add a bit of logic to ensure it is always considered first, no matter the ordering of the list.

@aszenz
Copy link
Contributor

aszenz commented Jun 27, 2023

Will php still work with the V1 api?

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.

4 participants