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

Recipe for 'dev-master' is not installed #956

Open
zerustech opened this issue Oct 24, 2022 · 3 comments
Open

Recipe for 'dev-master' is not installed #956

zerustech opened this issue Oct 24, 2022 · 3 comments

Comments

@zerustech
Copy link

// src/Downloader.php
// line: 200
// 'master.9999999' is an alias of 'dev-master', so they should be identical, but 
// version_compare('master.9999999', 'dev-master', '<') returns true, 
// so if the bundle's version is 'dev-master', which is normalized as 'master.9999999', 
// and the recipe version is 'dev-master', then the 'dev-master' recipe will not be matched.
// This issue affects bundle developers who need install 'dev-master' recipes frequently when developing bundles.
if (version_compare($version, $v, '<')) {
    continue;
}
@stof
Copy link
Member

stof commented Oct 24, 2022

where is this master.9999999 coming from ?

@zerustech
Copy link
Author

where is this master.9999999 coming from ?

// src/Downloader.php
if ($recipeVersions = $this->index[$package->getName()] ?? null) {
    $version = explode('.', preg_replace('/^dev-|^v|\.x-dev$|-dev$/', '', $version));
    // Line: 197
    // When the original value of $version is 'dev-master', this line of code will
    // normalize $version to 'master.9999999'
    $version = $version[0].'.'.($version[1] ?? '9999999');

@zerustech
Copy link
Author

There is a workaround:

  1. Configure a branch alias (e.g., 1.0.x-dev) for 'dev-master' of the bundle repository. The version-like alias will be normalized to '1.0' by the Downloader;
  2. Configure a '1.0.x-dev' or '1.0' recipe, so that the normalized package version is not earlier than the recipe version;
  3. In this way, the recipe version will be matched and installed.

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

2 participants