Skip to content

Conversation

@liammcdermott
Copy link

Fix composerFlags regression in buildComposerProject2. Issue #475198

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot requested a review from philiptaron December 30, 2025 01:54
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: php PHP is a general-purpose scripting language geared towards web development. labels Dec 30, 2025
@liammcdermott liammcdermott force-pushed the hotfix/fix-composer-flags branch 2 times, most recently from 1d2a80b to 1992b33 Compare December 30, 2025 01:58
composerNoPlugins ? finalAttrs.composerNoPlugins or true,
composerNoScripts ? finalAttrs.composerNoScripts or true,
composerNoDev ? true,
composerNoPlugins ? true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why those changes ? And why not doing the same to other parameters ?

Copy link
Author

Choose a reason for hiding this comment

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

Why those changes ?

Those parameters need to be added to the top-level attrset, and I got an infinite recursion error without this change.

And why not doing the same to other parameters ?

The default parameter values were already a mishmash where some provided default values and others referenced finalAttrs, so I just made the minimal change necessary to fix the bug.

Moreover, I'm not 100% certain what the practical difference is between the different styles, but I did test that removing references to finalAttrs didn't break the functionality of composerNoDev, composerNoPlugins, and composerNoScripts.

Should I make the same change for composerLock, vendorHash, and composerStrictValidation?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to ask @ShamrockLee for their PoV too on this, as I am a bit unsure.

Copy link
Contributor

Choose a reason for hiding this comment

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

finalAttrs: { x ? finalAttrs.x or true }: { inherit x; } logically results in infinite recursion.

The expression before this change probably sets x as true silently due to the lack of inherit x;.

Copy link
Contributor

Choose a reason for hiding this comment

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

What would you recommend to do here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It just came to me that the intention of the original author (of all those { x ? finalAttrs.x or default }) is to effectively construct a let-in block with x = finalAttrs.x. I was persuaded into thinking that it would work when reviewing the change.

We need to get it fixed before it is forgotten, but the diff size and complexity would be greater than what we are changing now. We should place the finalAttrs fix in a subsequent PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry in advance if this question may be dumb but... To me this PR is complete, do you suggest something else to do in another PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry in advance if this question may be dumb but... To me this PR is complete, do you suggest something else to do in another PR?

Copy link
Contributor

@ShamrockLee ShamrockLee Dec 31, 2025

Choose a reason for hiding this comment

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

To me this PR is complete, do you suggest something else to do in another PR?

Yes. Sorry for making this out-of-context comments.

This PR is removing the hints of wrong implementation by cleaning up its leftovers, just bringing it up so that people going through this PR would be aware of the TBD fix.

Perhaps I should open an issue or simply create the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please do it, so I can also see what you have in mind :)

@liammcdermott liammcdermott force-pushed the hotfix/fix-composer-flags branch from 1992b33 to 14f900d Compare December 30, 2025 21:29
@drupol
Copy link
Contributor

drupol commented Dec 31, 2025

@liammcdermott Mind running nixpkgs-review with --post-result flag ?

I want to make sure this change doesn't break any derivation using this builder.

You could try to run some commands locally to verify:

nix-build -A phpunit, etc etc...

[[ 1 == "${composerNoDev:-1}" ]] && composerFlags+=(--no-dev)
[[ 1 == "${composerNoPlugins:-1}" ]] && composerFlags+=(--no-plugins)
[[ 1 == "${composerNoScripts:-1}" ]] && composerFlags+=(--no-scripts)
[[ "${composerNoDev:-0}" == 1 ]] && composerFlags+=(--no-dev)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-picking:

People typically do test -n and test -z, which is what $stdenv/setup.sh is using.

Suggested change
[[ "${composerNoDev:-0}" == 1 ]] && composerFlags+=(--no-dev)
[[ -n "${composerNoDev-}" ]] && composerFlags+=(--no-dev)

(I cannot do multi-line comment on mobile GitHub pages, so please help fix other lines as well.)

@ShamrockLee
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 475201
Commit: f68916eb447e7d9647b1c4e59a1ed5d7e7193129 (subsequent changes)
Merge: 2af526f71b99d35c4373ddbebfe2085991bab447

Logs: https://github.com/ShamrockLee/nixpkgs-review-gha/actions/runs/20612647504


x86_64-linux

❌ 6 packages failed to build:
  • firefly-iii
  • kimai
  • movim
  • php82Packages.php-codesniffer
  • php83Packages.php-codesniffer
  • phpPackages.php-codesniffer (php84Packages.php-codesniffer)
✅ 74 packages built:
  • adminer
  • agorakit
  • baikal
  • bookstack
  • composer-require-checker
  • davis
  • deployer
  • drupal
  • engelsystem
  • firefly-iii-data-importer
  • flarum
  • grocy
  • laravel
  • librenms
  • n98-magerun2
  • paratest
  • part-db
  • pdepend
  • pest
  • phel
  • phpPackages.box (php82Packages.box)
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • phpPackages.castor (php84Packages.castor)
  • phpPackages.composer (php84Packages.composer)
  • phpPackages.composer-local-repo-plugin (php84Packages.composer-local-repo-plugin)
  • phpPackages.cyclonedx-php-composer (php84Packages.cyclonedx-php-composer)
  • phpPackages.grumphp (php84Packages.grumphp)
  • phpPackages.phan (php84Packages.phan)
  • phpPackages.phing (php84Packages.phing)
  • phpPackages.phive (php84Packages.phive)
  • phpPackages.php-cs-fixer (php84Packages.php-cs-fixer)
  • phpPackages.php-parallel-lint (php84Packages.php-parallel-lint)
  • phpPackages.phpinsights (php84Packages.phpinsights)
  • phpPackages.phpmd (php84Packages.phpmd)
  • phpPackages.phpstan (php84Packages.phpstan)
  • phpPackages.psalm (php84Packages.psalm)
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • postfixadmin
  • pretty-php
  • psysh
  • roave-backward-compatibility-check
  • robo
  • snipe-it
  • vimPlugins.phpactor

Error logs: `x86_64-linux`
firefly-iii
Aborting git mirror sync of https://github.com/phpstan/phpstan-deprecation-rules.git as network is disabled
  - Downloading phpstan/phpstan-strict-rules (2.0.7)
    Failed to download phpstan/phpstan-strict-rules from dist: Network disabled, request canceled: https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538
    Now trying to download from source
  - Syncing phpstan/phpstan-strict-rules (2.0.7) into cache
Aborting git mirror sync of https://github.com/phpstan/phpstan-strict-rules.git as network is disabled
  - Downloading thecodingmachine/phpstan-safe-rule (v1.4.3)
    Failed to download thecodingmachine/phpstan-safe-rule from dist: Network disabled, request canceled: https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/5c804889253ce9498ef185e108e9f94b6023208e
    Now trying to download from source
  - Syncing thecodingmachine/phpstan-safe-rule (v1.4.3) into cache
Aborting git mirror sync of https://github.com/thecodingmachine/phpstan-safe-rule.git as network is disabled

In HttpDownloader.php line 329:

Network disabled, request canceled: https://api.github.com/repos/phpstan/ph
pstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

kimai
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.
Problem 2
- lorenzo/pinky is locked to version 1.1.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
Problem 3
- twig/inky-extra is locked to version v3.22.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
- twig/inky-extra v3.22.0 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.1.0].

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/zc1v3c5sqbm9kazc0h9rzp17w4ihw2ih-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-xsl to temporarily ignore these required extensions.

movim
Running phase: composerInstallConfigureHook
Setting COMPOSER_ROOT_VERSION to 0.32.1
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/zc1v3c5sqbm9kazc0h9rzp17w4ihw2ih-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-imagick to temporarily ignore these required extensions.

php82Packages.php-codesniffer
Setting COMPOSER_ROOT_VERSION to 4.0.0
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Cannot create cache directory /homeless-shelter/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.

In HttpDownloader.php line 329:

Network disabled, request canceled: https://repo.packagist.org/packages.jso
n

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]


aarch64-linux

❌ 6 packages failed to build:
  • firefly-iii
  • kimai
  • movim
  • php82Packages.php-codesniffer
  • php83Packages.php-codesniffer
  • phpPackages.php-codesniffer (php84Packages.php-codesniffer)
✅ 74 packages built:
  • adminer
  • agorakit
  • baikal
  • bookstack
  • composer-require-checker
  • davis
  • deployer
  • drupal
  • engelsystem
  • firefly-iii-data-importer
  • flarum
  • grocy
  • laravel
  • librenms
  • n98-magerun2
  • paratest
  • part-db
  • pdepend
  • pest
  • phel
  • phpPackages.box (php82Packages.box)
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • phpPackages.castor (php84Packages.castor)
  • phpPackages.composer (php84Packages.composer)
  • phpPackages.composer-local-repo-plugin (php84Packages.composer-local-repo-plugin)
  • phpPackages.cyclonedx-php-composer (php84Packages.cyclonedx-php-composer)
  • phpPackages.grumphp (php84Packages.grumphp)
  • phpPackages.phan (php84Packages.phan)
  • phpPackages.phing (php84Packages.phing)
  • phpPackages.phive (php84Packages.phive)
  • phpPackages.php-cs-fixer (php84Packages.php-cs-fixer)
  • phpPackages.php-parallel-lint (php84Packages.php-parallel-lint)
  • phpPackages.phpinsights (php84Packages.phpinsights)
  • phpPackages.phpmd (php84Packages.phpmd)
  • phpPackages.phpstan (php84Packages.phpstan)
  • phpPackages.psalm (php84Packages.psalm)
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • postfixadmin
  • pretty-php
  • psysh
  • roave-backward-compatibility-check
  • robo
  • snipe-it
  • vimPlugins.phpactor

Error logs: `aarch64-linux`
firefly-iii
Aborting git mirror sync of https://github.com/phpstan/phpstan-deprecation-rules.git as network is disabled
  - Downloading phpstan/phpstan-strict-rules (2.0.7)
    Failed to download phpstan/phpstan-strict-rules from dist: Network disabled, request canceled: https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538
    Now trying to download from source
  - Syncing phpstan/phpstan-strict-rules (2.0.7) into cache
Aborting git mirror sync of https://github.com/phpstan/phpstan-strict-rules.git as network is disabled
  - Downloading thecodingmachine/phpstan-safe-rule (v1.4.3)
    Failed to download thecodingmachine/phpstan-safe-rule from dist: Network disabled, request canceled: https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/5c804889253ce9498ef185e108e9f94b6023208e
    Now trying to download from source
  - Syncing thecodingmachine/phpstan-safe-rule (v1.4.3) into cache
Aborting git mirror sync of https://github.com/thecodingmachine/phpstan-safe-rule.git as network is disabled

In HttpDownloader.php line 329:

Network disabled, request canceled: https://api.github.com/repos/phpstan/ph
pstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

kimai
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.
Problem 2
- lorenzo/pinky is locked to version 1.1.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
Problem 3
- twig/inky-extra is locked to version v3.22.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
- twig/inky-extra v3.22.0 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.1.0].

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/3bv66a3i6ccpmcxvs5in0vxkwfsj5nlr-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-xsl to temporarily ignore these required extensions.

movim
Running phase: composerInstallConfigureHook
Setting COMPOSER_ROOT_VERSION to 0.32.1
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/3bv66a3i6ccpmcxvs5in0vxkwfsj5nlr-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-imagick to temporarily ignore these required extensions.

php82Packages.php-codesniffer
Setting COMPOSER_ROOT_VERSION to 4.0.0
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Cannot create cache directory /homeless-shelter/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.

In HttpDownloader.php line 329:

Network disabled, request canceled: https://repo.packagist.org/packages.jso
n

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]


x86_64-darwin (sandbox = relaxed)

❌ 5 packages failed to build:
  • kimai
  • movim
  • php82Packages.php-codesniffer
  • php83Packages.php-codesniffer
  • phpPackages.php-codesniffer (php84Packages.php-codesniffer)
✅ 72 packages built:
  • adminer
  • agorakit
  • baikal
  • bookstack
  • composer-require-checker
  • davis
  • deployer
  • drupal
  • engelsystem
  • firefly-iii-data-importer
  • flarum
  • grocy
  • laravel
  • n98-magerun2
  • paratest
  • pdepend
  • pest
  • phel
  • phpPackages.box (php82Packages.box)
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • phpPackages.castor (php84Packages.castor)
  • phpPackages.composer (php84Packages.composer)
  • phpPackages.composer-local-repo-plugin (php84Packages.composer-local-repo-plugin)
  • phpPackages.cyclonedx-php-composer (php84Packages.cyclonedx-php-composer)
  • phpPackages.grumphp (php84Packages.grumphp)
  • phpPackages.phan (php84Packages.phan)
  • phpPackages.phing (php84Packages.phing)
  • phpPackages.phive (php84Packages.phive)
  • phpPackages.php-cs-fixer (php84Packages.php-cs-fixer)
  • phpPackages.php-parallel-lint (php84Packages.php-parallel-lint)
  • phpPackages.phpinsights (php84Packages.phpinsights)
  • phpPackages.phpmd (php84Packages.phpmd)
  • phpPackages.phpstan (php84Packages.phpstan)
  • phpPackages.psalm (php84Packages.psalm)
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • postfixadmin
  • pretty-php
  • psysh
  • roave-backward-compatibility-check
  • robo
  • snipe-it
  • vimPlugins.phpactor

