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

"res/schema.json" does not exist in Assert.php on line 2074 #1010

Closed
Cvar1984 opened this issue Sep 23, 2023 · 8 comments
Closed

"res/schema.json" does not exist in Assert.php on line 2074 #1010

Cvar1984 opened this issue Sep 23, 2023 · 8 comments

Comments

@Cvar1984
Copy link

Cvar1984 commented Sep 23, 2023

Bug report

Question Answer
Box version "humbug/box": "^3.8"
PHP version PHP 8.2.10 (cli) (built: Sep 2 2023 01:32:24) (NTS)
Platform with version Linux Artix 6.5.2-artix1-1 # 1 SMP PREEMPT_DYNAMIC Fri, 08 Sep 2023 13:16:06 +0000 x86_64 GNU/Linux
Composer version 2.6.3 2023-09-15 09:38:21
Project link https://github.com/cvar1984/yapo

installing from composer and return schema.json does not exist. this never happens before in past 3 years

box.json.dist
{
 "alias": "main.phar",
 "chmod": "0755",
 "finder": [
   {
     "name": ["*"],
     "exclude": ["test","tests","example","examples"],
     "in": ["vendor","src"]
   }
 ],
 "main": "main.php",
 "output": "bin/yapo",
 "stub": true,
 "algorithm": "SHA512",
 "compression": "GZ"
}
Output
$ vendor/bin/box compile
> Box version 3.14.1@efdf63b

// Loading the configuration file "/home/cvar1984/yapo/box.json".                                                      

                                                                                                                       
[ERROR] The configuration file is invalid.                                                                             
                                                                                                                       


In Assert.php line 2074:
                                                                                                     
 The file "/home/cvar1984/yapo/vendor/humbug/box/src/Console/../../res/schema.json" does not exist.
@Cvar1984 Cvar1984 changed the title "res/schema.json" does not exist in Assert.php on line 2074: "res/schema.json" does not exist in Assert.php on line 2074 Sep 23, 2023
@theofidry
Copy link
Member

@Cvar1984 I admit I'm quite confused, do you have a reproducer?

git clone https://github.com/cvar1984/yapo
cd yapo
composer install
vendor/bin/box compile

worked for me. The error message is quite confusing as well because if you do browser the files for that release the file can be found at that path. The release notes and the ones around this version don't hint on any change about this either.

I would also point out that 3.14.1 is over 1.5y old, the latest release being 4.3.8.

@Cvar1984
Copy link
Author

yeah the error is very confusing i ommit this config to make it works for 4.3.8@5534406 but the phar i download from release shows different result from which i download using a composer https://asciinema.org/a/zalNEXi9aWZGLrGtrw5UFwnjT

@Cvar1984 Cvar1984 reopened this Sep 26, 2023
@theofidry
Copy link
Member

Is there any reason why the file would not be present:

$ composer require humbug/box <- installs 4.3.8
$ ls -l vendor/humbug/box/src/Configuration/../../res/schema.json <- the file exists

if you delete your vendor and install it again does it consistently shows that vendor/humbug/box/res does not contain schema.json?

@Cvar1984
Copy link
Author

Cvar1984 commented Oct 2, 2023

Is there any reason why the file would not be present:

$ composer require humbug/box <- installs 4.3.8
$ ls -l vendor/humbug/box/src/Configuration/../../res/schema.json <- the file exists

if you delete your vendor and install it again does it consistently shows that vendor/humbug/box/res does not contain schema.json?

its still not presented i have tried using another version its the same but the phars is not problem

