Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Composer, apache/thrift keep lib/php only #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbaltas
Copy link

@dbaltas dbaltas commented Apr 14, 2019

This PR aims to reduce disk usage.
apache/thrift comes with the whole C++ implementation of the software, plus with libraries for ~25 programming languages.

By removing the unnecessary files and folders, we end up with 560K of dependencies instead of 19MB.

This issue becomes more of a concern to projects that commit the vendor/ directory.

master

9:25:07 ➜  opencensus-php-exporter-jaeger git:(master)  rm -rf vendor
9:25:12 ➜  opencensus-php-exporter-jaeger git:(master)  composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
### more composer output here
Generating autoload files
9:25:19 ➜  opencensus-php-exporter-jaeger git:(master)  du -hs vendor/apache/thrift
 19M	vendor/apache/thrift

composer-thrift-keep-php-lib-only

9:25:34 ➜  opencensus-php-exporter-jaeger git:(composer-thrift-keep-php-lib-only)  rm -rf vendor
9:25:38 ➜  opencensus-php-exporter-jaeger git:(composer-thrift-keep-php-lib-only)  composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
### more composer output here
> cd vendor/apache/thrift && ls | grep -v lib | xargs rm -rf
/tmp/opencensus-php-exporter-jaeger/vendor/apache/thrift
> cd vendor/apache/thrift/lib && ls | grep -v php | xargs rm -rf
/tmp/opencensus-php-exporter-jaeger/vendor/apache/thrift/lib
9:25:46 ➜  opencensus-php-exporter-jaeger git:(composer-thrift-keep-php-lib-only)  du -hs vendor/apache/thrift
560K	vendor/apache/thrift

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@dbaltas
Copy link
Author

dbaltas commented Apr 14, 2019

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@dbaltas
Copy link
Author

dbaltas commented Apr 14, 2019

Hmm, it seems that in circle-ci, the composer install command does not execute the composer script for post-install-cmd.
For example the php 7.2 build here should include the following commands in the output.

> cd vendor/apache/thrift && ls | grep -v lib | xargs rm -rf
/tmp/opencensus-php-exporter-jaeger/vendor/apache/thrift
> cd vendor/apache/thrift/lib && ls | grep -v php | xargs rm -rf
/tmp/opencensus-php-exporter-jaeger/vendor/apache/thrift/lib

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

Successfully merging this pull request may close these issues.

None yet

2 participants