Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

install_on_warmup: true not working #52

Closed gusdecool closed 10 years ago

gusdecool commented 10 years ago

Install on warmup not working. Still need to do sp:bower:install manually

i use: bower version 1.2.7 sp/bower version dev-master (at this time post created)

Spea commented 10 years ago

What do you mean by "it is not working"? Do you get any errors?

gusdecool commented 10 years ago

It means, after i clear the cache. spBower did not recreate the cache itself. I still need use sp:bower:install manually.

Spea commented 10 years ago

Can you describe the exact steps you made which caused this issue? I'm not able to reproduce it on my locale machine

gusdecool commented 10 years ago

i will try to reinstall your plugin and inform you the exact step i use.

On Tue, Nov 5, 2013 at 6:53 AM, Martin Parsiegla notifications@github.comwrote:

Can you describe the exact steps you made which caused this issue? I'm not able to reproduce it on my locale machine

— Reply to this email directly or view it on GitHubhttps://github.com/Spea/SpBowerBundle/issues/52#issuecomment-27731245 .

Budi Arsana

Flexi: 62 361 8607816 Website: www.gusdecool.com Email: gusdecool@gmail.com or me@gusdecool.com

Spea commented 10 years ago

Thanks!

kaiwa commented 10 years ago

Just want to confirm that something seems to go wrong at that point.

$ app/console cache:clear
Clearing the cache for the dev environment with debug true

No exception while clearing the cache, but as soon as assetic comes into play:

Cannot import resource "." from "/var/cache/project/dev/assetic/routing.yml".
(Dependency cache keys not yet generated, run "app/console sp:bower:install" to initiate the cache:
Cached dependencies for "/var/cache/project/dev/sp_bower" not found, create it with the method createDependencyMappingCache().)

Config:

sp_bower:
  install_on_warmup: true

  bundles:
      .......
kaiwa commented 10 years ago

I looked into this and found out something is getting messed up in the ExecListener::onPreExec

This is the sp_bower cache folder after running app/console cache:clear with ExecListener enabled:

drwxrwxr-x+  3 user user 4,0K Nov 16 16:27 2ad43dfb77837bda/
drwxrwxr-x+  3 user user 4,0K Nov 16 16:27 30a71e5d66058b51/
-rw-rw-r--+  1 user user  130 Nov 16 16:27 bower.json
-rw-rw-r--+  1 user user  222 Nov 16 16:27 .bowerrc

This is not working.

And this is the same folder while completely disabling the ExecListener::onPreExec:

drwxrwxr-x+  3 user user 4,0K Nov 16 16:25 30a71e5d66058b51/
drwxrwxr-x+  3 user user 4,0K Nov 16 16:25 6b40530473bac44e/
drwxrwxr-x+  3 user user 4,0K Nov 16 16:25 fd1df1ad5de88703/

-> works.

And these are the configs passed to the listener (2 bundles configured in config file):

object(Sp\BowerBundle\Bower\Configuration)#2095 (4) {
  ["directory":protected]=>
  string(73) "/home/user/projects/private/project/src/Project/UBundle/Resources/config"
  ["assetDirectory":protected]=>
  string(103) "/home/user/projects/private/project/src/Project/UBundle/Resources/config/../../../../../web/components"
  ["jsonFile":protected]=>
  string(10) "bower.json"
  ["endpoint":protected]=>
  string(27) "https://bower.herokuapp.com"
}
object(Sp\BowerBundle\Bower\Configuration)#2261 (4) {
  ["directory":protected]=>
  string(76) "/home/user/projects/private/project/src/Project/LBundle/Resources/config"
  ["assetDirectory":protected]=>
  string(106) "/home/user/projects/private/project/src/Project/LBundle/Resources/config/../../../../../web/components"
  ["jsonFile":protected]=>
  string(10) "bower.json"
  ["endpoint":protected]=>
  string(27) "https://bower.herokuapp.com"
}
object(Sp\BowerBundle\Bower\Configuration)#2095 (4) {
  ["directory":protected]=>
  string(73) "/home/user/projects/private/project/src/Project/UBundle/Resources/config"
  ["assetDirectory":protected]=>
  string(103) "/home/user/projects/private/project/src/Project/UBundle/Resources/config/../../../../../web/components"
  ["jsonFile":protected]=>
  string(10) "bower.json"
  ["endpoint":protected]=>
  string(27) "https://bower.herokuapp.com"
}
object(Sp\BowerBundle\Bower\Configuration)#2261 (4) {
  ["directory":protected]=>
  string(76) "/home/user/projects/private/project/src/Project/LBundle/Resources/config"
  ["assetDirectory":protected]=>
  string(106) "/home/user/projects/private/project/src/Project/LBundle/Resources/config/../../../../../web/components"
  ["jsonFile":protected]=>
  string(10) "bower.json"
  ["endpoint":protected]=>
  string(27) "https://bower.herokuapp.com"
}

Finally i was not able to find the exact reason as i didn't understood the concepts completely yet. Maybe you have an idea what's going on @Spea, as you know what the expected behaviour is.

kaiwa commented 10 years ago

Ah one more thing i forgot to mention, it works when warming up the cache manually after cache:clear:

$ app/console cache:clear && app/console cache:warmup

Spea commented 10 years ago

I will dig into this issue a little more. I already have an idea what could cause this, but I have to see :)

gusdecool commented 10 years ago

@kaiwa Thank kaiwa. @Spea Hi Spea, that's the same step i use. Hopefully you can fix it. I assume this issue is valid. Will look if i have time to fix it for us :)

musonic commented 10 years ago

Any progress on this? I've got the same issue.

Spea commented 10 years ago

I'm a little busy lately, but I'm going to fix issue till the end of the week.

Spea commented 10 years ago

I reworked the cache creation, please try the latest master and let me know, if you still run into this issue.

kaiwa commented 10 years ago

:+1: its working, thanks a lot