Open theofidry opened 6 years ago
To whoever is willing to help out with this issue as I can't get my hands on a Windows machine: running bin/phpunit
and check out the failures would be the easiest way to find most of the issues IMO.
tried the current version 3.1.2
box --version
Fatal error: Uncaught Error: Call to undefined function _HumbugBox1ee257d4ea88\Symfony\Component\Console\Output\sapi_windows_vt100_support() in phar://C:/bin/box.phar/vendor/symfony/console/Output/StreamOutput.php:55
Stack trace:
#0 phar://C:/bin/box.phar/vendor/symfony/console/Output/StreamOutput.php(28): _HumbugBox1ee257d4ea88\Symfony\Component\Console\Output\StreamOutput->hasColorSupport()
#1 phar://C:/bin/box.phar/vendor/symfony/console/Output/ConsoleOutput.php(20): _HumbugBox1ee257d4ea88\Symfony\Component\Console\Output\StreamOutput->__construct(Resource id #159, 32, NULL, NULL)
#2 phar://C:/bin/box.phar/vendor/symfony/console/Application.php(89): _HumbugBox1ee257d4ea88\Symfony\Component\Console\Output\ConsoleOutput->__construct()
#3 phar://C:/bin/box.phar/bin/box(39): _HumbugBox1ee257d4ea88\Symfony\Component\Console\Application->run()
#4 C:\bin\box.phar(18): require('phar://C:/bin...')
#5 {main}
thrown in phar://C:/bin/box.phar/vendor/symfony/console/Output/StreamOutput.php on line 55
what about using https://www.appveyor.com/
Free for open-source projects
https://www.appveyor.com/pricing/
example config: https://github.com/puli/cli/blob/master/appveyor.yml
I'm all up for it, it's just the trouble of setting it up and doing the PR to fix the windows incompatibilities I'm not really willing to do. If a PR provides the fixes with a working AppVeyor config, I'll gladly accept it though
got it up und running on window. i compiled box with itself from master with .\bin\box.bat compile --no-parallel
but i had to replace all sapi_windows_vt100_support()
calls with \sapi_windows_vt100_support()
looks like this is a symfony console error with php7.1 or can it be some of your replace code?
the wrong namespace is used on this function call Call to undefined function _HumbugBoxb3c5af21fff1\Composer\XdebugHandler\sapi_windows_vt100_support()
this error is gone if i prefix all the sapi_windows_vt100_support()
with \
then i was able to get a self compiled version of box and use it to compile my code.
Woa nice! I'll check this sapi_windows_vt100_support
issue ASAP
hmm, i think i was too fast. the build is created but the build file does not work :(
This required some tweaking, but done in https://github.com/humbug/php-scoper/pull/269. Will do a release soonish
Shipped in 3.1.3 :)
finally some time for testing. all in all it works quite well. i compiled https://gitlab.com/c33s-group/yaml-convert and got a working yaml-convert.phar
{
"directories": ["vendor"],
"main": "bin/yaml-convert",
"output": "yaml-convert.phar",
"compression": "GZ",
"git-commit": "git_commit",
"git-version": "git_version",
"git-tag": "git_tag"
}
stumpled upon some problems:
The filename, directory name, or volume label syntax is incorrect.
#353
λ php box.phar compile
The filename, directory name, or volume label syntax is incorrect.
wouldn't it be good to have a windows detection and simply add this flags --no-restart --no-parallel
per default (--no-restart
was enough for me on win7)?
vendor/composer/installed.json
#337
only a warning but still some kind annoying
A composer.lock file has been found but its related file vendor/composer/installed.json could not. This could be due to either dependencies incorrectly installed or an incorrect Box configuration which is not including the installed.json file. This will not break the build but will likely result in a broken Composer classmap.
the file exists in vendor/composer
but is not added to the resulting phar file, maybe this is the problem. in my box.json i add the whole vendor
dir. so it should be there. also tried "force-autodiscovery": true,
with the same result.
--debug
-> Call to undefined function spl_object_id()
as this function was shipped with php7.2 and i run php7.1 some kind of polyfill would be needed for this to work https://github.com/symfony/polyfill-php72
Fatal error: Uncaught Error: Call to undefined function spl_object_id() in phar://M:/composer-yaml/box.phar/vendor/symfony/var-dumper/Cloner/VarCloner.php:141
Stack trace:
#0 phar://M:/composer-yaml/box.phar/vendor/symfony/var-dumper/Cloner/AbstractCloner.php(58): _HumbugBoxfc75abf4ec5a\Symfony\Component\VarDumper\Cloner\VarCloner->doClone(Object(_HumbugBoxfc75abf4ec5a\KevinGH\Box\Configuration))
#1 phar://M:/composer-yaml/box.phar/src/Console/Command/Compile.php(179): _HumbugBoxfc75abf4ec5a\Symfony\Component\VarDumper\Cloner\AbstractCloner->cloneVar(Object(_HumbugBoxfc75abf4ec5a\KevinGH\Box\Configuration))
#2 phar://M:/composer-yaml/box.phar/src/Console/Command/Compile.php(131): _HumbugBoxfc75abf4ec5a\KevinGH\Box\Console\Command\Compile->removeExistingArtifacts(Object(_HumbugBoxfc7 in phar://M:/composer-yaml/box.phar/vendor/symfony/var-dumper/Cloner/VarCloner.php on line 141
extra info about polyfill: https://github.com/symfony/polyfill#design
wouldn't it be good to have a windows detection and simply add this flags
--no-restart --no-parallel
per default (--no-restart
was enough for me on win7)?
Isn't the issue because of your machine setup rather than just because it's the windows platform?
- only a warning but still some kind annoying
That's a legit one though: make sure all deps are installed properly before running Box.
the file exists in
vendor/composer
but is not added to the resulting phar file, maybe this is the problem. in my box.json i add the wholevendor
dir. so it should be there. also tried"force-autodiscovery": true,
with the same result
The installed.json
is important to detect the dependencies, it is however excluded (by default) in the final PHAR. You shouldn't need to include vendor
. That's said it's mostly for optimization and removing the dev deps
--debug
->Call to undefined function spl_object_id()
Arg indeed, although I would rather upgrade to 7.2.
Isn't the issue because of your machine setup rather than just because it's the windows platform? thought it hits all/more windows instances because of #353
That's a legit one though: make sure all deps are installed properly before running Box. i don't really understand, i installed everything fresh like this:
deleted vendor
composer update
box compile --no-restart
(using the config from above)
this results in the warning A composer.lock file has been found but its related file vendor/composer/installed.json...
can it be that the detection for this warning is some kind of buggy or is my config wrong? is it required to remove vendor?
Arg indeed, although I would rather upgrade to 7.2.
sadly it is not possible to upgrade everywhere. sometimes i have situations where people demand php 5.6. so as version 7.1 is still supported until dec 2019 integrating the awesome symfony polyfills would be my suggestion. so it simply work for people who can't update.
An easy way to check that warning would be to do BOX_ALLOW_XDEBUG box compile --no-restart
and put a breakpoint in Configuration::create()
to see what's going on
An easy way to check that warning would be to do BOX_ALLOW_XDEBUG box compile --no-restart and put a breakpoint in Configuration::create() to see what's going on
currently no configured xdebug on the windows system :(
another catch:
Windows doesn't like emojis?
Windows doesn't like emojis?
at least win7x64 without any special fonts installed.
another one:
cannot run box if files are in the root dir
now i tried to compile https://github.com/composer/satis no luck this time.
resulting phar: satis.zip
the last reported error is not windows specific. i have the same error for the satis.phar
created on the debian build server (gitlab).
PHP Fatal error: Class 'Symfony\Component\Console\Application' not found in phar:///usr/local/bin/satis/src/Console /Application.php on line 30
should i open a new ticket for this?
Oh if it isn’t yes please
On Fri 1 Mar 2019 at 22:29, Julian notifications@github.com wrote:
the last reported error is not windows specific. i have the same error for the satis.phar created on the debian build server (gitlab).
PHP Fatal error: Class 'Symfony\Component\Console\Application' not found in phar:///usr/local/bin/satis/src/Console /Application.php on line 30
should i open a new ticket for this?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/humbug/box/issues/193#issuecomment-468818163, or mute the thread https://github.com/notifications/unsubscribe-auth/AE76gYOBmBA3xMtYu6N9mMySIe5-jM4Fks5vSZvJgaJpZM4Txj8h .
--debug -> Call to undefined function spl_object_id()
Note that this was an issue from symfony/var-dumper
which hopefully has now been solved (it seems to be shipping the polyfill as expected)
--debug -> Call to undefined function spl_object_id()
Note that this was an issue from
symfony/var-dumper
which hopefully has now been solved (it seems to be shipping the polyfill as expected)
still broken
λ box compile --debug
[debug] Checking BOX_ALLOW_XDEBUG
[debug] The xdebug extension is not loaded
____
/ __ )____ _ __
/ __ / __ \| |/_/
/ /_/ / /_/ /> <
/_____/\____/_/|_|
Box version 3.5.0@cfc7c11 2019-03-05 00:51:30 UTC
// Loading the configuration file
// "C:\satis\box.json".
🔨 Building the PHAR "C:/satis/satis.phar"
Fatal error: Uncaught Error: Call to undefined function spl_object_id() in phar://C:/bin/box.phar/vendor/symfony/var-dumper/Cloner/VarCloner.php:142
Stack trace:
#0 phar://C:/bin/box.phar/vendor/symfony/var-dumper/Cloner/AbstractCloner.php(58): _HumbugBox9257ad6c1a66\Symfony\Component\VarDumper\Cloner\VarCloner->doClone(Object(_HumbugBox9257ad6c1a66\KevinGH\Box\Configuration))
#1 phar://C:/bin/box.phar/src/Console/Command/Compile.php(179): _HumbugBox9257ad6c1a66\Symfony\Component\VarDumper\Cloner\AbstractCloner->cloneVar(Object(_HumbugBox9257ad6c1a66\KevinGH\Box\Configuration))
#2 phar://C:/bin/box.phar/src/Console/Command/Compile.php(131): _HumbugBox9257ad6c1a66\KevinGH\Box\Console\Command\Compile->removeExistingArtifacts(Object(_HumbugBox9257ad6c1a66\KevinGH\Box\Configuration), Object(_HumbugBox9257ad6c1a66\KevinGH\Box\Console\Logger\CompileLogger), true)
#3 phar://C:/bin/box.phar/vendor/symfony/console/Command/Command.php(127): _HumbugBox9257ad6c1a66\KevinGH\Box\Console\Command\Compil in phar://C:/bin/box.phar/vendor/symfony/var-dumper/Cloner/VarCloner.php on line 142
wouldn't it be better to create an issue for each problem/bug and add a "windows" label to it? this issue is getting bigger and bigger which makes it unclear.
of course you have the tasks in the description but this ticket is quite an epic
by the way why "Check the compatibility with emojis"? it looks like that it is not compatible. simply remove them or add don't show them on windows or add a flag & an environment variable for it.
appveyor
Added to the top description of this issue.
The filename, directory name, or volume label syntax is incorrect. #353
I'm not sure there is a specific issue there to be honest. I suspect making sure all tests works on Windows would actually solve the problem. If anything though, there was a feature request about including dot files (cf. this comment) but so far no one has been willing to work on it.
vendor/composer/installed.json #337
It is actually not windows specific. Opened https://github.com/humbug/box/issues/368 for it.
--debug -> Call to undefined function spl_object_id()
Actually not windows specific, opened https://github.com/humbug/box/issues/367 for it. It's actually a scoping issue.
emojis
Included in the top list of the issue. "Check the compatibility with emojis" is voluntary vague: if there is possible support it's about checking how feasible it is, otherwise it's about removing them on Windows.
cannot run box if files are in the root dir
What is that?
cannot run box if files are in the root dir
What is that?
https://github.com/humbug/box/issues/193#issuecomment-466803477
Can you open a new issue for that one with the details about what exists in the root? (e.g. in the current output it complains about /composer.json
not being found)
tried to compile a symfony project with box 3.7.0
#!/usr/bin/env php
Fatal error: Uncaught Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: The file "./config" does not exist (in: ). in phar://<redacted>/puppet-enc/build/puppet-enc.phar/vendor/symfony/config/FileLocator.php:71
Stack trace:
#0 phar://<redacted>/puppet-enc/build/puppet-enc.phar/vendor/symfony/http-kernel/Config/FileLocator.php(52): Symfony\Component\Config\FileLocator->locate('./config', NULL, true)
#1 phar://<redacted>/puppet-enc/build/puppet-enc.phar/vendor/symfony/config/Loader/FileLoader.php(110): Symfony\Component\HttpKernel\Config\FileLocator->locate('./config', NULL, true)
#2 phar://<redacted>/puppet-enc/build/puppet-enc.phar/vendor/symfony/dependency-injection/Loader/GlobFileLoader.php(26): Symfony\Component\Config\Loader\FileLoader->glob('/{packages}/*.{...', false, NULL)
#3 phar://<redacted>/pu in phar://<redacted>/puppet-enc/build/puppet-enc.phar/vendor/symfony/config/FileLocator.php on line 71
box.yaml
files:
- composer.json
directories:
- bin
- config
- src
- lib
finder:
-
name: '*.*'
in: vendor
exclude:
- .gitignore
- .md
- phpunit
- Tester
- Tests
- tests
compactors:
- Herrera\Box\Compactor\Json
- Herrera\Box\Compactor\Php
compression: GZ
main: bin/puppet-enc
output: build/puppet-enc.phar
stub: true
git-commit: git_commit
git-version: git_version
git-tag: git_tag
chmod: '0755'
Can you double check the Symfony related doc to make sure there Compiler is properly compiled while building the PHAR?
You also need to ensure the environment is prod and debug disabled at all times within the PHAR (it needs to be seen as a prod ready and prod only app).
On Thu 25 Apr 2019 at 21:17, Julian notifications@github.com wrote:
tried to compile a symfony project with box 3.7.0
!/usr/bin/env php
Fatal error: Uncaught Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: The file "./config" does not exist (in: ). in phar://
/puppet-enc/build/puppet-enc.phar/vendor/symfony/config/FileLocator.php:71 Stack trace: 0 phar://
/puppet-enc/build/puppet-enc.phar/vendor/symfony/http-kernel/Config/FileLocator.php(52): Symfony\Component\Config\FileLocator->locate('./config', NULL, true) 1 phar://
/puppet-enc/build/puppet-enc.phar/vendor/symfony/config/Loader/FileLoader.php(110): Symfony\Component\HttpKernel\Config\FileLocator->locate('./config', NULL, true) 2 phar://
/puppet-enc/build/puppet-enc.phar/vendor/symfony/dependency-injection/Loader/GlobFileLoader.php(26): Symfony\Component\Config\Loader\FileLoader->glob('/{packages}/*.{...', false, NULL) 3 phar://
/pu in phar:// /puppet-enc/build/puppet-enc.phar/vendor/symfony/config/FileLocator.php on line 71 box.yaml
files:
- composer.json directories:
- bin
- config
- src
- lib finder:
name: '.' in: vendor exclude:
- .gitignore
- .md
- phpunit
- Tester
- Tests
- tests compactors:
- Herrera\Box\Compactor\Json
- Herrera\Box\Compactor\Php compression: GZ main: bin/puppet-enc output: build/puppet-enc.phar stub: true git-commit: git_commit git-version: git_version git-tag: git_tag chmod: '0755'
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/humbug/box/issues/193#issuecomment-486648271, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHPVAPJDF6ZJYQFKDJNY2TPSGOPBANCNFSM4E6GH4QQ .
/cc @c33s