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

CommentFileSizeAuthor
#6 2400261-6.patch1.77 KBdawehner
#4 drupal-2400261.patch2.52 KBtobiasb
#2 2400261-2.patch669 bytesbenjy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Note: Making it relative also decreases the size of the container file a bit.

benjy’s picture

Status: Active » Needs review
FileSize
669 bytes

Not sure what this might break.

Status: Needs review » Needs work

The last submitted patch, 2: 2400261-2.patch, failed testing.

tobiasb’s picture

Status: Needs work » Needs review
FileSize
2.52 KB

Thx @dawehner for the help. ;-)

Status: Needs review » Needs work

The last submitted patch, 4: drupal-2400261.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.77 KB

This could be it.

Fabianx’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Generally +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.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Making 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!

  • alexpott committed f144ac6 on 8.0.x
    Issue #2400261 by benjy, dawehner, tobiasb: Service Container should not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.