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

Error installing: composer require henrikbjorn/lurker #459

Closed
orozco1582 opened this issue Oct 3, 2016 · 21 comments · Fixed by #1007
Closed

Error installing: composer require henrikbjorn/lurker #459

orozco1582 opened this issue Oct 3, 2016 · 21 comments · Fixed by #1007

Comments

@orozco1582
Copy link

orozco1582 commented Oct 3, 2016

Hi, I'm installing this composer require henrikbjorn/lurker, but I have this error:

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.1 for henrikbjorn/lurker
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for henrikbjorn/lurker ^1.1 -> satisfiable by henrikbjorn/lurker[1.1.0].
    - Conclusion: remove symfony/event-dispatcher v3.1.3
    - Conclusion: don't install symfony/event-dispatcher v3.1.3
    - henrikbjorn/lurker 1.1.0 requires symfony/event-dispatcher ~2.2 -> satisfiable by symfony/event-dispatcher[v2.2.0, v2.2.1, v2.2.10, v2.2.11, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9, v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.36, v2.3.37, v2.3.38, v2.3.39, v2.3.4, v2.3.40, v2.3.41, v2.3.42, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.0-RC1, v2.4.1, v2.4.10, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9, v2.5.0, v2.5.0-RC1, v2.5.1, v2.5.10, v2.5.11, v2.5.12, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.13, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
    - Can only install one of: symfony/event-dispatcher[v2.5.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.0-RC1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.12, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.5.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.12, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.13, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.6.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.12, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.13, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.14, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.15, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.16, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.17, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.18, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.19, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.7.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.12, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.8.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.2.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.11, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.12, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.13, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.14, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.15, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.16, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.17, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.18, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.19, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.20, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.21, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.22, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.23, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.24, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.25, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.26, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.27, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.28, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.29, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.30, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.31, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.32, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.33, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.34, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.35, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.36, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.37, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.38, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.39, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.40, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.41, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.42, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.3.9, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.0, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.0-RC1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.1, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.10, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.2, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.3, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.4, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.5, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.6, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.7, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.8, v3.1.3].
    - Can only install one of: symfony/event-dispatcher[v2.4.9, v3.1.3].
    - Installation request for symfony/event-dispatcher (locked at v3.1.3) -> satisfiable by symfony/event-dispatcher[v3.1.3].


Installation failed, reverting ./composer.json to its original content.
@greg-1-anderson
Copy link
Member

Try composer require 'henrikbjorn/lurker:1*', perhaps?

Note that henrikbjorn/lurker is already in Robo's require-dev section, so you don't need to do this for the Robo project -- only for other projects you make that require Robo.

@davidsneighbour
Copy link
Contributor

Add the line

"henrikbjorn/lurker": "^1"

in your composer.json, then delete composer.lock, remove the vendor directory and run composer install again. This will install version 1.2 of Lurker (at the moment).

Depending on what other libraries you are using it might be a good idea to change them to ^majornumber in the requirement to give enough space to find a fitting dependency.

@amitaibu
Copy link

This still seems to be an issue.

If I try to add "henrikbjorn/lurker": "^1" then upon taskWatch I get error:

 [error]    in task Robo\Task\Base\Exec 

  Lurker\Event\FilesystemEvent does not implement CommandInterface, so can't be passed into this task 

@amitaibu
Copy link

Answer (to pin to symfony 3) is here - #363 (comment)

@amitaibu
Copy link

amitaibu commented Apr 16, 2019

I was too quick to submit. I still get the same error, even with the following composer.json:

{
    "require": {
        "consolidation/robo": "~1",
        "symfony/config": "^3.0",
        "symfony/event-dispatcher" : "^3.0",
        "henrikbjorn/lurker": "^1.2"
    }
}

@greg-1-anderson
Copy link
Member

I haven't been using watch. PRs welcome.

@amitaibu
Copy link

I'm new to the project, so if you'll have some time to provide me for a few pointers for that, it would be great :)

If it was a "normal" task I assume I would have need to change Watch to be class Watch extends Base implements CommandInterface and then implement there getCommand().

However, I believe that ResourceWatcher is the on responsible for invoking the closure. So I'm not sure which command Robo is waiting to get.

Also, sorry if my above assumptions are completely wrong :)

@amitaibu
Copy link

amitaibu commented Apr 16, 2019

Also, maybe we'd like to completely change the integration to be with another library, so it will support Symfony 4?

Edit: for example https://github.com/jasonlewis/resource-watcher

@AronNovak
Copy link

This alone seems to work:

{
    "require": {
        "consolidation/robo": "~1",
        "henrikbjorn/lurker": "1.*"
    }
}

@amitaibu
Copy link

@AronNovak composer install indeed works, but the watch throws the above error once a monitored file is changed.

@AronNovak
Copy link

@amitaibu Right, I could indeed reproduce that:
image

@davidsneighbour
Copy link
Contributor

I can't reproduce the error. Using robo in it's own phar file and installed lurker with the procedure above and the watch task works as expected.

@amitaibu
Copy link

The error occurs when you try to trigger a closure only once a file has changed. For example:

<?php

use Lurker\Event\FilesystemEvent;

/**
 * This is project's console commands configuration for Robo task runner.
 *
 * @see http://robo.li/
 */
class RoboFile extends \Robo\Tasks
{
  function watch()
  {
    $cmd = 'ls -al';

    $this->taskWatch()
      ->monitor(
        '.',
        function($cmd) {
          $this->_exec($cmd);
        },
        FilesystemEvent::ALL
      )->run();
  }
}

@davidsneighbour
Copy link
Contributor

davidsneighbour commented Apr 17, 2019

This is not how the callable is supposed to work. It's an event object:

<?php
public function watch(): void
    {

        $this
            ->taskWatch()
            ->monitor(
                static::$rootdir . '/src/Boka10/Api/',
                function ($event) {
                    $resource = $event->getResource();
                    $this->qiPhpstan((string)$resource);
                    $this->testApi();
                },
                FilesystemEvent::ALL
            )
            ->monitor(
                static::$rootdir . '/tests/',
                function ($event) {

                    $resource = $event->getResource();
                    $this->qiPhpstan((string)$resource);
                    $this->testUnit();
                    $this->testApi();
                },
                FilesystemEvent::ALL
            )
            ->monitor(
                static::$rootdir . '/src/Boka10/',
                function ($event) {
                    $resource = $event->getResource();
                    $this->qiPhpstan((string)$resource);
                    $this->testUnit();
                },
                FilesystemEvent::ALL
            )
            ->run();
    }

The $event is a symfony event class - I had a bug report open about this some weeks ago, but can't find it.

@davidsneighbour
Copy link
Contributor

@amitaibu
Copy link

@davidsneighbour Interesting. Does it mean the docs here are wrong?

@amitaibu
Copy link

So thanks to @davidsneighbour pointer, and #845 (comment), I was able to make it work:

<?php

use Lurker\Event\FilesystemEvent;
use Symfony\Component\EventDispatcher\Event;

/**
 * This is project's console commands configuration for Robo task runner.
 *
 * @see http://robo.li/
 */
class RoboFile extends \Robo\Tasks
{
  function watch()
  {
    $this->taskWatch()
      ->monitor(
        'src/elm',
        function(Event $event) {
          $this->_exec('ls -al');
        },
        FilesystemEvent::ALL
      )->run();
  }
}

@davidsneighbour
Copy link
Contributor

No, the docs there say nothing about parameters for the $callable. That's the problem. The docs need updating. Probably just a sample with the $event parameter and an explanation of what to expect for this object.

Note: The $this inside of the callable works for me.

I was playing around with your sample code and it did not throw errors, but it also did not print anything.

  • using $this->taskExec() does not throw errors, but also does not print anything if output would be expected
  • $this->io()->caution('something'); was printed.
  • My own methods from my robo class were executed too and output was as expected..

My guess is that either whatever happens inside of the callback function is not available to robo outside itself or that any output from the shell is dropped if "native" robo methods are used.

Try using your own task as a response to watch instead of creating a task inside of the callable? In my (working) sample above I retrieve the path to the changed resource and then call my own methods.

Thats by the way a reason to open another issue, because this one here was about non-installable composer dependencies ;)

@lesichkovm
Copy link

The Lurker repo seems to be abandoned, but pinned to Symphony 3. This prevents it from being used with the latest Robo pacages.

For now the only way to enable support for Symfony 4 seems to fork the repo, enable Symfony 4 support, then override the original with a private named repository.

You may see more details on how to do it here: https://github.com/lesichkovm/lurker

@pretzlaw
Copy link

Leaving a small workaround here for all those who are stuck right now and need a working solution immediately:
https://gist.github.com/pretzlaw/f11c26076688c650b05bee279e696669

Does a class_alias of \Lurker\ResourceWatcher towards a proxy to the "yosymfony/resource-watcher" package.
Use this code as a PR for \Robo\Task\Base\Watch if you like.

see also #363

@pixelbrackets
Copy link
Contributor

There is a drop-in replacement package available by now, see flint/Lurker#30 (comment)

I'll send a PR to suggest using »totten/lurkerlite« instead of »henrikbjorn/lurker«.

pixelbrackets added a commit to pixelbrackets/robo that referenced this issue Dec 18, 2020
The watch task requires the package »henrikbjorn/lurker«.
The dependencies of this package dont allow using Symfony 4.
Last release of this package was 2016-03-16. So its abdandoned.

Use the drop-in replacement package totten/lurkerlite instead.
Installing this packsge will remove »henrikbjorn/lurker« automatically.

Since the package is a designated drop-in replacement all existing
methods in robo may stay the same.

Closes consolidation#459 consolidation#956 consolidation#973
pixelbrackets added a commit to pixelbrackets/robo that referenced this issue Dec 18, 2020
The watch task requires the package »henrikbjorn/lurker«.
The dependencies of this package dont allow using Symfony 4.
Last release of this package was 2016-03-16. So its abdandoned.

Use the drop-in replacement package totten/lurkerlite instead.
Installing this packsge will remove »henrikbjorn/lurker« automatically.

Since the package is a designated drop-in replacement all existing
methods in robo may stay the same.

Closes consolidation#459 consolidation#956 consolidation#973
greg-1-anderson pushed a commit that referenced this issue Dec 18, 2020
The watch task requires the package »henrikbjorn/lurker«.
The dependencies of this package dont allow using Symfony 4.
Last release of this package was 2016-03-16. So its abdandoned.

Use the drop-in replacement package totten/lurkerlite instead.
Installing this packsge will remove »henrikbjorn/lurker« automatically.

Since the package is a designated drop-in replacement all existing
methods in robo may stay the same.

Closes #459 #956 #973
greg-1-anderson pushed a commit that referenced this issue Dec 19, 2020
The watch task requires the package »henrikbjorn/lurker«.
The dependencies of this package dont allow using Symfony 4.
Last release of this package was 2016-03-16. So its abdandoned.

Use the drop-in replacement package totten/lurkerlite instead.
Installing this packsge will remove »henrikbjorn/lurker« automatically.

Since the package is a designated drop-in replacement all existing
methods in robo may stay the same.

Closes #459 #956 #973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants