flex icon indicating copy to clipboard operation
flex copied to clipboard

Invalid version string "master.9999999"

Open candyman1332 opened this issue 1 year ago • 2 comments

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

candyman1332 avatar Feb 26 '24 11:02 candyman1332

Same as #887

aivus avatar May 17 '24 10:05 aivus

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!

javiereguiluz avatar Jun 11 '24 09:06 javiereguiluz