Box version 4.3.8@5534406
vendor/humbug/box/
├── bin
│   ├── box
│   ├── box.bat
│   └── generate_default_stub
├── composer.json
├── LICENSE
└── src
    ├── Amp
    │   └── FailureCollector.php
    ├── Annotation
    │   ├── CompactedFormatter.php
    │   ├── DocblockAnnotationParser.php
    │   └── MalformedTagException.php
    ├── Box.php
    ├── Compactor
    │   ├── BaseCompactor.php
    │   ├── Compactor.php
    │   ├── Compactors.php
    │   ├── FileExtensionCompactor.php
    │   ├── Json.php
    │   ├── Php.php
    │   ├── PhpScoper.php
    │   └── Placeholder.php
    ├── Composer
    │   ├── ComposerConfiguration.php
    │   ├── ComposerFile.php
    │   ├── ComposerFiles.php
    │   ├── ComposerOrchestrator.php
    │   └── IncompatibleComposerVersion.php
    ├── Configuration
    │   ├── ConfigurationLoader.php
    │   ├── ConfigurationLogger.php
    │   ├── Configuration.php
    │   ├── ExportableConfiguration.php
    │   └── NoConfigurationFound.php
    ├── Console
    │   ├── Application.php
    │   ├── Command
    │   │   ├── ChangeWorkingDirOption.php
    │   │   ├── Compile.php
    │   │   ├── ConfigOption.php
    │   │   ├── ConfigurationExporter.php
    │   │   ├── Diff.php
    │   │   ├── Extract.php
    │   │   ├── GenerateDockerFile.php
    │   │   ├── Info.php
    │   │   ├── Namespace_.php
    │   │   ├── Process.php
    │   │   ├── Validate.php
    │   │   └── Verify.php
    │   ├── ConfigurationLoader.php
    │   ├── ConfigurationLocator.php
    │   ├── Logger
    │   │   └── CompilerLogger.php
    │   ├── Logo.php
    │   ├── MessageRenderer.php
    │   ├── OutputFormatterConfigurator.php
    │   ├── PharInfoRenderer.php
    │   └── Php
    │       └── PhpSettingsHandler.php
    ├── consts.php
    ├── DockerFileGenerator.php
    ├── FileSystem
    │   ├── file_system.php
    │   └── FileSystem.php
    ├── functions.php
    ├── Json
    │   ├── Json.php
    │   └── JsonValidationException.php
    ├── MapFile.php
    ├── NotInstantiable.php
    ├── Phar
    │   ├── CompressionAlgorithm.php
    │   └── PharPhpSettings.php
    ├── Pharaoh
    │   ├── Pharaoh.php
    │   ├── PharDiff.php
    │   └── PharError.php
    ├── PharInfo
    │   ├── PharDiff.php
    │   └── PharInfo.php
    ├── PhpScoper
    │   ├── ExcludedFilesScoper.php
    │   ├── NullScoper.php
    │   ├── PatcherFactory.php
    │   ├── Scoper.php
    │   ├── SerializablePatcher.php
    │   └── SerializableScoper.php
    ├── RequirementChecker
    │   ├── AppRequirementsFactory.php
    │   ├── DecodedComposerJson.php
    │   ├── DecodedComposerLock.php
    │   ├── PackageInfo.php
    │   ├── RequiredItem.php
    │   ├── Requirement.php
    │   └── RequirementsDumper.php
    ├── StubGenerator.php
    └── Test
        ├── CommandTestCase.php
        ├── FileSystemTestCase.php
        └── RequiresPharReadonlyOff.php

20 directories, 82 files

@theofidry
Copy link
Member

It's very curious, I mean it is missing so much, there is not the res directory, not the composer.lock, not the docs or tests directory either.

If I do:

mkdir tmp && cd tmp
echo '{}' > composer.json
composer require humbug/box
tree vendor/humbug/box

Then I get 176 directories, 594 files. There is really a lot more. So I'm wondering how come you are missing all of that

@Cvar1984
Copy link
Author

Cvar1984 commented Oct 2, 2023

It's very curious, I mean it is missing so much, there is not the res directory, not the composer.lock, not the docs or tests directory either.

If I do:

mkdir tmp && cd tmp
echo '{}' > composer.json
composer require humbug/box
tree vendor/humbug/box

Then I get 176 directories, 594 files. There is really a lot more. So I'm wondering how come you are missing all of that

i clean up composer cache and i did the same as you did but i still got the same result 20 directories, 82 files using Composer version 2.6.3 2023-09-15 09:38:21 its so weird

@theofidry
Copy link
Member

Someone suggested this could be the result of a plugin such as https://github.com/dg/composer-cleaner.

By any chance do you have any plugin install either at the project level or globally?

@Cvar1984
Copy link
Author

Cvar1984 commented Oct 3, 2023

Someone suggested this could be the result of a plugin such as https://github.com/dg/composer-cleaner.

By any chance do you have any plugin install either at the project level or globally?

i never know i got that package installed globally, yes i think this is the issue

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