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

The filename, directory name, or volume label syntax is incorrect. #353

Closed
andriihorpenko opened this issue Jan 30, 2019 · 6 comments
Closed

Comments

@andriihorpenko
Copy link

andriihorpenko commented Jan 30, 2019

Bug report

Question Answer
Box version 3.4.0@4eeb285
PHP version 7.2
Platform with version Windows 10
Github Repo -

Basically, I am unable to use 'compile' command because of this error (command and output below).

P.S. trying to compile Laravel Lumen application to PHAR (compile ALL files in the src directory).

box.json.dist
{
"main": "src/public/index.php",
 "directories": [
       "src"
   ],
 "output": "build/client",
 "chmod": "0755",
 "force-autodiscovery": true
}
Output
$ php box.phar compile
> The filename, directory name, or volume label syntax is incorrect.
@theofidry
Copy link
Member

Hm that looks really weird, could you try with --debug and give the stack trace?

@andriihorpenko
Copy link
Author

Result:

$ php box.phar compile --debug
[debug] Checking BOX_ALLOW_XDEBUG
[debug] The xdebug extension is not loaded
[debug] Process restarting (BOX_ALLOW_XDEBUG=internal||0|*|*)
[debug] Running 'E:\OSPanel\modules\php\PHP-7.2-x64\php.exe' '-n' '-c' 'C:\Users\andre\AppData\Local\Temp\4B70.tmp' 'box.phar' 'compile' '--debug' '--ansi'
The filename, directory name, or volume label syntax is incorrect.
[debug] Restarted process exited 1

@theofidry
Copy link
Member

Oh that's on windows. I have no idea to what extend Box works on it to be honest.

Maybe try the same command with --no-restart and I guess --no-parallel will be needed as well

@andriihorpenko
Copy link
Author

andriihorpenko commented Jan 30, 2019

Ya, Windows is 💩 in some situations. --no-restart helped. If you don't mind can you answer my last question: how can I include ALL the directories and files located in src folder, including those that start with ".", line ".git"? Thanks in advance.

@theofidry
Copy link
Member

how can I include ALL the directories and files located in src folder, including those that start with ".", line ".git"

If you want to include hidden files I think you will need a custom finder (see the finders config entry). However I'm not 100% it's gonna work:

// src/Configuration.php

$finder = Finder::create()
            ->files()
            ->filter($blacklistFilter)
            ->filter(
                static function (SplFileInfo $fileInfo) use ($devPackages): bool {
                    foreach ($devPackages as $devPackage) {
                        if ($devPackage === longest_common_base_path([$devPackage, $fileInfo->getRealPath()])) {
                            // File belongs to the dev package
                            return false;
                        }
                    }

                    return true;
                }
            )
            ->ignoreVCS(true)
        ;

The ignoreVCS(true) can be an issue and I don't know what it does about the dot files (I think it ignores them by default). In which case I think you would need to do a PR to tweak this to allow those 2 settings to be configurable. If ignoreVCS(true) is an issue, as ignoring the VCS is already the default, this call could simply be removed allowing you to configure your finder to include VCS files

@andriihorpenko
Copy link
Author

Okay, I got it. Thanks for such a quick response!

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

No branches or pull requests

2 participants