Problem/Motivation

Doing Drupal core development currently involves getting a git clone of core, then installing dependencies with Composer, and then having a non-clean git repo because of the changes Composer makes to files such as composer.lock.

Developers then have to keep stashing and unstashing these changes, and dealing with conflicts every time something changes in composer.lock.

This situation is made even worse if a developer wants to install tools to help with development, such as Drush or Devel module, as the composer.lock file will have more changes.

Steps to reproduce

Try to get set up to work on core:

1. git clone core
2. do composer install

Notice that the git clone now has changes which are going to be a pain to deal with all the time.

Proposed resolution

Provide a Composer project template which links in a git clone of Drupal core as a Composer file repository. This means that anything can be installed into the project without affecting Drupal core files.

Proof of concept at https://github.com/joachim-n/drupal-core-composer.

Remaining tasks

- Fix #1792310: Wrong DRUPAL_ROOT with non-standard code structure, as many workarounds in the joachim-n/drupal-core-composer template are needed because of this
- move the project template into Drupal core
- add it to the d.org developer documentation

User interface changes

API changes

Data model changes

Comments

joachim created an issue. See original summary.

greggles’s picture

I read through this and think that making it easier to develop code is an important one, for sure.

It's been a little while since this was filed so I wonder if you think things have changed since you filed it?

joachim’s picture

Issue summary: View changes

Since I filed this issue:

- lots of people are using the https://github.com/joachim-n/drupal-core-composer Composer project -- including DrupalPod!
- I've added Composer scripts to handle all the installation steps. Installing a Drupal project with this template is now a single command (including cloning Drupal core!)
- I've made a lot of progress on #1792310: Wrong DRUPAL_ROOT with non-standard code structure. Fixing this would remove the need for the special tweaks in the installation of this project (the symlinks and patches). There are just a few failing tests on that issue which I am working through.

I've updated the IS to reflect this.

greggles’s picture

Heh, I guess "things have changed" in part because you're continuing the effort. Thanks for that!

catch’s picture

Project: Drupal core ideas » Drupal core
Version: » 11.x-dev
Component: Proposed Plan » base system
Status: Active » Postponed

Moving to core given the ideas queue is deprecated, but postponing on #1792310: Wrong DRUPAL_ROOT with non-standard code structure

catch’s picture

Issue tags: +Moved from Ideas queue

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

joachim’s picture

joachim’s picture

Issue summary: View changes