Problem/Motivation
The Drupal installer uses a 2-phase kernel boot with an in-process kernel reboot:
1. Phase 1 (InstallerServiceProvider): In-memory stubs (no DB services). Used from start through install_base_system.
2. Kernel reboot in drupal_install_system(): shutdown() => rebuildContainer() => boot() to switch providers.
3. Phase 2 (NormalInstallerServiceProvider): Database-backed services for the remainder.
This adds complexity: two service provider classes, an in-process kernel reboot, and the base_system_verified flag to pick between them.
Main blocker: InstallStorage is read-only (throws on write). System module install needs to WRITE config. So the kernel reboots to switch to DatabaseStorage first.
There's prerequisites (last 2 probably optional)
- #3335756: Drop sequences table in Drupal 12
- #2719315: Remove unnecessary system.module path setup in installer
- #2934063: Remove the workaround in \Drupal\Core\Installer\ExtensionListTrait::setPathname()
Proposed resolution
Create InstallerFallbackConfigStorage + merged service provider
ModuleInstaller::install() already triggers a container rebuild internally. If we set base_system_verified = TRUE before calling module_installer->install(['system']), the rebuild picks up the flag and registers full DB-backed services (without an explicit kernel reboot).
Merge NormalInstallerServiceProvider into InstallerServiceProvider and deprecate first one.
Remove kernel reboot from drupal_install_system()
Remaining tasks
- possibly listAll() will need deduplication (DB and install stroages)
- dig URL generation and Routing
- find out risks & edge cases
- probably should wait for D12.1 for deprecation
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3574200
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andypostGonna try to hack it with some LLM later
Comment #4
andypostComment #5
catchThis will have small conflicts with #3614153: Install system module alongside other modules in the installer but I think it potentially allows us to remove a fourth container rebuild from installs alongside #3614401: Allow install profiles to opt out of being installed and #3614825: Allow additional modules to be installed alongside the profile modules.
Comment #6
catchClean rebase on main - seeing what tests look like.
Comment #7
catchTests aren't too bad - just a couple of fails.
This removes one container rebuild, but it also appears to result in one extra module install, not sure why that is but it might be easier to work on once the system and $modules property issues than which reduce modules installs in general.
Comment #8
catchDid another rebase after #3614153: Install system module alongside other modules in the installer landed.
The couple of test fails have magically disappeared, either that issue helped or they were random failures. Also the extra module install has magically disappeared too, might have been bad profiling on my part.
#3615455: Install database driver modules alongside other modules will also conflict with this a bit, but I think in such a way that the code that needs changing will be deleted in HEAD. edit: just confirmed that, one line conflict in code that gets removed so easy to resolve.
I have not actually reviewed the code changes here still, just rebasing and manual testing to make sure it's really eliminating the container rebuild successfully without breaking anything.
Comment #9
andypostrebased as the last blocker commited #2934063: Remove the workaround in \Drupal\Core\Installer\ExtensionListTrait::setPathname()
other conflicts may appear as #5/#8 said
Comment #10
catchNeeds another rebase, but most of the related installer issues have landed so might be a bit more of a stable basis to work from after this one.
Comment #11
andypostrebased and did rework as the changes (summarized by Opus)
02579164af8 — #3615455 Install database driver modules alongside other modules (the conflicting one)
Removed the driver-module install from drupal_install_system() and moved it into install.core.inc as _install_get_database_module_name(), consumed by install_profile_modules() (unshifted onto the module list) and install_recipe_required_modules(). This is what caused both conflicts and killed your $container_rebuilt flag.
6a4608b15d4 — #3614401 Allow install profiles to opt out of being installed
Adds opt_out_install to the profile info; in drupal_install_system() the core.extension profile key is now cleared when either profile === FALSE or the profile opts out. Merged cleanly into your version of that function — the || !empty($install_state['profile_info']['opt_out_install']) line in the current file is theirs.
6a9373d79a2 — #3614825 Allow additional modules alongside profile modules
Adds an additional_modules hook into install_profile_modules() (used by FunctionalTestSetupTrait to cut container rebuilds during tests). No conflict, but it's the same code path your rebuild change lives next to.
66241ddc48b — #3590964 Install/update-time cache overrides support MemoryCacheInterface
Touches NormalInstallerServiceProvider.php — the class you're deprecating and folding into InstallerServiceProvider. Worth confirming that fix carried into your merged provider rather than being stranded in the deprecated one; that's one of the things the review agent is checking.
1ef5fe7376f — #3616720 Fix change record links
Docs only; touched InstallerTestBase.php and ModuleInstaller.php comments. Irrelevant.
Comment #12
nicxvan commentedPlease don't do per commit summaries with AI, I think it just adds noise and length to the comments.
Comment #13
andypostIMO it's very helpful for rebases as it provides enough context why I had to make this changes, and after 7 months it helping to ressurect knowledge and intersect with latest changes
Comment #14
catchOverall this looks encouraging.
The main actual code changes are merging the installer service providers together, and the config install fallback storage.
Left some nits. I'm also personally not sure what the new test coverage is actually getting us here - we run the installer thousands of times every push to an MR, so to what extent is the explicit test coverage going to find things we're not going to find anyway. Also found some of the test logic hard to follow.
Comment #15
andypostDiscussed with @catch and @longwave and there's agreement that removal of provider could be done even in minor release as installer is not a part of BC and the provider is not used in contrib (no way to override it)