Skip to content

satis build doesn't pass config to composer #878

@dr-diesel

Description

@dr-diesel

Hello,

BuildCommand uses this method to get $composer with config:

        /** @var SatisApplication|ComposerApplication $application */
        $application = $this->getApplication();
        if ($application instanceof SatisApplication) {
            $composer = $application->getComposerWithConfig($config);
        } else {
            $composer = $application->getComposer(true);
        }

public function getComposerWithConfig(mixed $config): ?Composer

Unfortunately BaseCommand already creates $application->composer in BaseCommand::initialize() :

https://github.com/composer/composer/blob/11e5237ad9d9e8f29bdc57d946f87c816320d863/src/Composer/Command/BaseCommand.php#L240

For me solution in Satis was to remove if (null === $this->composer) { in Application::getComposerWithConfig() , called only in BuildCommand. Than $composer is recreated with config from .json "config" key, mentioned in docs here: https://composer.github.io/satis/using

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