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

Require command without lock file fails #11814

Closed
cs278 opened this issue Jan 24, 2024 · 0 comments
Closed

Require command without lock file fails #11814

cs278 opened this issue Jan 24, 2024 · 0 comments
Labels
Milestone

Comments

@cs278
Copy link
Contributor

cs278 commented Jan 24, 2024

My composer.json:

{"config": {"lock": false}}

Output of composer diagnose:

Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK git version 2.43.0
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Composer version: 2.6.999-dev+source
PHP version: 8.2.15
PHP binary path: /usr/bin/php8.2
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
cURL version: 7.81.0 libz 1.2.11 ssl OpenSSL/3.0.2
zip: extension present, unzip present, 7-Zip present (7z)

When I run this command:

composer require -vvv psr/log

I get the following output:

Running 2.6.999-dev+source (@release_date@) with PHP 8.2.15 on Linux / 6.5.6-76060506-generic
Reading ./composer.json (/tmp/chris.smith/tmp.Gx909ip48E/composer.json)
Loading config file /home/chris.smith/.config/composer/config.json
Loading config file /home/chris.smith/.config/composer/auth.json
Loading config file ./composer.json (/tmp/chris.smith/tmp.Gx909ip48E/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): hg branch
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): fossil branch list
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): fossil tag list
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): svn info --xml
Reading /home/chris.smith/.config/composer/composer.json
Loading config file /home/chris.smith/.config/composer/config.json
Loading config file /home/chris.smith/.config/composer/auth.json
Loading config file /home/chris.smith/.config/composer/composer.json (/home/chris.smith/.config/composer/composer.json)
Loading config file /home/chris.smith/.config/composer/auth.json
Reading /home/chris.smith/.config/composer/auth.json
Reading /tmp/chris.smith/tmp.Gx909ip48E/vendor/composer/installed.json
Reading /home/chris.smith/.cache/composer/repo/https---repo.packagist.org/packages.json from cache
Downloading https://repo.packagist.org/packages.json if modified
[304] https://repo.packagist.org/packages.json
Reading /home/chris.smith/.cache/composer/repo/https---repo.packagist.org/provider-psr~log.json from cache
Downloading https://repo.packagist.org/p2/psr/log.json if modified
[304] https://repo.packagist.org/p2/psr/log.json
./composer.json has been updated
Reading ./composer.json (/tmp/chris.smith/tmp.Gx909ip48E/composer.json)
Loading config file /home/chris.smith/.config/composer/config.json
Loading config file /home/chris.smith/.config/composer/auth.json
Loading config file ./composer.json (/tmp/chris.smith/tmp.Gx909ip48E/composer.json)
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): git describe --exact-match --tags
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): hg branch
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): fossil branch list
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): fossil tag list
Executing command (/tmp/chris.smith/tmp.Gx909ip48E): svn info --xml
Reading /home/chris.smith/.config/composer/composer.json
Loading config file /home/chris.smith/.config/composer/config.json
Loading config file /home/chris.smith/.config/composer/auth.json
Loading config file /home/chris.smith/.config/composer/composer.json (/home/chris.smith/.config/composer/composer.json)
Loading config file /home/chris.smith/.config/composer/auth.json
Reading /home/chris.smith/.config/composer/auth.json
Reading /tmp/chris.smith/tmp.Gx909ip48E/vendor/composer/installed.json
Running composer update psr/log
Loading composer repositories with package information
Reading /home/chris.smith/.cache/composer/repo/https---repo.packagist.org/packages.json from cache
Downloading https://repo.packagist.org/packages.json if modified
[304] https://repo.packagist.org/packages.json
Reading /home/chris.smith/.cache/composer/repo/https---repo.packagist.org/provider-psr~log.json from cache
Downloading https://repo.packagist.org/p2/psr/log.json if modified
[304] https://repo.packagist.org/p2/psr/log.json
Built pool.
Running pool optimizer.
Pool optimizer completed in 0.002 seconds
Found 100 package versions referenced in your dependency graph. 7 (7%) were optimized away.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 93 packages to resolve dependencies
Analyzed 94 rules to resolve dependencies
Nothing to install, update or remove
Generating autoload files
Reading /home/chris.smith/.cache/composer/repo/https---repo.packagist.org/provider-psr~log.json from cache
No security vulnerability advisories found.
Using version ^3.0 for psr/log

In RequireCommand.php line 555:
                                                
  [ErrorException]                              
  filemtime(): stat failed for ./composer.lock  
                                                

Exception trace:
  at /home/chris.smith/src/composer/src/Composer/Command/RequireCommand.php:555
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 filemtime() at /home/chris.smith/src/composer/src/Composer/Command/RequireCommand.php:555
 Composer\Command\RequireCommand->updateRequirementsAfterResolution() at /home/chris.smith/src/composer/src/Composer/Command/RequireCommand.php:341
 Composer\Command\RequireCommand->execute() at /home/chris.smith/src/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /home/chris.smith/src/composer/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /home/chris.smith/src/composer/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /home/chris.smith/src/composer/src/Composer/Console/Application.php:382
 Composer\Console\Application->doRun() at /home/chris.smith/src/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /home/chris.smith/src/composer/src/Composer/Console/Application.php:145
 Composer\Console\Application->run() at /home/chris.smith/src/composer/bin/composer:94

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

And I expected this to happen:

Success

@cs278 cs278 changed the title Require without lock file fails Require command without lock file fails Jan 24, 2024
@Seldaek Seldaek closed this as completed in ef6c224 Feb 6, 2024
@Seldaek Seldaek added this to the 2.7 milestone Feb 6, 2024
@Seldaek Seldaek added the Bug label Feb 6, 2024
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