Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

depend_on_asset doesn't depend_on #557

Closed
matthewd opened this issue Apr 11, 2014 · 2 comments
Closed

depend_on_asset doesn't depend_on #557

matthewd opened this issue Apr 11, 2014 · 2 comments

Comments

@matthewd
Copy link

Hi!

While working on rails/sprockets-rails#126, I discovered that (at least in 2.11.0, which Rails is temporarily effectively stuck on) depend_on_asset causes a dependency upon the named asset's dependencies, but not on the asset itself.

dependencies is (quite reasonably) defined as not including the asset itself: https://github.com/sstephenson/sprockets/blob/2.x/lib/sprockets/bundled_asset.rb#L62-65

But when processing _dependency_paths, we only record entries for the dependencies of asset: https://github.com/sstephenson/sprockets/blob/2.x/lib/sprockets/processed_asset.rb#L136-139

I haven't looked as closely, but at a glance, it sounds like master has the same behaviour: https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/processed_asset.rb#L126-127


Is this intended? The internal uses of depend_on_asset suggest not, to me.

If it is in fact unintentional... is there any chance of us getting a 2.11.2 (building from 2.11.0, and pretending 2.11.1 didn't exist), or even a 2.11.0.1? (And presumably a 2.11.x branch to temporarily support it)

We obviously all want to get the incompatibility sorted out properly, and soon... but in the meantime, it sure makes me nervous that part of the Rails default gem suite has a hard <= dep.

❤️

@josh
Copy link
Contributor

josh commented Jul 2, 2014

The assets own mtime is always checked as a dependency. So assets are always dependent on themselves regardless of depend_on.

@josh josh closed this as completed Jul 2, 2014
@matthewd
Copy link
Author

matthewd commented Jul 2, 2014

That's not what I'm describing: we fail to check the mtime of the file named in the depend_on_asset line.

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

No branches or pull requests

2 participants