Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not load duplicate command files, regardless of cache #430

Closed
wants to merge 2 commits into from
Closed

do not load duplicate command files, regardless of cache #430

wants to merge 2 commits into from

Conversation

anarcat
Copy link
Contributor

@anarcat anarcat commented Feb 4, 2014

this is messy: we should probably remove the other check, but I am
lost in this tangle and this works for me.

this should fix #280.

this is messy: we should probably remove the other check, but I am
lost in this tangle and this works for me.
@greg-1-anderson
Copy link
Member

greg-1-anderson commented Feb 6, 2014

Looks about right, but I have not tried it. Also, I did not see any specific steps to reproduce in any of the referenced issues -- but perhaps I just didn't look hard enough. Could you provide a test, or aforementioned instructions?

@weitzman
Copy link
Member

weitzman commented Feb 6, 2014

Code looks fine to be. "Remove the other check" probably refers to the $evaluated variable? That does look like a dupe of $loaded so we should indeed clean this up before committing.

Does Aegir still use modulename.drush.load.inc files? If not, I'd like to remove that code.

@greg-1-anderson
Copy link
Member

greg-1-anderson commented Feb 6, 2014

Nothing I have is using drush.load.inc files, and am fine with removing them if there is no identified critical use.

@ergonlogic
Copy link
Member

ergonlogic commented Feb 7, 2014

Yes, Aegir use .drush.load.inc files quite a bit. We keep a registry of front-end (hosting) modules enabled, and use hook_drush_load() in the corresponding backend (provision) extensions.

Moshe mentioned '--ignored-modules' on IRC, so I'll look into it as an alternative for Aegir 3.

@anarcat
Copy link
Contributor Author

anarcat commented Feb 7, 2014

can we keep the .drush.load.inc issue separate? i believe we still need some similar mechanism, but this is beside the point here.

@anarcat
Copy link
Contributor Author

anarcat commented Feb 7, 2014

i'll work on removing the redundant $evaluated check now.

@anarcat
Copy link
Contributor Author

anarcat commented Feb 7, 2014

@weitzman how does that look now?

@weitzman
Copy link
Member

weitzman commented Feb 7, 2014

I'm seeing warnings. Lets get to a green on the test suite and get this in.

@anarcat
Copy link
Contributor Author

anarcat commented Feb 7, 2014

I'm having trouble running the test suite here, for some reason - care to share where the warnings are?

Log: Executing: /home/anarcat/src/drush/drush.php --simulate --nocolor 'user@server/path/to/drupal#sitename' ssh 'ls /path1 /path2' --cd=0 2>&1
PHP Fatal error:  Call to undefined method siteUpgradeCase::drush() in /home/anarcat/src/drush/tests/drush_testcase.inc on line 272
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   8. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772
PHP   9. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751
PHP  10. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:649
PHP  11. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:804
PHP  12. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:942
PHP  13. siteUpgradeCase->testUpgrade() /usr/share/php/PHPUnit/Framework/TestCase.php:942
PHP  14. Drush_TestCase->setUpDrupal() /home/anarcat/src/drush/tests/siteUpgradeTest.php:18

@weitzman
Copy link
Member

weitzman commented Feb 7, 2014

siteUpgradeCase belongs to site-upgrade which was removed from Drush a long time ago. I suspect your Drush checkout is old or dirty.

@anarcat
Copy link
Contributor Author

anarcat commented Feb 7, 2014

On 2014-02-07 15:10:43, Moshe Weitzman wrote:

siteUpgradeCase belongs to site-upgrade which was removed from Drush a long time ago. I suspect your Drush checkout is old or dirty.

Thanks, fixed. Running the tests again.

(A long time ago... well that's just me, i'm getting old! ;)

@weitzman
Copy link
Member

weitzman commented Feb 13, 2014

@anarcat - any progress on this?

@anarcat
Copy link
Contributor Author

anarcat commented Feb 21, 2014

sorry, i didn't have time to followup on this... still need to run the tests...

@anarcat
Copy link
Contributor Author

anarcat commented Apr 30, 2014

still haven't had time to test this here, but others confirmed this as working in #280. also, any idea why travis didn't pick this PR for testing?

@weitzman
Copy link
Member

weitzman commented May 5, 2014

no idea why travis skipped this. i cant seem to find a way to get travis to test it again. maybe if you commit to this PR.

require_once $filepath;
unset($deferred[$module]);
$module = basename($filename);
$module = str_replace(array('.drush.inc', ".drush$dmv.inc"), '', $module);
Copy link
Contributor

@scor scor Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$dmv isn't always defined, causing:
Undefined variable: dmv command.inc:1516

@weitzman
Copy link
Member

weitzman commented Aug 28, 2014

I suspect that this bug is improved (but not eliminated) by efdd5ac. That commit was backported to 6.x as well. Can you retry with latest code and see if the issue has gone away?

@weitzman
Copy link
Member

weitzman commented Oct 28, 2014

I fixed anoth bug related to loading commandfiles from disabled modules under /profiles. Please try latest 6.x and master.

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drush cannot redeclare : it loads duplicate command files
5 participants