Skip to content

Main goal of project zero config application is no more respected #1582

@llaville

Description

@llaville

Bug report

Main goal of project zero config application is no more respected.

Question Answer
Box version 4.6.10
PHP version 8.3.29
Platform with version Ubuntu 24.4 LTS on Docker
Github Repo - https://github.com/TomasVotruba/lines

I want to build a PHAR copy of a project that not maintained by me, and that do not add BOX support (yet) for test purpose, and I can't !

The main reason is the dump-autoload configuration setting.

See related issue I got with #1507

Actual results

Output

    ____
   / __ )____  _  __
  / __  / __ \| |/_/
 / /_/ / /_/ />  <
/_____/\____/_/|_|


Box version 4.6.10@6dc6a13 2025-10-31 18:40:22 UTC

 // Loading without a configuration file.

🔨  Building the PHAR "/shared/backups/github/lines/bin/lines.phar"

? Checking Composer compatibility
    > Supported version detected
? No compactor to register
? Adding main file: /shared/backups/github/lines/bin/lines
? Adding requirements checker
? Adding binary files
    > No file found
? Auto-discover files? Yes
? Exclude dev files? Yes
? Adding files
    > 583 file(s)
? Generating new stub
  - Using shebang line: #!/usr/bin/env php
  - Using banner:
    > Generated by Humbug Box 4.6.10@6dc6a13.
    >
    > @link https://github.com/humbug/box
? Dumping the Composer autoloader

In ComposerOrchestrator.php line 85:

  Could not dump the autoloader.


In ComposerOrchestrator.php line 85:

  The command "'/usr/local/bin/composer' 'dump-autoload' '--classmap-authoritative' '--no-dev' '--ansi'" failed.

  Exit Code: 1(General error)

  Working directory: /tmp/box/Box58181

  Output:
  ================


  Error Output:
  ================
  Composer could not detect the root package (tomasvotruba/lines) version, defaulting to '1.0.0'. See https://getcomposer.org/root-ve
  rsion
  Composer could not detect the root package (tomasvotruba/lines) version, defaulting to '1.0.0'. See https://getcomposer.org/root-ve
  rsion

  In AutoloadGenerator.php line 1433:

    require(/tmp/box/Box58181/vendor/phpstan/phpstan/bootstrap.php): Failed to open stream: No such file or directory


  dump-autoload [-o|--optimize] [-a|--classmap-authoritative] [--apcu] [--apcu-prefix APCU-PREFIX] [--dry-run] [--dev] [--no-dev] [--ign
  ore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--strict-psr] [--strict-ambiguous]


compile [--debug] [--no-parallel] [--sort-compiled-files] [--no-restart] [--dev] [--no-config] [--with-docker] [--composer-bin COMPOSER-BIN] [--allow-composer-check-failure] [-c|--config CONFIG] [-d|--working-dir WORKING-DIR]

Expected results

Output

    ____
   / __ )____  _  __
  / __  / __ \| |/_/
 / /_/ / /_/ />  <
/_____/\____/_/|_|


Box version 4.6.10@6dc6a13 2025-10-31 18:40:22 UTC

 // Loading the configuration file "/shared/backups/github/lines/box.json".

🔨  Building the PHAR "/shared/backups/github/lines/bin/lines.phar"

? Skipping the Composer compatibility check: the autoloader is not dumped
? No compactor to register
? Adding main file: /shared/backups/github/lines/bin/lines
? Adding requirements checker
? Adding binary files
    > No file found
? Auto-discover files? Yes
? Exclude dev files? No
? Adding files
    > 8925 file(s)
? Generating new stub
  - Using shebang line: #!/usr/bin/env php
  - Using banner:
    > Generated by Humbug Box 4.6.10@6dc6a13.
    >
    > @link https://github.com/humbug/box
? Skipping dumping the Composer autoloader
? Removing the Composer dump artefacts
? Compressing with the algorithm "GZ"
    > Warning: the extension "zlib" will now be required to execute the PHAR
? Setting file permissions to 0755
* Done.

No recommendation found.
No warning found.

 // PHAR: 8958 files (13.04MB)
 // You can inspect the generated PHAR with the "info" command.

 // Memory usage: 28.83MB (peak: 92.34MB), time: 12s

I must add these configuration to build a running PHAR copy

box.json
{
   "compression": "GZ",
   "dump-autoload": false,
   "files": [
       "bin/lines",
       "bin/lines.php"
   ],
   "directories": [
       "src",
       "views",
       "vendor"
   ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions