Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive -> Exclude behavior: Expectation doesn't meet! #11987

Closed
abmmhasan opened this issue May 20, 2024 · 2 comments
Closed

Archive -> Exclude behavior: Expectation doesn't meet! #11987

abmmhasan opened this issue May 20, 2024 · 2 comments

Comments

@abmmhasan
Copy link

My composer.json:

"archive": {
    "exclude": [
      "/tests",
      "/docs",
      "/.github",
      "/.readthedocs.yaml",
      "/captainhook.json",
      "/phpunit.xml",
      "/pint.json",
      "/rector.php"
    ]
  }

Output of composer diagnose:

Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: No git process found
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: ##########
Dev Public Key Fingerprint: #########
OK
Checking Composer version: OK
Checking Composer and its dependencies for vulnerabilities: OK
Composer version: 2.7.6
PHP version: 8.2.18
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 3.0.11 19 Sep 2023
curl version: 7.88.1 libz 1.2.13 ssl OpenSSL/3.0.11
zip: extension not loaded, unzip present, 7-Zip not available

When I run this command:

composer install --prefer-dist -vvv

I get the following output:

Running 2.7.6 (2024-05-04 23:03:15) with PHP 8.2.18 on Linux / 5.15.133.1-microsoft-standard-WSL2
Reading ./composer.json (/var/www/html/test/composer.json)
Loading config file ./composer.json (/var/www/html/test/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html/test): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing command (/var/www/html/test): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/var/www/html/test): git log --pretty="%H" -n1 HEAD
Executing command (/var/www/html/test): hg branch
Executing command (/var/www/html/test): fossil branch list
Executing command (/var/www/html/test): fossil tag list
Executing command (/var/www/html/test): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/devuser/.composer/composer.json

No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/packages.json from cache
Downloading https://repo.packagist.org/packages.json if modified
[304] https://repo.packagist.org/packages.json
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-infocyph~intermix.json from cache
Downloading https://repo.packagist.org/p2/infocyph/intermix.json if modified
[304] https://repo.packagist.org/p2/infocyph/intermix.json
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-psr~container.json from cache
Downloading https://repo.packagist.org/p2/psr/container.json if modified
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-symfony~cache.json from cache
Downloading https://repo.packagist.org/p2/symfony/cache.json if modified
[304] https://repo.packagist.org/p2/psr/container.json
[304] https://repo.packagist.org/p2/symfony/cache.json
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-psr~cache.json from cache
Downloading https://repo.packagist.org/p2/psr/cache.json if modified
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-psr~log.json from cache
Downloading https://repo.packagist.org/p2/psr/log.json if modified
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-symfony~cache-contracts.json from cache
Downloading https://repo.packagist.org/p2/symfony/cache-contracts.json if modified
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-symfony~service-contracts.json from cache
Downloading https://repo.packagist.org/p2/symfony/service-contracts.json if modified
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-symfony~var-exporter.json from cache
Downloading https://repo.packagist.org/p2/symfony/var-exporter.json if modified
[304] https://repo.packagist.org/p2/psr/cache.json
[304] https://repo.packagist.org/p2/psr/log.json
[304] https://repo.packagist.org/p2/symfony/cache-contracts.json
[304] https://repo.packagist.org/p2/symfony/service-contracts.json
[304] https://repo.packagist.org/p2/symfony/var-exporter.json
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-psr~cache.json from cache
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-psr~container.json from cache
Reading /home/devuser/.composer/cache/repo/https---repo.packagist.org/provider-symfony~deprecation-contracts.json from cache
Downloading https://repo.packagist.org/p2/symfony/deprecation-contracts.json if modified
[304] https://repo.packagist.org/p2/symfony/deprecation-contracts.json
Built pool.
Running pool optimizer.
Pool optimizer completed in 0.002 seconds
Found 149 package versions referenced in your dependency graph. 67 (45%) were optimized away.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.
Something's changed, looking at all rules again (pass #1)
Dependency resolution completed in 0.000 seconds
Analyzed 82 packages to resolve dependencies
Analyzed 110 rules to resolve dependencies
Lock file operations: 9 installs, 0 updates, 0 removals
Installs: symfony/var-exporter:v7.0.7, symfony/deprecation-contracts:v3.5.0, psr/container:2.0.2, symfony/service-contracts:v3.5.0, psr/cache:3.0.0, symfony/cache-contracts:v3.5.0, psr/log:3.0.0, symfony/cache:v7.0.7, infocyph/intermix:3.01.2
  - Locking infocyph/intermix (3.01.2) from composer repo (https://repo.packagist.org)
  - Locking psr/cache (3.0.0) from composer repo (https://repo.packagist.org)
  - Locking psr/container (2.0.2) from composer repo (https://repo.packagist.org)
  - Locking psr/log (3.0.0) from composer repo (https://repo.packagist.org)
  - Locking symfony/cache (v7.0.7) from composer repo (https://repo.packagist.org)
  - Locking symfony/cache-contracts (v3.5.0) from composer repo (https://repo.packagist.org)
  - Locking symfony/deprecation-contracts (v3.5.0) from composer repo (https://repo.packagist.org)
  - Locking symfony/service-contracts (v3.5.0) from composer repo (https://repo.packagist.org)
  - Locking symfony/var-exporter (v7.0.7) from composer repo (https://repo.packagist.org)
Writing lock file
Installing dependencies from lock file (including require-dev)
Reading ./composer.lock (/var/www/html/test/composer.lock)
Package operations: 9 installs, 0 updates, 0 removals
Installs: symfony/var-exporter:v7.0.7, symfony/deprecation-contracts:v3.5.0, psr/container:2.0.2, symfony/service-contracts:v3.5.0, psr/cache:3.0.0, symfony/cache-contracts:v3.5.0, psr/log:3.0.0, symfony/cache:v7.0.7, infocyph/intermix:3.01.2
Reading /home/devuser/.composer/cache/files/symfony/var-exporter/349ecf91a840f54b2dd3b3871247f1b524ce5e50.zip from cache
  - Loading symfony/var-exporter (v7.0.7) from cache
Reading /home/devuser/.composer/cache/files/symfony/deprecation-contracts/1643d4f62a5ceb67697f445ba484c6c2ce34337d.zip from cache
  - Loading symfony/deprecation-contracts (v3.5.0) from cache
Reading /home/devuser/.composer/cache/files/psr/container/a0a43e15cb16e3ab95a991e1bffc813474b15cdf.zip from cache
  - Loading psr/container (2.0.2) from cache
Reading /home/devuser/.composer/cache/files/symfony/service-contracts/742b79d014f79413e888178ab24e2adefffe43ef.zip from cache
  - Loading symfony/service-contracts (v3.5.0) from cache
Reading /home/devuser/.composer/cache/files/psr/cache/b7eac5d329f3f43db02b28fa0fef1a15080f3536.zip from cache
  - Loading psr/cache (3.0.0) from cache
Reading /home/devuser/.composer/cache/files/symfony/cache-contracts/677e6b30a6719a417a6ef357e2fbbb5fb288683a.zip from cache
  - Loading symfony/cache-contracts (v3.5.0) from cache
Reading /home/devuser/.composer/cache/files/psr/log/4109d4b3f74b78a13cb175029bcb2384f59f0a52.zip from cache
  - Loading psr/log (3.0.0) from cache
Reading /home/devuser/.composer/cache/files/symfony/cache/4c69fbdb869392891a8f091470980471a34c171b.zip from cache
  - Loading symfony/cache (v7.0.7) from cache
Reading /home/devuser/.composer/cache/files/infocyph/intermix/a5b8aef4a5ff2a39b98da560d04543878fa7d79d.zip from cache
  - Loading infocyph/intermix (3.01.2) from cache
  - Installing symfony/var-exporter (v7.0.7): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-b520ca46b1e6595e6f1754b276a65144.zip' -d '/var/www/html/test/vendor/composer/6bd4934e'
  - Installing symfony/deprecation-contracts (v3.5.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-7036dc8e71d36d25ad14ddcd3b57bbf6.zip' -d '/var/www/html/test/vendor/composer/1b502737'
  - Installing psr/container (2.0.2): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-7cdb858b36b4e162448d05c2f88b8626.zip' -d '/var/www/html/test/vendor/composer/3b32fc85'
  - Installing symfony/service-contracts (v3.5.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-1ceecae435096eb389a9630bd6bd1246.zip' -d '/var/www/html/test/vendor/composer/bd660baf'
  - Installing psr/cache (3.0.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-3b57a9ef3a5f46fe9b6f74018acf8f47.zip' -d '/var/www/html/test/vendor/composer/d12fa2f1'
  - Installing symfony/cache-contracts (v3.5.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-2fa8ac1bad59236aa0ac715caedf5196.zip' -d '/var/www/html/test/vendor/composer/ecdb9c29'
  - Installing psr/log (3.0.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-2d5d08630291d2a930b1d64d3ab4ff54.zip' -d '/var/www/html/test/vendor/composer/ca4556e5'
  - Installing symfony/cache (v7.0.7): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-a4edd28528897b656a2456977c8f97b1.zip' -d '/var/www/html/test/vendor/composer/f8ca46ef'
  - Installing infocyph/intermix (3.01.2): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/var/www/html/test/vendor/composer/tmp-c4f28f88e35c5a351d3dd0d5fd58f966.zip' -d '/var/www/html/test/vendor/composer/d247c0bf'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/1b502737'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/3b32fc85'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/ecdb9c29'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/d12fa2f1'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/bd660baf'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/ca4556e5'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/6bd4934e'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/f8ca46ef'
Executing async command (CWD): rm -rf '/var/www/html/test/vendor/composer/d247c0bf'
Downloading https://packagist.org/downloads/
[201] https://packagist.org/downloads/
Generating autoload files
5 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

And I expected this to happen:

Why is it still keeping the files & folders stated in exclude section? Shouldn't it remove it already?

@glaubinix
Copy link
Contributor

The archive configuration in your composer.json file is only used to create archive files via the composer archive command. If you want to make sure those folders aren't included in the default ZIP files created by GitHub, GitLab, and Bitbucket, then the recommend way is to exclude them via . gitattributes.

@abmmhasan
Copy link
Author

Thanks a lot! I got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants