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

Invalid version string "master.9999999" #1016

Open
candyman1332 opened this issue Feb 26, 2024 · 2 comments
Open

Invalid version string "master.9999999" #1016

candyman1332 opened this issue Feb 26, 2024 · 2 comments

Comments

@candyman1332
Copy link

candyman1332 commented Feb 26, 2024

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
Copy link
Contributor

aivus commented May 17, 2024

Same as #887

@javiereguiluz
Copy link
Member

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

flex/src/Downloader.php

Lines 196 to 205 in 4dc1191

$version = explode('.', preg_replace('/^dev-|^v|\.x-dev$|-dev$/', '', $version));
$version = $version[0].'.'.($version[1] ?? '9999999');
foreach (array_reverse($recipeVersions) as $v => $endpoint) {
if (version_compare($version, $v, '<')) {
continue;
}
$data['locks'][$package->getName()]['version'] = $version;
$data['locks'][$package->getName()]['recipe']['version'] = $v;
, 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!

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