dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

v1.30.0 dependency resolution regression with subpackages in dependency #2587

Closed WebFreak001 closed 1 year ago

WebFreak001 commented 1 year ago

Reproduction:

// a/dub.json
{
        "name": "a",
        "dependencies": {
                "b": {"path":"../b"}
        }
}
// b/dub.json
{
        "name": "b",
        "dependencies": {
                "b:sub":"*"
        },
        "subPackages": [
                {
                        "name": "sub",
                        "dependencies": {
                                "c": {"path":"../c"}
                        }
                }
        ]
}
// c/dub.json
{
        "name": "c"
}

In b the subpackage can be embedded in the recipe or standalone, it doesn't matter for the upgrade bug.

Trying to run dub upgrade in a causes

Error Unresolvable dependencies to package c:
  b:sub @/tmp/repr/b depends on c @/tmp/repr/c

Worked with 1.29.2 and before.

WebFreak001 commented 1 year ago

introduced by 65fb2fa12ca4352ba5f8c8cce3488a661abd6300 @Geod24

WebFreak001 commented 1 year ago

readding toHash does not seem to fix this in current stable branch

WebFreak001 commented 1 year ago

when readding toHash in the git history, 4e86806c seems to be the introducing commit

WebFreak001 commented 1 year ago

possible factor: toHash + opEquals used to only check on the version range, ignoring path and repo based values - this might be altering the internal AA state

Additional weirdness: packages in dub.d getPackageRaw (name, dep) don't match:

old working calls:

getPackageRaw: a ~master
getPackageRaw: b ~master
getPackageRaw: a >=0.0.0 @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: b >=0.0.0 @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: b:sub >=0.0.0 @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: c ~master
getPackageRaw: c >=0.0.0 @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/c

new broken calls:

getPackageRaw: a ~master
getPackageRaw: b ~master
getPackageRaw: a @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: b @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: b:sub @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/b
getPackageRaw: c ~master
getPackageRaw: b:sub @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/c
getPackageRaw: b @/home/webfreak/dev/dub/test/issue2587-subpackage-dependency-resolution/c

although there is also weirdness in both versions, that a would search inside the b folder, now it looks like b and b:sub also search both in the b and the c folder