There is no way to know what `bower install' will do #1312

Open
igalic opened this Issue May 22, 2014 · 5 comments

Projects

None yet

5 participants

@igalic
igalic commented May 22, 2014

Disclaimer: I'm an ops person, not a developer. In the following issue report, I'm not endorsing composer, just making a comparison with a package manager that in this particular space does something right.


Right now, there is no way to tell, in advance, if bower install do something.
There is bower check, but that does a long and expensive roundrip to the network.

Contrast this with composer,

igalic@levix ~/src/bw/project2 (git)-[master] % time composer install --dry-run
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing twig/twig (dev-master c2ae310)

  - Installing brainsware/sauce (dev-master 4a733e2)

  - Installing brainsware/bacon (dev-master 6f8708c)

  - Installing minmb/phpmailer (dev-master df44323)

  - Installing fp/lightopenid (dev-master 9bd5d5a)

  - Installing facebook/php-sdk (dev-master b31c5a7)

  - Installing brainsware/php-markdown-extra-extended (dev-master abd156b)

  - Installing brainsware/gallerist (1.2.5)
composer install --dry-run  0,09s user 0,02s system 100% cpu 0,108 total

This returns immediately, and I'm know what I'm up to, when callling

igalic@levix ~/src/bw/project2 (git)-[master] % composer install 
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing twig/twig (dev-master c2ae310)
    Cloning c2ae310203e65987a26d57b87a173b15747a3412

  - Installing brainsware/sauce (dev-master 4a733e2)
    Cloning 4a733e25f1dea115f9bf92176d4d1a464108bea5

  - Installing brainsware/bacon (dev-master 6f8708c)
    Cloning 6f8708cf9ebdd96fc6d65ea6ab2f8d5e8edde98c

  - Installing minmb/phpmailer (dev-master df44323)
    Cloning df443234ad0ca10cbf91a0c0a728b256afcab1d1

  - Installing fp/lightopenid (dev-master 9bd5d5a)
    Cloning 9bd5d5a1d893b2e2fe340b877617a5c1fa9ee807

  - Installing facebook/php-sdk (dev-master b31c5a7)
    Cloning b31c5a7911773a0684e89c7d1d84b0ca575e6cc8

  - Installing brainsware/php-markdown-extra-extended (dev-master abd156b)
    Cloning abd156b968ff9cd993db3c0b2713af36be17d580

  - Installing brainsware/gallerist (1.2.5)
    Cloning 84b9db331269941576f6e613476a28c49a5610b6

Generating autoload files

a subsequent call looks like this,

igalic@levix ~/src/bw/project2 (git)-[master] % time composer install --dry-run
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
composer install --dry-run  0,09s user 0,02s system 99% cpu 0,112 total
igalic@levix ~/src/bw/project2 (git)-[master] %  

contrast this with bower list, which does a network round-trip regardless of state

igalic@levix ~/src/bw/project2 (git)-[master] % time bower list
bower check-new     Checking for new versions of the project dependencies..
wiener wildnis#0.0.1 /home/igalic/src/bw/project2
├── blueimp-file-upload not installed
├── bootstrap not installed
├── bxslider-4 not installed
├── fancybox not installed
├── history.js not installed
├── jquery not installed
├── jquery-hotkeys not installed
├── jquery-ui not installed
├── jquery.rest not installed
├── knockback not installed
├── knockout-sortable not installed
├── medium-editor not installed
├── selectize not installed
└── typeahead.js not installed
bower list  1,01s user 0,21s system 56% cpu 2,170 total
igalic@levix ~/src/bw/project2 (git)-[master] % 

Why is it explicitly running check-new? I didn't tell it to do that? That command is not listed in help… etc… thanks to that, it takes even longer when it's already installed:

igalic@levix ~/src/bw/wiener-wildnis2 (git)-[master] % time bower list
bower check-new     Checking for new versions of the project dependencies..
wiener wildnis#0.0.1 /home/igalic/src/bw/project2
├─┬ blueimp-file-upload#9.5.7
│ ├── blueimp-canvas-to-blob#2.1.0
│ ├── blueimp-load-image#1.11.1
│ ├── blueimp-tmpl#2.5.3
│ └── jquery#1.10.2 (2.1.1 available)
├─┬ bootstrap#3.1.1
│ └── jquery#1.10.2 (2.1.1 available)
├─┬ bxslider-4#4.1.2
│ └── jquery#1.10.2
├── fancybox#2.1.5
├── history.js#1.8.0
├── jquery#1.10.2 (latest is 2.1.1)
├── jquery-hotkeys#0.1.0
├─┬ jquery-ui#1.10.3 (latest is 1.10.4)
│ └── jquery#1.10.2
├── jquery.rest#1.0.2
├─┬ knockback#0.18.4
│ ├─┬ backbone#1.1.2
│ │ └── underscore#1.6.0
│ ├── knockout#3.1.0
│ └── underscore#1.6.0
├── knockout-sortable#0.8.6
├── medium-editor#1.8.8
├─┬ selectize#0.9.1
│ ├── jquery#1.10.2 (2.1.1 available)
│ ├── microplugin#0.0.3
│ └── sifter#0.3.3
└─┬ typeahead.js#0.9.3 (latest is 0.10.2)
  └── jquery#1.10.2 incompatible with ~1.9 (1.9.1 available, latest is 2.1.1)
bower list  1,14s user 0,28s system 46% cpu 3,076 total
igalic@levix ~/src/bw/project2 (git)-[master] %

I am aware that bower install is idempotent, but my problem with it is that I don't know what it will do before executing it.

@igalic igalic changed the title from There is no way to know what `bower install' will do to There is no way to know what `bower install' will do May 22, 2014
@sheerun
Contributor
sheerun commented Jun 19, 2014

Current implementation makes it hard to introduce dry runs. I'm scheduling as low priority on 2.0. Hopefully we'll have better constraint solver by then.

@sheerun sheerun added this to the 2.0.x milestone Jun 19, 2014
@robkinyon

I think the bigger problem is that bower doesn't support multiple versions of the same distributable. Which means bower cannot know what the actions will be without checking the current state of the distributables in question.

@igalic
igalic commented Jan 8, 2015

every month or two, i look at this bug, and wonder if i should publish my puppet module for bower…

@brazorf
brazorf commented Apr 14, 2016

This would be a very useful feature.

@niemyjski

I'd also like to not show prerelease builds: angular#1.5.8 (1.5.9-build.5046+sha.823295f available) on bower list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment