drush generate-makefile gives me output like this:

projects[features][type] = "module"
projects[features][download][type] = "git"
projects[features][download][url] = "git://git.drupal.org/project/features.git"
projects[features][download][branch] = "(no branch)"
projects[features][download][revision] = "dc3297e5f4141f40f46635c1bbf05913d0ae662d"

..and raises warnings (Could not locate feeds version X, downloading latest stable version) but is just fine with lines like this:

projects[drupal][version] = "7.x"
...
projects[feeds][version] = "2.0-alpha4+37-dev"

However, drush verify-makefile dies on those version warnings, and also on this:

The project download-level attribute 'url' on project 'features' is not allowed.                                                         [error]
The project-level attribute 'version' must be specified when the project download-level attribute 'revision' is specified on project     [error]
'features'.

I'm not sure whose fault this is—Drush or Drupal.org Drush—but in the end it means that distro authors have to do manual futzing that they don't have to do with normal Drush Make on drush generate-makefile output. This is a major DX headache.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Tagging.

dww’s picture

Title: drush generate-makefile and drush verify-makefile are incompatible » drush generate-makefile does wonky things with -dev versions
Project: Drupal.org drush » Drush
Component: Code » Make

A) This is never going to work:
projects[feeds][version] = "2.0-alpha4+37-dev"
Those fancy version strings are just for core's version dependency stuff to work (and for the humans to figure out what's going on). All the underlying plumbing (on d.o, in drush pm, drush make, etc) still uses the more generic '2.x-dev' style version strings.

B) The 'url' validation thing is duplicate with #1432290: Ignore 'url' parameter when it's from git.drupal.org. Can we just talk about that in one issue please? ;)

C) The "Could not locate feeds version X, downloading latest stable version" stuff should now be resolved thanks to #1405736: Regression: make no longer smart enough to get latest release from non-recommended branch (I think).

Based on the OP, I'd say (A) is the only bug here, and it's a bug in generate-makefile, which lives in drush core, not drupalorg_drush.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
FileSize
1.85 KB

Totally untested, but something like this seems like what we need. Inside generate-makefile, if we see we're dealing with a fancy ...+N-dev version string, we special-case it and fall back to the '1.x-dev' drush make is expecting.

jhedstrom’s picture

Running this with a random 7.x site, with and without the patch, I still see things like

projects[redirect][version] = "master-dev"

projects[sharethis][version] = "master-dev"

However, this might be a different issue, since that's actually coded into the .info file that make generated in the first place:

; Information added by drush on 2012-02-09
version = "master-dev"
project = "redirect"
datestamp = "1328840341"
dww’s picture

Yeah, I think that's a separate problem. The regexp here is only trying to handle stuff like "7.x-1.0+17-dev". So, for example, on a new clean site with just D7 core and drush dl field_collection-7.x-1.x-dev, I'm getting the following:

Before patch:

; This file was auto-generated by drush make
core = 7.x

api = 2
projects[drupal][version] = "7.x"

; Modules
projects[field_collection][version] = "1.0-beta3+1-dev"
...

After patch:

; This file was auto-generated by drush make
core = 7.x

api = 2
projects[drupal][version] = "7.x"

; Modules
projects[field_collection][version] = "1.x-dev"
...

Although, finally testing this, I realized that my regexp was too strict, and it only worked for 7.x-1.2+17-dev but not 7.x-1.0-beta3+1-dev. Attached patch is better.

Do we need a functional test for this? Try to modify the existing generate test to include one of these funky -dev version strings?

That said, the more I investigate, the more problematic I think generate-makefile is. It does all sorts of things wrong from my perspective. So, although we should probably fix this, I suspect there's a lot more work to do fixing it up (and therefore, we shouldn't put too much emphasis on using it in the documentation about doing distribution packaging on d.o).

colan’s picture

Also, what's with this:

projects[drupal][version] = "7.x"

If I run generate-makefile on a 7.12 site, which I just did, shouldn't that be "7.12", not "7.x"? Is this another bug, or is it related?

EDIT: I've spun off a separate issue for this: #1528594: Drush generate-makefile doesn't specify stable core version

colan’s picture

Title: drush generate-makefile does wonky things with -dev versions » Drush generate-makefile does wonky things with "-dev" versions

@dww: I'm not sure that your patch is such a good idea, because we'll have no idea which dev version we're talking about. At least the default human-readable-only dev versions (like "1.0-beta3+1-dev") can be fixed manually afterwards by finding an appropriate commit ID that matches the human-readable description, and then converting the entry to a git one (pulling that ID). If there's only "1.x-dev", there's no way to match this with anything, as it could be any dev version.

So perhaps we could have Drush convert these human-readable version strings into Git entries that pull down the project with the associated commit ID?

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Needs review » Needs work

My opinion is that #5 should be the default, and there should be a separate option for #7. Perhaps we should commit this, and open another follow-on issue for an option to convert dev versions to specific git commits, when available?

greg.1.anderson’s picture

Assigned: dww » jhedstrom

Assigning to drush-make maintainer.

greg.1.anderson’s picture

Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.