symfony / flex

Composer plugin for Symfony
MIT License
4.17k stars 183 forks source link

Invalid version string "master.9999999" #1016

Closed candyman1332 closed 3 weeks ago

candyman1332 commented 8 months ago

Hi,

i'm using private recipes. During development i add a master version instaead of "1.0". It's cool and Flex found the version and installed it. But in the symfony.lock File in the Version it is

    "XXX/YYY": {
        "version": "master.9999999",
        "recipe": {
            "repo": "XXX.YYY",
            "branch": "master",
            "version": "master",
            "ref": "15ed78413939e240efb1037133e852ac3bdc293c"
        }
    },

When i now add a new package oder update an existing Symfony/Flex throws the Error

In VersionParser.php line 186:

  [UnexpectedValueException]
  Invalid version string "master.9999999"  

When i remove the entry from the symfony.lock file i can update/add my packages, but Symfony/Flex added the bad lines again.

I'm using symfony/flex v2.4.4

aivus commented 5 months ago

Same as #887

javiereguiluz commented 4 months ago

Ping @nicolas-grekas. I'm seeing this error right now when trying to upgrade apps to Symfony 7.1.

@stof helped me on Symfony Slack #support channel. These are some of his comments:


Looking at the code at https://github.com/symfony/flex/blob/4dc11919791f81d087a12db2ab4c7e044431ef6b/src/Downloader.php#L196-L205, it seems like it will generate its own version format there, and then register that in the lock file, potentially using those 99999 parts. I think that's the issue, as the loading of the lock file expects to be able to normalize the version

My guess is that code on line 204 writing the lock data was expecting to use the original $version variable and not the modified one


Thanks!