Jobs fail when the project directory structure contains same folder as _WEB_ROOT
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3503613. -->
Reported by: [damian.skiba](https://www.drupal.org/user/2799077)
Related to !348
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When a project includes a <code>composer.json</code> file with dependencies (e.g., <code>drupal/core</code> or other modules), tools like PHPCS and PHPStan perform checks and validations on these dependencies as well.<br>For example:</p>
<ul>
<li><strong>PHPCS checks validation in dependencies:</strong> <a href="https://git.drupalcode.org/project/droopler/-/jobs/4201053">Log example</a>.</li>
<li><strong>PHPStan creates symbolic link loops:</strong> <a href="https://git.drupalcode.org/project/droopler/-/jobs/4201054"> Log example</a>.</li>
</ul>
<p>This issue seems related to <a href="https://www.drupal.org/project/gitlab_templates/issues/3502879">this task on drupal.org</a>, as these problems have persisted for two days.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>1. Use the following <code>composer.json</code> configuration:</p>
<pre> "require": {<br> "php": ">=8.1",<br> "bower-asset/colorbox": "^1.6",<br> "bower-asset/masonry": "^4.2",<br> "composer/installers": "^2.2",<br> "cweagans/composer-patches": "^1.6",<br> "drupal/admin_toolbar": "^3.0",<br> "drupal/ala": "^2.5",<br> "drupal/better_exposed_filters": "^7.0",<br> "drupal/block_field": "^1.0@RC",<br> "drupal/bootstrap_layout_builder": "^2.1",<br> "drupal/checklistapi": "^2.0",<br> "drupal/coffee": "^2.0",<br> "drupal/color_field": "^3.0",<br> "drupal/colorbox": "^2.0",<br> "drupal/components": "^3.0",<br> "drupal/conditional_fields": "^4.0@alpha",<br> "drupal/config_update": "2.0.x-dev@dev",<br> "drupal/contact_formatter": "^2.0",<br> "drupal/core-composer-scaffold": "^10.0",<br> "drupal/core-recommended": "^10.0",<br> "drupal/dashboard": "^2.0",<br> "drupal/default_content": "^2.0@alpha",<br> "drupal/emulsify_twig": "^5.0",<br> "drupal/entity_reference_display": "^2.0",<br> "drupal/entity_reference_revisions": "^1.3",<br> "drupal/facets": "^2.0",<br> "drupal/field_group": "^3.0",<br> "drupal/field_validation": "^1.1",<br> "drupal/frontend_editing": "1.7.3",<br> "drupal/gin": "^4.0",<br> "drupal/gin_toolbar": "^2.0",<br> "drupal/google_analytics": "^4.0",<br> "drupal/google_tag": "^2.0",<br> "drupal/link_attributes": "^1.1 || ^2.1",<br> "drupal/menu_admin_per_menu": "^1.6",<br> "drupal/metatag": "^1.2 || ^2.0",<br> "drupal/paragraphs": "^1.1",<br> "drupal/pathauto": "^1.0",<br> "drupal/project_browser": "^1.0@beta",<br> "drupal/radix": "^6.0",<br> "drupal/redirect": "^1.0-beta1",<br> "drupal/redis": "^1.7",<br> "drupal/search_api": "^1.29",<br> "drupal/simple_sitemap": "^4.1",<br> "drupal/smtp": "^1.0@beta",<br> "drupal/svg_image": "^3.0",<br> "drupal/tvi": "2.0.x-dev@dev",<br> "drupal/twig_tweak": "^3.4",<br> "drupal/webform": "^6.2",<br> "drush/drush": "^13",<br> "npm-asset/countup": "^1.9",<br> "npm-asset/in-viewport": "^3.6",<br> "npm-asset/jquery-ui-touch-punch": "^0.2",<br> "npm-asset/select2": "^4.0.4",<br> "npm-asset/slick-carousel": "^1.8",<br> "oomphinc/composer-installers-extender": "^2.0"<br> },</pre><p>
2. Run PHPCS and PHPStan checks</p>
> Related issue: [Issue #3497525](https://www.drupal.org/node/3497525)
> Related issue: [Issue #3503626](https://www.drupal.org/node/3503626)
issue