build(dependencies): scope dependencies in lib/Vendor - #2136
Merged
Conversation
blizzz
requested review from
Koc,
benjaminfrueh,
enjeck,
juliusknorr,
silverkszlo and
susnux
November 3, 2025 19:34
blizzz
force-pushed
the
fix/2133/scoping
branch
3 times, most recently
from
November 3, 2025 20:23
024f391 to
e2496ad
Compare
benjaminfrueh
approved these changes
Nov 3, 2025
Koc
approved these changes
Nov 4, 2025
enjeck
reviewed
Nov 4, 2025
Comment on lines
+49
to
+64
| "post-install-cmd": [ | ||
| "composer bin all install --ansi", | ||
| "vendor/bin/php-scoper add-prefix --force", | ||
| "@php .lib-vendor-organizer.php lib/Vendor/ OCA\\\\Tables\\\\Vendor", | ||
| "cat .scoper-production-dependencies | uniq | xargs -I {} rm -Rf vendor/{} # Remove origins", | ||
| "cat .scoper-production-dependencies | cut -d / -f1 | uniq | xargs -I {} rmdir vendor/{} || true # Remove empty directories", | ||
| "composer dump-autoload -o" | ||
| ], | ||
| "post-update-cmd": [ | ||
| "composer bin all update --ansi", | ||
| "vendor/bin/php-scoper add-prefix --force", | ||
| "@php .lib-vendor-organizer.php lib/Vendor/ OCA\\\\Tables\\\\Vendor", | ||
| "cat .scoper-production-dependencies | uniq | xargs -I {} rm -Rf vendor/{} # Remove origins", | ||
| "cat .scoper-production-dependencies | cut -d / -f1 | uniq | xargs -I {} rmdir vendor/{} || true # Remove empty directories", | ||
| "composer dump-autoload -o" | ||
| ] |
Contributor
There was a problem hiding this comment.
At what point does one run these new commands? After installing any new library?
Member
Author
There was a problem hiding this comment.
with composer install and composer update, and effectively also with composer require and uninstall. Cf. https://getcomposer.org/doc/articles/scripts.md
Contributor
There was a problem hiding this comment.
Oooh, cool. What about for scoper:update-deps? When do I run it?
Member
Author
There was a problem hiding this comment.
After installing, updating or removing a dependency. But CI will also tell you.
enjeck
reviewed
Nov 4, 2025
enjeck
reviewed
Nov 4, 2025
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
blizzz
force-pushed
the
fix/2133/scoping
branch
from
November 4, 2025 20:08
e2496ad to
159912f
Compare
enjeck
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #2133
Introduces php-scoper to scope our production dependencies (incl. its dependencies 馃檭)
Pretty much close to what I described at https://arthur-schiwon.de/isolating-nextcloud-app-dependencies-php-scoper once upon a time, with a few adjustments.
鈩癸笍 When running this branch, or after merging to main, a
composer install [--no-dev]becomes necessary.