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

Erroneous compression algorithm info #20

Closed
rask opened this issue Jan 8, 2018 · 6 comments
Closed

Erroneous compression algorithm info #20

rask opened this issue Jan 8, 2018 · 6 comments
Labels

Comments

@rask
Copy link

rask commented Jan 8, 2018

Attempted to follow installation instructions for a project-installation with bamarni/composer-bin-plugin as such:

$ composer require --dev bamarni/composer-bin-plugin
$ composer bin box require --dev humbug/box
# then inserted required commands to `post-install-cmd` and `post-update-cmd`
$ composer update # just in case

When attempting to run

$ vendor/bin/box help build

I receive the following error:

PHP Fatal error: Uncaught error: Class 'KevinGH\Box\Application' not found in /path/to/project/vendor-bin/box/vendor/humbug/box/bin/box:19

It seems like bamarni/composer-bin-plugin is not running composer install on packages properly as the humbug/box vendor directory is missing a vendor directory.

I will try and see if a global installation changes anything, but I would like to carry the dep as a local dep with the project to make CI build pipelines just a little simpler to set up.

@theofidry
Copy link
Member

Try to do:

composer bin box require --dev humbug/box:dev-master

This fork is still not very stable yet. The tests are green so it should be ok but I prefer to be transparent and say that I it's not ready for an alpha or beta release yet :)

Also regarding bamarni you should see when it executes the install, but if you want to run an install/update or anything again, you should do:

composer bin box update
# or
composer bin all

Otherwise you're running the composer command for the root composer.json, not the vendor-bin/box/composer.json one

@rask
Copy link
Author

rask commented Jan 8, 2018

I'll see what the dev-master version says, thanks. :)

Global installation works fine otherwise, but I keep getting errors regarding temporary file creation. Perhaps that is fixed in the dev-master setup too.

I'll get back when I learn more.

@rask
Copy link
Author

rask commented Jan 8, 2018

Okay, dev-master fixed the issues, and the temporary file error stemmed from invalid compression option.

What are the valid values for compression in box.json? According to help build GZ and BZ2 are fine, but with GZ it fails.

Thanks!

@theofidry
Copy link
Member

Weird, sorry can't look atm. What error do you get exactly?

@theofidry
Copy link
Member

Hm after looking into this I found an issue. So the compression algorithm works fine on my end: the PHAR is properly compressed. However, Phar::isCompressed() or box info myphar.phar returns respectively false and None. This is due to Box using Phar::compressFiles() instead of Phar::compress(). In theory it does the same thing, in practice the second override the stub file. Box uses a custom stub file so this is a no go, and unfortunately because of that the result is a lie.

@theofidry theofidry added the bug label Jan 20, 2018
@theofidry theofidry changed the title KevinGH\Box\Application not found in bin/box:19 Erroneous compression algorithm info Jan 20, 2018
theofidry added a commit to theofidry/box that referenced this issue Jan 20, 2018
Investigate box-project#20; The compression
works well enough except for a bug from `\Phar::isCompressed()`.

A few more validation have been added and the logging tweaked  to ensure a better UX.
theofidry added a commit that referenced this issue Jan 20, 2018
Investigate #20; The compression works well enough except for a bug from `\Phar::isCompressed()`.

A few more validation have been added and the logging tweaked  to ensure a better UX:

- The compression algorithm used is now shown when building in verbose mode
- A warning in shown in verbose mode when no compression algorithm is used
- Adding files & directories is logged in verbose mode only like the rest of the config
- Provide more checks & a better message upon failure when the compression algorithm is invalid

Also fixed an unrelated issue: moved the step build dependencies down to the `bin/box.phar` as otherwise it's apparently not being picked up properly
@theofidry
Copy link
Member

Closed by #93

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

No branches or pull requests

2 participants