awssdk.make should only checkout the AWS SDK library, not the libraries module itself. User's may already have a specific 2.x version of libraries in use. For example, the distro I'm building has pinned libraries 2.x to a specific commit via a git checkout. It also places the module in /modules/contrib. AWS SDK's make file downloads a duplicate version of libraries into /modules and I can't stop it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rickvug’s picture

Status: Active » Needs review
FileSize
439 bytes

Patch attached.

boombatower’s picture

Category: bug » support
Status: Needs review » Active

Are you using drush make -dev which has a fix for recursive make files? I have a site I run that has a make file that includes a tree of make files and I can override the libraries version in the primary make file...it just has to be included by drush make first.

The structure of dependencies works fine otherwise since AWS SDK should be lower down the tree then any distro.

If anything this sounds like your make file structure is messed up or a drush make bug. If you have the same key name 'libraries' in the projects array in your make file it should ignore any entries after the first one.

rickvug’s picture

@boomatower Adding the patch above into the profile make file actually fixed the issue. A custom patched version of drush make is being used on the project for mercurial support. I'm not sure of the version but I doubt that it is based on the dev code. drush make must apply patches before reading a module's make file.

boombatower’s picture

Status: Active » Closed (works as designed)

Whatever works, but as I said I have a project with a primary profile make file that ends up including ~15 other makes recursively and I can override any of the latter make files by placing things in the profile make file. I do so on a regular basis to stick to a static release/commit as you mentioned.

When your custom version gets updating or if you haven't done so already try out that approach.

rickvug’s picture

Attaching a new patch against 4.2 for my own benefit. At present time the project I'm working on doesn't have an up to date version of drush make so a patch is required.

rickvug’s picture

Another re-roll for my own benefit.

boombatower’s picture

Can you please just use the proper method and place a line ahead of it in your primary make file? Fix your drush make, but otherwise this is rather silly.

project[libraries] = ...
project[awssdk] = 4.3

Solved...done...simple as that.

girishmuraly’s picture

Status: Active » Closed (works as designed)

Adding libraries *after* awssdk in the profile's make file overrides the awssdk.make file setting successfully. So the order to be used in the distro profile make file is awssdk first, then libraries. viz:

project[awssdk][version] = ...
project[awssdk][subdir] = ...

project[libraries][version] = ...
project[libraries][subdir] = ...

Edit: Please see further clarification in my next comment based on more testing.

rickvug’s picture

@girishmuraly Thanks for documenting that.

girishmuraly’s picture

Status: Closed (works as designed) » Active

I'm sorry I'm having to re-open this because further testing showed erroneous behaviour in two different versions of drush.

I'm specifically comparing here (drush 4.5 + drush_make 6.x-2.3) vs. drush 5.8 (which has drush_make within it)

I have the same use case as rickvug above: I have an install profile that has [libraries] module and [awssdk] module to be downloaded in its make file.

So myprofile.make looks like

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

project[libraries][version] = 2.0
project[libraries][subdir] = contrib

I am trying to run 'drush make' on myprofile.make.

The following are various combinations of placing the projects[] array within the profile's make files tried in the two different versions of drush and running `drush make` on myprofile,make.

Drush 4.5 + drush_make 6.x-2.3

Case 1

Downloading only awssdk module in myprofile.make (with the hope that awssdk.make will get Libraries module for me)

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

Result: Libraries module is downloaded as specified in awssdk.make and is placed in myprofile/modules/

Now I really do not want to put libraries in myprofile/modules/. I want it in myprofile/modules/contrib/. So I try..

Case 2

Add AWSSDK first, then Libraries module in mpyprofile.make, like so:

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

project[libraries][version] = 2.0
project[libraries][subdir] = contrib

Result: This places libraries module in myprofile/modules/contrib/ only (which is how I'd expect it).

Case 3

Add Libraries first, then AWSSDK module in mpyprofile.make, like so:

project[libraries][version] = 2.0
project[libraries][subdir] = contrib

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

Result: Libraries module is placed in myprofile/modules/contrib/ only (like case 2 above). So there is no difference based on the order of modules specified in myprofile.make file.

Now onto strange things..

Drush 5.8

Case 1

Downloading only awssdk module in myprofile.make

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

Result: Libraries module is downloaded as specified in awssdk.make and is placed in myprofile/modules. As expected.

Again, I really do not want to put libraries in myprofile/modules/, but rather in myprofile/modules/contrib/. So I try..

Case 2

Add AWSSDK first, then Libraries module in mpyprofile.make, like so:

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

project[libraries][version] = 2.0
project[libraries][subdir] = contrib

Result: This places libraries module in myprofile/modules/ and myprofile/modules/contrib/ which I did not expect!
This is definitely a problem as it would have code defined twice.

Case 3

Add Libraries first, then AWSSDK module in mpyprofile.make, like so:

project[libraries][version] = 2.0
project[libraries][subdir] = contrib

project[awssdk][version] = 5.4
project[awssdk][subdir] = contrib

Result: Same as in case 2 above - puts libraries module in myprofile/modules/ and myprofile/modules/contrib/

I tested this on two different machines with drush 5.8 and got the same result.

Note: In all the cases above, the 'aws-sdk-for-php' lib mentioned in awssdk.make gets correctly downloaded to myprofile/libraries/awssdk/ which is correct and works, so is not discussed more here.

I guess there is some bug in drush5 or drush_make in one of the issue queues that lists this problem.

Due to these differences in drush (make) I think we should remove the libraries module from awssdk.make and leave it as a dependency in awssdk.info. Especially since drush 5.8 - the newest version - gives wrong results. Install profiles could define where exactly they want to place libraries and which version they need.

DamienMcKenna’s picture

Category: support » bug
Status: Closed (works as designed) » Active

Then there's the simple thing that a module shouldn't force downloading its dependencies, let the site builder deal with that.

Changing this to a Bug Report as this is a fault in the module.

thsutton’s picture

Thanks for your work on this module.

Is there any chance of getting this issue resolved?

As @DamienMcKenna mentioned, it's not up to this module where I put the Libraries module on my site and, as @girishmuraly noted, the functionality you seem to use doesn't work in Drush 5.8.

me@home:test$ drush --version
drush version 5.8
me@home:test$ cat demo.make 
core = 7.x
api = 2
projects[libraries][subdir] = contrib
projects[awssdk][subdir] = contrib
projects[libraries][subdir] = contrib
me@home:test$ drush make --no-core demo.make 
Make new site in the current directory? (y/n): y
 >> Project awssdk contains 2 modules: awssdk_ui, awssdk.
 >> awssdk-7.x-5.4 downloaded.                   [ok]
 >> Found makefile: awssdk.make                  [ok]
 >> libraries-7.x-2.0 downloaded.                [ok]
 >> libraries-7.x-2.0 downloaded.                [ok]
 >> awssdk cloned from                           [ok]
https://github.com/amazonwebservices/aws-sdk-for-php.git.
 >> Checked out tag 1.5.10.                      [ok]
me@home:test$ find . -iname 'libraries.info'
./sites/all/modules/contrib/libraries/libraries.info
./sites/all/modules/libraries/libraries.info
me@home:test$ 
marcelovani’s picture

Issue summary: View changes
marcelovani’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.