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

php84Packages.composer: 2.8.1 -> 2.8.4 #372696

Merged
merged 9 commits into from
Jan 10, 2025
Merged

Conversation

drupol
Copy link
Contributor

@drupol drupol commented Jan 10, 2025

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@piotrkwiecinski
Copy link
Contributor

Does the composer load order fix affect hashes of any packages using builder2?

@drupol
Copy link
Contributor Author

drupol commented Jan 10, 2025

Does the composer load order fix affect hashes of any packages using builder2?

I just tried a few things, and nothing has changed (PHPUnit, PHPStan, PSalm).

This release includes an extra patch to fix reproducible outputs, see composer/composer#12090
@drupol
Copy link
Contributor Author

drupol commented Jan 10, 2025

There is indeed a hash change for all PHP derivations, as the file generated by the autoloaders has been updated. Below is the diff between a build of PHPUnit using Composer 2.8.1 and Composer 2.8.4 (with patch):

❯ nix shell nixpkgs#diffoscopeMinimal
❯ diffoscope result-phpunit-composer-2-8-1 result-phpunit-composer-2-8-4
--- result-phpunit-composer-2-8-1
+++ result-phpunit-composer-2-8-4
├── stat {}
│ @@ -1,7 +1,7 @@
│  
│    Size: 58           Blocks: 0          IO Block: 4096   symbolic link
│  Device: 259,4        Access: (0777/lrwxrwxrwx)  Uid: ( 1000/     pol)   Gid: (  100/   users)
│  
│ -Modify: 2025-01-10 17:47:49.888938828 +0000
│ +Modify: 2025-01-10 17:48:41.563959336 +0000
│   --- result-phpunit-composer-2-8-1/share
├── +++ result-phpunit-composer-2-8-4/share
│ │   --- result-phpunit-composer-2-8-1/share/php
│ ├── +++ result-phpunit-composer-2-8-4/share/php
│ │ │   --- result-phpunit-composer-2-8-1/share/php/phpunit
│ │ ├── +++ result-phpunit-composer-2-8-4/share/php/phpunit
│ │ │ │   --- result-phpunit-composer-2-8-1/share/php/phpunit/vendor
│ │ │ ├── +++ result-phpunit-composer-2-8-4/share/php/phpunit/vendor
│ │ │ │ │   --- result-phpunit-composer-2-8-1/share/php/phpunit/vendor/composer
│ │ │ │ ├── +++ result-phpunit-composer-2-8-4/share/php/phpunit/vendor/composer
│ │ │ │ │ │   --- result-phpunit-composer-2-8-1/share/php/phpunit/vendor/composer/InstalledVersions.php
│ │ │ │ │ ├── +++ result-phpunit-composer-2-8-4/share/php/phpunit/vendor/composer/InstalledVersions.php
│ │ │ │ │ │ @@ -318,25 +318,28 @@
│ │ │ │ │ │      private static function getInstalled()
│ │ │ │ │ │      {
│ │ │ │ │ │          if (null === self::$canGetVendors) {
│ │ │ │ │ │              self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
│ │ │ │ │ │          }
│ │ │ │ │ │  
│ │ │ │ │ │          $installed = array();
│ │ │ │ │ │ +        $copiedLocalDir = false;
│ │ │ │ │ │  
│ │ │ │ │ │          if (self::$canGetVendors) {
│ │ │ │ │ │              foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
│ │ │ │ │ │                  if (isset(self::$installedByVendor[$vendorDir])) {
│ │ │ │ │ │                      $installed[] = self::$installedByVendor[$vendorDir];
│ │ │ │ │ │                  } elseif (is_file($vendorDir.'/composer/installed.php')) {
│ │ │ │ │ │                      /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
│ │ │ │ │ │                      $required = require $vendorDir.'/composer/installed.php';
│ │ │ │ │ │ +                    self::$installedByVendor[$vendorDir] = $required;
│ │ │ │ │ │ +                    $installed[] = $required;
│ │ │ │ │ │ +                    if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
│ │ │ │ │ │ +                        self::$installed = $required;
│ │ │ │ │ │ +                        $copiedLocalDir = true;
│ │ │ │ │ │ -                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
│ │ │ │ │ │ -                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
│ │ │ │ │ │ -                        self::$installed = $installed[count($installed) - 1];
│ │ │ │ │ │                      }
│ │ │ │ │ │                  }
│ │ │ │ │ │              }
│ │ │ │ │ │          }
│ │ │ │ │ │  
│ │ │ │ │ │          if (null === self::$installed) {
│ │ │ │ │ │              // only require the installed.php file if this file is loaded from its dumped location,
│ │ │ │ │ │ @@ -346,14 +349,14 @@
│ │ │ │ │ │                  $required = require __DIR__ . '/installed.php';
│ │ │ │ │ │                  self::$installed = $required;
│ │ │ │ │ │              } else {
│ │ │ │ │ │                  self::$installed = array();
│ │ │ │ │ │              }
│ │ │ │ │ │          }
│ │ │ │ │ │  
│ │ │ │ │ │ +        if (self::$installed !== array() && !$copiedLocalDir) {
│ │ │ │ │ │ -        if (self::$installed !== array()) {
│ │ │ │ │ │              $installed[] = self::$installed;
│ │ │ │ │ │          }
│ │ │ │ │ │  
│ │ │ │ │ │          return $installed;
│ │ │ │ │ │      }
│ │ │ │ │ │  }
│ │ │ │ │ │ ├── stat {}
│ │ │ │ │ │ │ @@ -1,7 +1,7 @@
│ │ │ │ │ │ │  
│ │ │ │ │ │ │ +  Size: 16222            Blocks: 32         IO Block: 4096   regular file
│ │ │ │ │ │ │ -  Size: 16143            Blocks: 32         IO Block: 4096   regular file
│ │ │ │ │ │ │  Device: 259,1    Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
│ │ │ │ │ │ │  
│ │ │ │ │ │ │  Modify: 1970-01-01 00:00:01.000000000 +0000
❯

