Giter VIP home page Giter VIP logo

Comments (10)

samsonasik avatar samsonasik commented on June 25, 2024 1

It seems you're using windows, just copy paste the error on google, the solution is probably on stackoverflow already https://stackoverflow.com/questions/24782826/the-filename-directory-name-or-volume-label-syntax-is-incorrect-inside-batch

from rector.

TomasVotruba avatar TomasVotruba commented on June 25, 2024

Thank you for your report!

We'll need an isolated failing demo link from: http://getrector.com/demo,
that way we can reproduce the bug.

from rector.

scollovati avatar scollovati commented on June 25, 2024

Seems that this is happening on Windows with XDEBUG active.

In fact, this exception is related to this LOC change in XdebugHandler.php (that is loaded in the source code of Rector rather than via Composer): 45987b0#diff-27a6b916747c306f2a8c14d3ebcaeb25ecf6e4359daeb4541f0277712dd1a40c

This change has been introduced in v0.18.6, and still present on 0.18.12.

By the way, in the source of that package (last version v3.0.3) that LOC is slightly different https://github.com/composer/xdebug-handler/blob/3.0.3/src/XdebugHandler.php#L298

So it's not related to the SO page attached.

from rector.

samsonasik avatar samsonasik commented on June 25, 2024

This probably related with PR:

@garas could you verify with relevancy? Thank you.

from rector.

garas avatar garas commented on June 25, 2024

I'm unable to reproduce issue. Rector runs fine on Windows.

Do you still get same error if you allow Xdebug with .\vendor\bin\rector --xdebug?

from rector.

scollovati avatar scollovati commented on June 25, 2024

@garas it works super super slowly. I cannot even perform a search on a project with 16 files in a reasonable time.
The point is that until version 18.5 it was possible to leave XDebug ready for web debugging (by using a dedicated cookie) in PHP.ini (xdebug.mode = develop,debug), while not creating any issue in Rector.

As said above, the source code of that helper library is different from the one that you have. Don't know if an updated version may solve the issue.

from rector.

scollovati avatar scollovati commented on June 25, 2024

According to my analysis, the issue lies here 45987b0#diff-27a6b916747c306f2a8c14d3ebcaeb25ecf6e4359daeb4541f0277712dd1a40c

escapeshellarg behaves very differently on Linux and Windows. Typically, the native function does not work in a naive way under Windows, and it creates issues in a lot of contexts. The community suggests to implement a dedicated function for Windows environments. References here:

from rector.

samsonasik avatar samsonasik commented on June 25, 2024

@scollovati based on php manual comment, is changing with something like:

-$process = \proc_open(\is_array($cmd) ? \implode(' ', \array_map('escapeshellarg', $cmd)) : $cmd, [], $pipes);
+$process = \proc_open(\is_array($cmd) ? \implode(' ', \array_map(
+         function($path) {
+              return '"' . addcslashes($path, '\\"') . '"';
+         }, $cmd)) : $cmd, [], $pipes);

is working? It is unfortunately that we don't have windows env for testing and example code that produce the error. If you can provide a github repo with github action for windows, that would be great to test and fix together.

from rector.

scollovati avatar scollovati commented on June 25, 2024

Not working either. I've manually changed the LOC to go back to the previous version and it works.
Same said by using the official package here https://github.com/composer/xdebug-handler/blob/main/src/XdebugHandler.php#L298

from rector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.