It would be handy to have a drush make file for the token dependency.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Needs review
FileSize
277 bytes
Dave Reid’s picture

I don't get why this is at all necessary for contrib modules to add? We already define dependencies in our .info files?

boombatower’s picture

Just handy if you are building a site using drush make so it will download the tree of dependencies instead of having to specify all the modules and dependencies in the root. I think it could be proposed the drush_make files be generated or maybe drush make changed to make this more automatic, but since you can depend on something like node_reference and that requires references project the .info and .make do not always include the same information.

For instance I download 18+ modules for a site I'm building with only 4 listed in the site profile.

But currently I have to list pathauto's dependency there instead of just pathauto.

DamienMcKenna’s picture

Maybe this instead we need a drush-make feature request to have it parse the module's info file and pull down dependencies?

greggles’s picture

Title: Add drush make file » Support dependencies in .info files (and recommended modules as well)
Project: Pathauto » Drush Make
Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Active

Maybe this instead we need a drush-make feature request to have it parse the module's info file and pull down dependencies?

Yes, please.

dmitrig01’s picture

Status: Active » Closed (won't fix)

I don't want to run this issue into the ground with a won't fix, but having drush make detect dependencies in .info files simply won't work: dependencies are for modules, whereas drush make downloads projects. Imagine a module that has dependencies[] = content. Drush make will have no idea what to do, as the d.o project is cck.

dmitrig01’s picture

However, contrib modules can define the *projects* on which they depend in their .info files -- they really shouldn't be defining a core project. For example, the last line of Pathauto's info file can read projects[token] = 1. Then running drush make on the .info file would work just fine.

boombatower’s picture

Title: Support dependencies in .info files (and recommended modules as well) » Add drush make file
Project: Drush Make » Pathauto
Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Closed (won't fix) » Needs review

#6 was pointed out already, but the issue is that 90% of dependencies tend to be Drupal projects so in the absence of a make file drush make could attempt to use the .info file. Now the issue that will be run into is when building a tree of projects whether or not one down the line has a bad .info file (modules != projects) and if it does do we stop when we may prefer to have it ignored (as it is now) since we are working around it in our own .make file.

Unless someone has a clever way to work around this I don't think it can happen. Having make files in contrib could also replace the current system used by the testbot to download dependencies.

Although the opposite may be true, once the .info file parsing patch that fixes it is committed we may be able to expose the information similar to the update xml and drush could just look there and download the appropriate items.

DamienMcKenna’s picture

@boombatower: bad info files can be resolved with patches to that specific project.

boombatower’s picture

Not a "bad info file", but one in which the depedencies are not projects. Nothing wrong with that and has to be that way, but doesn't work for drush.

greggles’s picture

I get the technical limitations, but I also feel like it's pretty silly to have to have another file for this.

What about saying "project_depencies[] = token" or something?

boombatower’s picture

As dmitrig01 said in #7 you can do projects[token] = 1 in the .info file.

boombatower’s picture

FileSize
285 bytes

Status: Needs review » Needs work

The last submitted patch, 1048056-drush-make.patch, failed testing.

greggles’s picture

/me needs to read more closely.

Seems good to me - Dave?

Dave Reid’s picture

I still feel like this precedent places the onus and burden on the module developers rather than the site builders using drush make. What if there are two different versions of a module that I integrate with? Why should it be up to the developer to set which version is used? That decision is something that can only be made by the site builders and make file creators.

boombatower’s picture

That's one hell of an edge-case, but having to have all module developers add this is somewhat annoying although much more standard for compiled projects have specific dependency instructions in their make files and what not.

I mean for the rare case a module does integrate with two module apis (would think their would be two versions of the module for simplicities sake)...then don't add the make entries.

I dunno.

greggles’s picture

That does seem pretty edge case and since it doesn't apply to us I think it's OK for Pathauto to add this.

One example is Imageapi and Imageapigd/Imageapiimagemagick, but those are all bundled together instead of being separate items, right?

dmitrig01’s picture

I don't feel it's that edge-case-y, and another potential problem is that sometimes projects contain sets of modules, some of which contain other modules and some of which don't, and I don't necessarily want ALL of those modules (for example, features contains Features Test module which depends on SimpleTest, but on 90% of sites I don't want that). I don't think it should be up to the .make-file-writer to have to decide which modules to turn downloading *off*

boombatower’s picture

That is simply a wrong usage of dependencies as I have stated more times then I can count. Test modules should not depend on SimpleTest...they are hidden from the interface and the only code that enables them is inside a test (simpletest is not enabled in the testing environment....but is when you depend on it for absolutely no reason)...it is implied...having the dependency causes this problem and the SimpleTest queue to get flooded with non-developers asking how to set it up since they just try to meet all requirements.

You don't see C/C++ projects have a make file with instructions for all the dependencies in a parent project...just not the point of this type of system. It is much more useful when each project contains instructions on how to set itself up.

Recently I have been using it heavily to build out 20+ modules for sites and it is just tedious, hard to manage, and annoying to list dependencies of modules way out in the tree in the root make file. It also doesn't make sense in 99% of situations. Once you manage to wrangle the make file together it is extremely useful and makes it much much easier to setup and update the code.

All the arguments against this have been either ones of duplicity between the .info file and make file, but no one can come up with a clean solution for that since they are not equivalent, edge cases, or symptoms of other misuse.

DamienMcKenna’s picture

Issue tags: +Bikeshed

I still feel this needlessly burdens projects by requiring the addition of a second metadata file because of a larger underlying issue (conflict between "module" & "project" and how they're used differently in different situations).

boombatower’s picture

So perhaps if #102102: Parse project .info files: present module list and dependency information gets committed we will have reliable mapping information on d.o to generate the files if we can find matches...or some-such.

dmitrig01’s picture

Another example of this -- ctools contains views_content.module, but I may want ctools on a site without views.

boombatower’s picture

Again these are edge cases....7,637 modules and we have 2 examples in which case they simply don't provide a drush make. Another option is allow drush make to provide a modules argument and it will only build the make files relevant to which modules you want...or maybe a simpler solution would be to have an exclude list of projects. Either way we have 2...count them 2 modules that should not list everything in their drush make.

We are worried about designing for the extreme edge case when drush make doesn't even handle recursive dependencies which is a much more common problem. I think we need to refocus energy here.

If anything it seems people are resistant to this...so for now it will most likely remain an optional thing. All my new modules will have them and people can deal with it as they please.

DamienMcKenna’s picture

Is it not too much to except the site developer to keep track of the dependencies in their make files? Given you can include other make files (have one file that lists standard ones you always use) and several web-based UIs for build make files, why the desire to shoe-horn on more work-arounds?