These changes were introduced in composer/composer#12225.

Please note that even the smallest modifications in these Composer files (both static and dynamic) will force us to recalculate all the hashes. It is crucial to be aware of this when making changes in there. (CC @Seldaek)

@drupol drupol force-pushed the push-lkskvpzuuovv branch from 3aa0b7b to 931d0cf Compare January 10, 2025 17:56
@nix-owners nix-owners bot requested a review from onny January 10, 2025 18:04
@piotrkwiecinski

This comment was marked as outdated.

@nix-owners nix-owners bot requested a review from javaguirre January 10, 2025 18:45
@drupol
Copy link
Contributor Author

drupol commented Jan 10, 2025

@piotrkwiecinski : I made some changes to the builder, can you try again to make sure it doesn't break anything ?

@piotrkwiecinski

This comment was marked as outdated.

@drupol

This comment was marked as outdated.

@piotrkwiecinski

This comment was marked as outdated.

@drupol drupol force-pushed the push-lkskvpzuuovv branch from c762796 to adab75c Compare January 10, 2025 19:52
@drupol
Copy link
Contributor Author

drupol commented Jan 10, 2025

@piotrkwiecinski Feel free to run again nipkgs-review now :)

@piotrkwiecinski
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 372696


x86_64-linux

✅ 98 packages built:
  • adminer
  • agorakit
  • bookstack
  • composer-require-checker
  • davis
  • firefly-iii
  • firefly-iii-data-importer
  • flarum
  • grocy
  • invoiceplane
  • kimai
  • laravel
  • librenms
  • movim
  • n98-magerun
  • n98-magerun2
  • paratest
  • pdepend
  • pest
  • phel
  • php81Packages.box (php82Packages.box ,php83Packages.box ,php84Packages.box)
  • php81Packages.castor
  • php81Packages.composer
  • php81Packages.composer-local-repo-plugin
  • php81Packages.cyclonedx-php-composer
  • php81Packages.deployer
  • php81Packages.grumphp
  • php81Packages.phan
  • php81Packages.phing
  • php81Packages.phive
  • php81Packages.php-codesniffer
  • php81Packages.php-cs-fixer
  • php81Packages.php-parallel-lint
  • php81Packages.phpinsights
  • php81Packages.phpmd
  • php81Packages.phpstan
  • php81Packages.psalm
  • php81Packages.psysh
  • php82Packages.castor
  • php82Packages.composer
  • php82Packages.composer-local-repo-plugin
  • php82Packages.cyclonedx-php-composer
  • php82Packages.deployer
  • php82Packages.grumphp
  • php82Packages.phan
  • php82Packages.phing
  • php82Packages.phive
  • php82Packages.php-codesniffer
  • php82Packages.php-cs-fixer
  • php82Packages.php-parallel-lint
  • php82Packages.phpinsights
  • php82Packages.phpmd
  • php82Packages.phpstan
  • php82Packages.psalm
  • php82Packages.psysh
  • php83Packages.castor
  • php83Packages.composer
  • php83Packages.composer-local-repo-plugin
  • php83Packages.cyclonedx-php-composer
  • php83Packages.deployer
  • php83Packages.grumphp
  • php83Packages.phan
  • php83Packages.phing
  • php83Packages.phive
  • php83Packages.php-codesniffer
  • php83Packages.php-cs-fixer
  • php83Packages.php-parallel-lint
  • php83Packages.phpinsights
  • php83Packages.phpmd
  • php83Packages.phpstan
  • php83Packages.psalm
  • php83Packages.psysh
  • php84Packages.castor
  • php84Packages.composer
  • php84Packages.composer-local-repo-plugin
  • php84Packages.cyclonedx-php-composer
  • php84Packages.deployer
  • php84Packages.grumphp
  • php84Packages.phan
  • php84Packages.phing
  • php84Packages.phive
  • php84Packages.php-codesniffer
  • php84Packages.php-cs-fixer
  • php84Packages.php-parallel-lint
  • php84Packages.phpinsights
  • php84Packages.phpmd
  • php84Packages.phpstan
  • php84Packages.psalm
  • php84Packages.psysh
  • phpactor
  • phpdocumentor
  • phpunit
  • pixelfed
  • roave-backward-compatibility-check
  • robo
  • simplesamlphp
  • snipe-it
  • vimPlugins.phpactor

