diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index cdcad88ca..6ea65b5fe 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -34,19 +34,21 @@ string getObjSuffix(const scope ref BuildPlatform platform) string computeBuildName(string config, in GeneratorSettings settings, const string[][] hashing...) { - import std.digest.sha : SHA256, toHexString; + import std.digest.sha : SHA256; + import std.base64 : Base64URL; SHA256 hash; hash.start(); void addHash(in string[] strings...) { foreach (s; strings) { hash.put(cast(ubyte[])s); hash.put(0); } hash.put(0); } foreach(strings; hashing) addHash(strings); - const hashstr = hash.finish().toHexString(); + addHash(settings.platform.platform); + addHash(settings.platform.architecture); + addHash(settings.platform.compiler); + addHash(settings.platform.compilerVersion); + const hashstr = Base64URL.encode(hash.finish()[0 .. $ / 2]).stripRight("="); - return format("%s-%s-%s-%s-%s_v%s-%s", config, settings.buildType, - settings.platform.platform.join("."), - settings.platform.architecture.join("."), - settings.platform.compiler, settings.platform.compilerVersion, hashstr); + return format("%s-%s-%s", config, settings.buildType, hashstr); } class BuildGenerator : ProjectGenerator { diff --git a/test/issue2051_running_unittests_from_dub_single_file_packages_fails.d b/test/issue2051_running_unittests_from_dub_single_file_packages_fails.d index b7e5fbf40..a3caf1dac 100644 --- a/test/issue2051_running_unittests_from_dub_single_file_packages_fails.d +++ b/test/issue2051_running_unittests_from_dub_single_file_packages_fails.d @@ -1,5 +1,5 @@ /+ dub.sdl: - name "issue2051_running_unittests_from_dub_single_file_packages_fails" + name "issue2051" +/ import std.algorithm : any; diff --git a/test/removed-dub-obj.sh b/test/removed-dub-obj.sh index 8a168e297..1334f8b3d 100755 --- a/test/removed-dub-obj.sh +++ b/test/removed-dub-obj.sh @@ -12,9 +12,9 @@ ${DUB} build --compiler=${DC} [ -d "$DUB_CACHE_PATH/obj" ] && die $LINENO "$DUB_CACHE_PATH/obj was found" if [[ ${DC} == *"ldc"* ]]; then - if [ ! -f $DUB_CACHE_PATH/~master/build/library-*ldc*/obj/test.o* ]; then + if [ ! -f $DUB_CACHE_PATH/~master/build/library-*/obj/test.o* ]; then ls -lR $DUB_CACHE_PATH - die $LINENO '$DUB_CACHE_PATH/~master/build/library-*ldc*/obj/test.o* was not found' + die $LINENO '$DUB_CACHE_PATH/~master/build/library-*/obj/test.o* was not found' fi fi