Hi,

I've recently been working on patching Aegir to #1463128: Use the Profiler library in hostmaster.profile. This itself works just fine. BTW, sorry for posting the related issue #1464220: Support alternative 'Hostmaster' profiles to the Profiler queue. I've moved it to Provision's, where I had intended for it to go.

Anyway, my principal motivation for porting Hostmaster to Profiler is to be able to maintain a sub-profile that simply extends Hostmaster, rather than having to maintain a fork. However, I haven't yet been able to get this to work.

When building the platform with Drush Make, I'm specifying two profiles, 'hostmaster' and 'openatria_hostmaster'. The problem is that Drush Make won't download the same project twice, so one of these two profiles ends up without the required Profiler library in place. So far, I've tried moving it up into sites/all/libraries, and now I'm experimenting with having the sub-profile (openatria_hostmaster), point to the Profiler library on the parent profile (hostmaster).

It seems to me that I'm missing something obvious in the way sub-profiles should work, but I haven't been able to figure it out. Maybe 'Profiler Example Base' (or 'Profiler Example Child', or something) could be published as documentation of how to specify makefiles, etc. to make sub-profiles work properly?

Comments

ergonlogic’s picture

This appears to work, assuming Profiler's in the base profile's makefile, and it doesn't get overridden:

<?php
!function_exists('profiler_v2') ? require_once($_SERVER['DOCUMENT_ROOT'].'profiles/<base_profile>/libraries/profiler/profiler.inc') : FALSE;
profiler_v2('<sub-profile>');
?>
ergonlogic’s picture

The problem is that Drush Make won't download the same project twice, so one of these two profiles ends up without the required Profiler library in place.

This appear to be an issue with Drush Make 2.3 on Drush 4.x: #1252716: Makefiles with multiple profiles no longer grab like projects. It appears fixed in Drush 5.x

thedavidmeister’s picture

fyi - easiest way I found to upgrade drush to drush 5 is with the following command:

$ drush dl drush-7.x-5.0

obviously, you can change the version at the end. Find it on the d.o. project page

thedavidmeister’s picture

putting 2 different profiles in my stub makefile broke when i used Drush 5.0 - It complained about non-empty directories.

thedavidmeister’s picture

Title: Example of sub-profile w/ makefiles » Example of sub-profile w/ makefiles compatible with Aegir

As far as I understand, from reading various (recent) posts in issue queues the stable version of drush 5 and hostmaster/aegir don't play 100% nicely together yet and I just had some troubles getting it to work myself on my local environment.

Since the OP specifically mentioned that they are working with Aegir, which means drush 4 (at least for now), I've updated the title of this issue to be more specific.

As far as addressing the issue where you can't pull down profiler into two separate profiles with the same makefile, since profiler is a library downloaded from a url rather than auto-detected from the d.o. project name you can do a little namespacing black magic like so:

Base profile:

libraries[base_profiler][download][type] = "get"
libraries[base_profiler][download][url] = "http://ftp.drupal.org/files/projects/profiler-7.x-2.0-beta1.tar.gz"
libraries[base_profiler][directory_name] = "profiler"

Sub-profile:

libraries[sub_profiler][download][type] = "get"
libraries[sub_profiler][download][url] = "http://ftp.drupal.org/files/projects/profiler-7.x-2.0-beta1.tar.gz"
libraries[sub_profiler][directory_name] = "profiler"

I've tested this and it works. Theoretically you should be able to do similar namespace tricks with any module or theme by setting the download type to "git" instead of the default "fire and forget" method of trusting the d.o. project name for everything.

thedavidmeister’s picture

I assume you don't want to duplicate all your modules/themes across both the base and the child theme, so that's the next problem.

According to #970980: Child profiles needs to duplicate module files Drupal sites installed on one profile can't see any code sitting in a different profile's directory. The suggested workaround is to put all code you want to share across all profiles in the /sites/all directory, which makes sense in a weird way but only because of Core's relatively simplistic definition of what a profile is.

As to how you actually *achieve* getting modules out of a profile and into /sites/all is another matter... A makefile discovered recursively in a profile cannot put any code that is downloaded outside the root of that profile as mentioned here #913148: Please bring back install_path. The suggestion of using project[modulename][subdir] = "sites/all/contrib" posted in #827632: modules inside sub-profile not available did not work for me, I ended up with my modules sitting awkwardly in "/profiles/
/modules/sites/all/modules".

In the end I split my project across 3 areas #1498284: How to include a makefile downloaded via git? so that my stub makefile contained:

* Reference to what I wanted to use as core (pressflow for me)
* An include for a makefile hosted on github that pulls down all code that needs to be shared between profiles
* My base profile
* My sub-profile

Anyway, that's as far as I got today. Will let you know how I go testing what can be inherited from the base profile in your sub-profile using this approach :)

thedavidmeister’s picture

Everything seems to be working as expected now :) but I had to pull in my "build" makefile as a module because of the way that drush make supports git. See the issue that I referenced in my last post.

Robin Millette’s picture

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, as it has been created for a release that is now not supported.