Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Base system (internal API)
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
29 Aug 2011 at 07:57 UTC
Updated:
11 Sep 2013 at 11:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedAwesome! Wish I had thought of this :)
After that, this is RTBC if it passes the unit tests.
Comment #2
greg.1.anderson commentedsql-sync alias trickery is unaffected by this change. As a separate issue, I was considering that if we added metadata to the sql-sync and rsync command record, we might be able to move this same trickery into the command dispatching code, but the bootstrap changes don't help. The trickery is needed in case the site specified in one of the parameters defines aliases that are used as the other parameter. This happens after bootstrap.
I'll add some documentation, and will also review _drush_bootstrap_conf_path and drush_site_path can maybe be unified into a single routine, so that /sites/sites.php only needs to be called once by drush (directly; it will still be called a second time when we call conf_path to bootstrap Drupal).
Comment #3
greg.1.anderson commentedThe unit tests pass in #0 if you have a cached site installed from a previous run, but was broken for a clean test run. Maybe the tests should clear the cache before the first test?
Anyway, I have site-install fixed again, and will commit it as soon as I've rewritten the bootstrap topic. Unifying _drush_bootstrap_conf_path and drush_site_path turned out to be not worthwhile, so I skipped it.
Comment #4
moshe weitzman commentedThat's odd that this patch would invalidate the cached sites. I can't think of why that would happen.
My current position is that it is up to the person running tests to clear cache (use `drush cc drush`) as needed. Auto-clearing this cache would slow down tests further.
Comment #6
greg.1.anderson commentedThe bug occurred when site-install was run with --sites-subdir=dev; because sites/dev/settings.php did not exist yet, the early Drupal site selection code decided that the site to be selected was "default". When site-install later created sites/dev/settings.php and tried to bootstrap, drush remembered that it wanted to bootstrap to "default", which failed. The cache obscured this error because sites/dev/settings.php still existed from a previous run, causing the early bootstrap code to select the correct site. I fixed the bug by having site-install explicitly select the site specified by --sites-subdir in its validate hook.
Documented and committed to master.
Comment #7
owen barton commentedLooks like this patch broke quick-drupal - I managed to work around with the following, but not sure if that is the correct fix - since _drush_bootstrap_select_drupal_site() is underscore prefixed. Greg - could you comment?
Comment #8
owen barton commentedComment #9
greg.1.anderson commentedYes, you are correct. The underscore should be removed from that function, since it will need to be called any time a command changes the "state" of the bootstrap -- different Drupal root, new site folder in 'sites', etc.
Comment #10
greg.1.anderson commentedActually, let me fix this. I think that if I adjust the implementation of _drush_bootstrap_select_drupal_site(), then I can call it automatically from drush_bootstrap_to_phase, and site-install + quick-drupal won't have to.
Patch to come shortly.
Comment #11
greg.1.anderson commentedGive this a try. All tests pass, but I didn't test quick-drupal. Should work.
Comment #12
moshe weitzman commentedLooks OK at first glance. Can't test now if it fixes the bug.
drush_get_context('DRUSH_BOOTSTRAP_PHASE', 0). That 0 looks odd. Please use DRUSH_BOOTSTRAP_DRUSH or FALSE or something more descriptive than 0.Comment #13
owen barton commentedI tested this and it didn't fix the bug for me - I committed the #7 workaround for now (with a TODO), so quick-drupal works in the meantime.
The patch looks like it _should_ work, so something else must be going on. I might have some time over the next few days to figure out what is going on, unless Greg gets to it first ;)
Comment #14
greg.1.anderson commentedComment #15
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.
Comment #15.0
greg.1.anderson commentedPut [] around issue reference