Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The compiled container stores fully qualified paths which cause issues for example if you clear the cache from your host machine when using Docker.
Example:
'container.namespaces' => array(
'Drupal\\block' => '/var/www/html/app/core/modules/block/src',
'Drupal\\block_content' => '/var/www/html/app/core/modules/block_content/src',
'Drupal\\breakpoint' => '/var/www/html/app/core/modules/breakpoint/src',
Proposed resolution
Only store the paths relative to the Drupal root.
Remaining tasks
Write a patch
User interface changes
n/a
API changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#6 | 2400261-6.patch | 1.77 KB | dawehner |
#4 | drupal-2400261.patch | 2.52 KB | tobiasb |
Comments
Comment #1
dawehnerNote: Making it relative also decreases the size of the container file a bit.
Comment #2
benjy CreditAttribution: benjy commentedNot sure what this might break.
Comment #4
tobiasbThx @dawehner for the help. ;-)
Comment #6
dawehnerThis could be it.
Comment #7
Fabianx CreditAttribution: Fabianx commentedGenerally +1 to this, RTBM.
Major, because FileReadOnlyStorage is else impossible.
Also as the container currently is shared across web heads via file_system, makes differently configured web heads problematic.
I will need to re-roll my classmap loader patch once that is in, but that is okay.
Comment #8
alexpottMaking the service container more transportable is nice. This issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed f144ac6 and pushed to 8.0.x. Thanks!