@drupol
Copy link
Contributor Author

drupol commented Jan 10, 2025

Let's get this in!

@drupol drupol merged commit 85795c7 into NixOS:master Jan 10, 2025
22 checks passed
@drupol drupol added the backport release-24.11 Backport PR automatically label Jan 10, 2025
@drupol drupol deleted the push-lkskvpzuuovv branch January 10, 2025 20:14
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jan 10, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-372696-to-release-24.11 origin/release-24.11
cd .worktree/backport-372696-to-release-24.11
git switch --create backport-372696-to-release-24.11
git cherry-pick -x 097aafd75d76c22eeb6ed5c43c770e50e19c8e5c 8b110c184628ff959a60a6b856bbcc20949ddf0d 709b0eaae01f651fcd8535b4c68fd6b3d61e81b4 7c7fe2ab72c089446b6438b26325ffb284c69e4e d73a407a2bb72d94809b533b329c8654da8456d4 89d2e5eceb52dd9cfeb98b0d3d86a70badf2fae3 0f08212b643e3cb9b38db5838f027753210e7a79 1aeb9801ef6cc324f521a511ff05409227774f84 adab75c7caa20071936ada0766d92adef1f33847

1 similar comment
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jan 10, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-372696-to-release-24.11 origin/release-24.11
cd .worktree/backport-372696-to-release-24.11
git switch --create backport-372696-to-release-24.11
git cherry-pick -x 097aafd75d76c22eeb6ed5c43c770e50e19c8e5c 8b110c184628ff959a60a6b856bbcc20949ddf0d 709b0eaae01f651fcd8535b4c68fd6b3d61e81b4 7c7fe2ab72c089446b6438b26325ffb284c69e4e d73a407a2bb72d94809b533b329c8654da8456d4 89d2e5eceb52dd9cfeb98b0d3d86a70badf2fae3 0f08212b643e3cb9b38db5838f027753210e7a79 1aeb9801ef6cc324f521a511ff05409227774f84 adab75c7caa20071936ada0766d92adef1f33847

drupol added a commit that referenced this pull request Jan 20, 2025
The patch has not been included in the `vendor`, issue introduced in #372696

Context: composer/composer#12263
nixpkgs-ci bot pushed a commit that referenced this pull request Jan 20, 2025
The patch has not been included in the `vendor`, issue introduced in #372696

Context: composer/composer#12263
(cherry picked from commit 8076473)
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.

2 participants