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

Explaination about main.9999999 in symfony.lock #953

Open
alchy58 opened this issue Oct 8, 2022 · 2 comments
Open

Explaination about main.9999999 in symfony.lock #953

alchy58 opened this issue Oct 8, 2022 · 2 comments

Comments

@alchy58
Copy link

alchy58 commented Oct 8, 2022

Hello,

I'm developing a bundle and requires it in a project using a dev-main version.
When the Flex Downloader compares bundle version and recipe version, it transforms the bundle "dev-main" version into "main.9999999"

The recipe is well installed, so it's the bundle.

Except maybe that the symfony.lock is updated with "main.9999999" as the package version. The recipe version is good.

When removing the bundle, composer fails with the error "Invalid version string "main.9999999", as it should be "dev-main" like in the composer.json file.

If I set manually "dev-main" as the bundle version in symfony.lock, the composer remove works well.

I wonder to have more explanations about dumping a modified version into symfony.lock if it's the wanted behavior. In this case, the official documentation may lack of informations about developing recipes for bundle having dev-main version.

Otherwise I would propose to update the Flex\Downloaded so the symfony.lock version remains the composer.json version. Either the sanitized $version can be renamed in $sanitizedVersion or somewhat more explicit

Flex\Downloader

                $sanitizedVersion = explode('.', preg_replace('/^dev-|^v|\.x-dev$|-dev$/', '', $version));
                $sanitizedVersion = $sanitizedVersion[0].'.'.($sanitizedVersion[1] ?? '9999999');

                foreach (array_reverse($recipeVersions) as $v => $endpoint) {
                    if (version_compare($sanitizedVersion, $v, '<')) {

Or the original $version may be renamed into $packageVersion or $composerVersion.

Thank you for returns

@gspirov
Copy link

gspirov commented Jun 21, 2023

@alchy58 did you manage to figure it out how to proceed with dev- branches and changing them frequently while having proper version of the recipe in the symfony.lock?

@rnbw-spctrm
Copy link

Running into this and it's blocking composer use generally.

In VersionParser.php line 186: Invalid version string "9999999.9999999"

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

3 participants