Error logs: `x86_64-darwin`
kimai
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.
Problem 2
- lorenzo/pinky is locked to version 1.1.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
Problem 3
- twig/inky-extra is locked to version v3.22.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
- twig/inky-extra v3.22.0 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.1.0].

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/f8p067vigk85q5hfxwzq4nymzdvjljy0-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-xsl to temporarily ignore these required extensions.

movim
Running phase: composerInstallConfigureHook
Setting COMPOSER_ROOT_VERSION to 0.32.1
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/f8p067vigk85q5hfxwzq4nymzdvjljy0-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-imagick to temporarily ignore these required extensions.

php82Packages.php-codesniffer
Setting COMPOSER_ROOT_VERSION to 4.0.0
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Cannot create cache directory /homeless-shelter/Library/Caches/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.

In HttpDownloader.php line 329:

Network disabled, request canceled: https://repo.packagist.org/packages.jso
n

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]


aarch64-darwin (sandbox = relaxed)

❌ 5 packages failed to build:
  • kimai
  • movim
  • php82Packages.php-codesniffer
  • php83Packages.php-codesniffer
  • phpPackages.php-codesniffer (php84Packages.php-codesniffer)
✅ 72 packages built:
  • adminer
  • agorakit
  • baikal
  • bookstack
  • composer-require-checker
  • davis
  • deployer
  • drupal
  • engelsystem
  • firefly-iii-data-importer
  • flarum
  • grocy
  • laravel
  • n98-magerun2
  • paratest
  • pdepend
  • pest
  • phel
  • phpPackages.box (php82Packages.box)
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • phpPackages.castor (php84Packages.castor)
  • phpPackages.composer (php84Packages.composer)
  • phpPackages.composer-local-repo-plugin (php84Packages.composer-local-repo-plugin)
  • phpPackages.cyclonedx-php-composer (php84Packages.cyclonedx-php-composer)
  • phpPackages.grumphp (php84Packages.grumphp)
  • phpPackages.phan (php84Packages.phan)
  • phpPackages.phing (php84Packages.phing)
  • phpPackages.phive (php84Packages.phive)
  • phpPackages.php-cs-fixer (php84Packages.php-cs-fixer)
  • phpPackages.php-parallel-lint (php84Packages.php-parallel-lint)
  • phpPackages.phpinsights (php84Packages.phpinsights)
  • phpPackages.phpmd (php84Packages.phpmd)
  • phpPackages.phpstan (php84Packages.phpstan)
  • phpPackages.psalm (php84Packages.psalm)
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • postfixadmin
  • pretty-php
  • psysh
  • roave-backward-compatibility-check
  • robo
  • snipe-it
  • vimPlugins.phpactor

Error logs: `aarch64-darwin`
kimai
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-xsl * but it is missing from your system. Install or enable PHP's xsl extension.
Problem 2
- lorenzo/pinky is locked to version 1.1.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
Problem 3
- twig/inky-extra is locked to version v3.22.0 and an update of this package was not requested.
- lorenzo/pinky 1.1.0 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
- twig/inky-extra v3.22.0 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.1.0].

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/vcc1qgjma41h0gxsjjajiz1zgk3x7azf-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-xsl to temporarily ignore these required extensions.

movim
Setting COMPOSER_ROOT_VERSION to 0.32.1
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Cannot create cache directory /homeless-shelter/Library/Caches/composer/files/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1
- Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.

To enable extensions, verify that they are enabled in your .ini files:
- /nix/store/vcc1qgjma41h0gxsjjajiz1zgk3x7azf-php-with-extensions-8.4.16/lib/php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-imagick to temporarily ignore these required extensions.

php82Packages.php-codesniffer
Setting COMPOSER_ROOT_VERSION to 4.0.0
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Cannot create cache directory /homeless-shelter/Library/Caches/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.

In HttpDownloader.php line 329:

Network disabled, request canceled: https://repo.packagist.org/packages.jso
n

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

@drupol
Copy link
Contributor

drupol commented Dec 31, 2025

The kimal build issue is related with these changes. It seems that it is no longer possible to customize the 'php' attribute. We need to find why, this cannot be merged as is.

Copy extra.installer-paths from composerVendor before running composer install so offline builds don't fetch dependencies.
Keep composer in sync with overridden php builds so extension requirements (e.g. xsl) are satisfied.
@nixpkgs-ci nixpkgs-ci bot requested review from PatrickDaG and savyajha January 1, 2026 05:16
@liammcdermott
Copy link
Author

liammcdermott commented Jan 1, 2026

The kimai issue was due to composer defaulting to topLevel.php.packages.composer. If php was set in the parameters but composer was not, then composer would use a different PHP package than the rest of the derivation, then when composer was run and it checked its environment it would find missing dependencies, and for kimai specifically it would throw an error about ext-xsl.

The resolution was to default php to topLevel.php, then default composer to php's composer. When the caller passes in a custom PHP package it will be Composer from that package that's used to run composer install, and not the Composer from topLevel.php. However, if no php parameter is supplied, then php and composer will default to topLevel.php and topLevel.php.packages.composer respectively, which is the desired behaviour. That's in commit c1aad86

Regarding commit 2ca3ef8: when testing this PR with some of our Drupal sites it was necessary to introduce a fix into composer-install-hook.sh, which is also in composer-vendor-hook.sh, and that restores custom vendor directories specified in extra.installer-paths in composer.json. See #373626 for the background on that.

@ShamrockLee thank you for the correction about test -n, that should be resolved in commit 7477477.

The failure of firefly-iii to build was something of a corner case, since it directly invokes composerInstallHook and the default flags (in the hook only) had to be changed to resolve this issue. I changed the firefly-iii package to pass --no-dev and --no-scripts to composer, instead of relying on the defaults, in commit e0584ce

Sorry for the long comment. I'm working on re-running nixpkgs-review now, but since I'm a novice at contributing, I'd be happy if either of you (@drupol or @ShamrockLee) would like to re-run it instead! Never mind. I got it working!

@liammcdermott
Copy link
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 475201
Commit: e0584ce9cb4a2ac0a0699c1fd2294698f69711b8


x86_64-linux

❌ 3 packages failed to build:
  • php82Packages.php-codesniffer
  • php83Packages.php-codesniffer
  • phpPackages.php-codesniffer (php84Packages.php-codesniffer)
✅ 77 packages built:
  • adminer
  • agorakit
  • baikal
  • bookstack
  • composer-require-checker
  • davis
  • deployer
  • drupal
  • engelsystem
  • firefly-iii
  • firefly-iii-data-importer
  • flarum
  • grocy
  • kimai
  • laravel
  • librenms
  • movim
  • n98-magerun2
  • paratest
  • part-db
  • pdepend
  • pest
  • phel
  • phpPackages.box (php82Packages.box)
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • phpPackages.castor (php84Packages.castor)
  • phpPackages.composer (php84Packages.composer)
  • phpPackages.composer-local-repo-plugin (php84Packages.composer-local-repo-plugin)
  • phpPackages.cyclonedx-php-composer (php84Packages.cyclonedx-php-composer)
  • phpPackages.grumphp (php84Packages.grumphp)
  • phpPackages.phan (php84Packages.phan)
  • phpPackages.phing (php84Packages.phing)
  • phpPackages.phive (php84Packages.phive)
  • phpPackages.php-cs-fixer (php84Packages.php-cs-fixer)
  • phpPackages.php-parallel-lint (php84Packages.php-parallel-lint)
  • phpPackages.phpinsights (php84Packages.phpinsights)
  • phpPackages.phpmd (php84Packages.phpmd)
  • phpPackages.phpstan (php84Packages.phpstan)
  • phpPackages.psalm (php84Packages.psalm)
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • postfixadmin
  • pretty-php
  • psysh
  • roave-backward-compatibility-check
  • robo
  • snipe-it
  • vimPlugins.phpactor

Error logs: `x86_64-linux`
php82Packages.php-codesniffer
Setting COMPOSER_ROOT_VERSION to 4.0.0
Finished phase: composerInstallConfigureHook
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: composerInstallBuildHook
Setting some required environment variables for Composer...
Restoring Composer vendor directory to 'vendor'...
Generating optimized autoloader and restoring 'bin' directory...
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Cannot create cache directory /homeless-shelter/.cache/composer/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.

In HttpDownloader.php line 329:

Network disabled, request canceled: https://repo.packagist.org/packages.jso
n

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

@liammcdermott
Copy link
Author

liammcdermott commented Jan 1, 2026

For me those php-codesniffer packages also fail to build on master, so I'm assuming those failures are unrelated (?)

vendorHash = "sha256-fLL0FAhd8r2igiZZ+wb1gse+vembHS6rzUnKe9LXXmI=";
};

composerNoDev = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this required? Are those attributes not true by default ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: php PHP is a general-purpose scripting language geared towards web development. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants