diff --git a/changelog/toolchain_requirements.dd b/changelog/toolchain_requirements.dd index b72fb79..70172b8 100644 --- a/changelog/toolchain_requirements.dd +++ b/changelog/toolchain_requirements.dd @@ -8,7 +8,7 @@ { "toolchainRequirements": { "dub": "~>1.10", - "frontend": ">=2.068|<2.083" + "frontend": ">=2.068 <2.083" } } --- @@ -27,9 +27,11 @@ $(LI gdc) ) -Each can be assigned to one or more version specifications, separated by `|`. -For compilers, instead of a version specification, the keyword `no` can also be -used to indicate that the compiler should not be used for this package. +Each can contain a +$(LINK2 https://dub.pm/package-format-sdl.html#version-specs version specification), +where DMD-like versions are supported in addition to SemVer versions. For +compilers, instead of a version specification, the keyword `no` can also be used +to indicate that the compiler should not be used for this package. Example scenario:$(BR) Package that needs DUB>=1.12, and that will only build with LDC>=1.10: diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index b087cd8..bfc4b84 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -126,9 +126,11 @@ const ver = Version(dmdVer ? dmdLikeVersionToSemverLike(toolVer) : toolVer); return requirement - .splitter('|') - .map!(r => Dependency(dmdVer ? dmdLikeVersionToSemverLike(r) : r)) - .all!(r => r.matches(ver)); + .splitter(' ') + .map!(r => dmdVer ? dmdLikeVersionToSemverLike(r) : r) + .join(' ') + .Dependency + .matches(ver); } /** Runs a tool and provides common boilerplate code. diff --git a/test/issue1531-toolchain-requirements.sh b/test/issue1531-toolchain-requirements.sh index 77bf5f4..c384198 100755 --- a/test/issue1531-toolchain-requirements.sh +++ b/test/issue1531-toolchain-requirements.sh @@ -91,7 +91,7 @@ test_cl_req_fail ">$DC_VER" test_cl_req_pass "<=$DC_VER" test_cl_req_fail "<$DC_VER" -test_cl_req_pass ">=$DC_VER|<$(($DC_VER_MAJ + 1))$DC_VER_REM" +test_cl_req_pass ">=$DC_VER <$(($DC_VER_MAJ + 1))$DC_VER_REM" test_cl_req_pass "~>$DC_VER" test_cl_req_fail "~>$(($DC_VER_MAJ + 1))$DC_VER_REM" test_cl_req_fail no