Fix dependency scoping with auto-downloaded composer #3493
+17
−4
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.
Summary
The PHP dependency scoping process failed when using auto-downloaded composer because the
scope-dependenciesscript deleted thebuild/directory containing the downloadedcomposer.pharbefore completing.Changes:
build/tools/to.tools/to isolate it from build artifactsscope-dependenciesscript to deferbuild/cleanup until after scoping completes; switched to@composer --working-dirsyntax.tools/composer.pharwhen no global composer exists.tools/directoryThe fix maintains compatibility with both global and auto-downloaded composer installations.
Checklist
Original prompt
This section details on the original issue you should resolve
<issue_title>Dependency scoping incompatible with auto-downloaded composer</issue_title>
<issue_description># IMPORTANT
Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)
Explain the Problem
Since the implementation of the PHP dependency scoping (#3397), it's not possible to build the app using the automatically downloaded composer.
The Makefile installs the latest version of composer into the
build/toolsdirectory if no global installation was found.Command line output
I've figured out how to fix the installation issue inside the composer script but got stuck on the following ones.
Since the 3rd line removes the entire
builddirectory, the containedtoolsdir with the downloaded composer is also gone.But even without it, the 4th line with the
php-scopercall then can't find the composer even when prefixed with@composer exec.As a side note: always nuking the downloaded packages and therefore forcing to redownload everything for every single build seems kinda unnecessary. Maybe there is another solution?
https://github.com/nextcloud/news/blob/7ff338d...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.