diff --git a/dub.selections.json b/dub.selections.json index 3a781587d..b10e96e0b 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -4,18 +4,18 @@ "botan": "1.12.19", "botan-math": "1.0.3", "diet-ng": "1.8.1", - "eventcore": "0.9.27", + "eventcore": "0.9.30", "libasync": "0.8.6", "libev": "5.0.0+4.04", "libevent": "2.0.2+2.0.16", "memutils": "1.0.10", "mir-linux-kernel": "1.0.1", "openssl": "3.3.3", - "openssl-static": "1.0.2+3.0.8", + "openssl-static": "1.0.5+3.0.8", "stdx-allocator": "2.77.5", - "taggedalgebraic": "0.11.22", - "vibe-container": "1.0.1", - "vibe-core": "2.7.1", - "vibe-d": "0.9.7" + "taggedalgebraic": "0.11.23", + "vibe-container": "1.3.1", + "vibe-core": "2.8.5", + "vibe-d": "0.9.8" } } diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index 3959df615..0ca58c29e 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -104,7 +104,6 @@ config /etc/ldc2.conf (x86_64-pc-linux-gnu) void prepareBuildSettings(ref BuildSettings settings, const scope ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const { - import std.format : format; enforceBuildRequirements(settings); // Keep the current dflags at the end of the array so that they will overwrite other flags. @@ -118,9 +117,6 @@ config /etc/ldc2.conf (x86_64-pc-linux-gnu) settings.addDFlags(t[1]); } - // since LDC always outputs multiple object files, avoid conflicts by default - settings.addDFlags("--oq", format("-od=%s/obj", settings.targetPath)); - if (!(fields & BuildSetting.versions)) { settings.addDFlags(settings.versions.map!(s => "-d-version="~s)().array()); settings.versions = null; @@ -241,7 +237,17 @@ config /etc/ldc2.conf (x86_64-pc-linux-gnu) case TargetType.executable: break; case TargetType.library: case TargetType.staticLibrary: - settings.addDFlags("-lib"); + // -oq: name object files uniquely (so the files don't collide) + settings.addDFlags("-lib", "-oq"); + // -cleanup-obj (supported since LDC v1.1): remove object files after archiving to static lib + if (platform.frontendVersion >= 2071) { + settings.addDFlags("-cleanup-obj"); + } + if (platform.frontendVersion < 2095) { + // Since LDC v1.25, -cleanup-obj defaults to a unique temp -od directory + // We need to resort to a unique-ish -od directory before that + settings.addDFlags("-od=" ~ settings.targetPath ~ "/obj"); + } break; case TargetType.dynamicLibrary: settings.addDFlags("-shared"); diff --git a/source/dub/version_.d b/source/dub/version_.d index 439fb852d..ae956a60e 100644 --- a/source/dub/version_.d +++ b/source/dub/version_.d @@ -1,2 +1,2 @@ module dub.version_; -enum dubVersion = "v1.38.0"; +enum dubVersion = "v1.38.1-rc.1"; diff --git a/test/removed-dub-obj.sh b/test/removed-dub-obj.sh index 1334f8b3d..d767b43e3 100755 --- a/test/removed-dub-obj.sh +++ b/test/removed-dub-obj.sh @@ -3,19 +3,14 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh cd ${CURR_DIR}/removed-dub-obj -DUB_CACHE_PATH="$HOME/.dub/cache/removed-dub-obj/" +DUB_CACHE_PATH="$HOME/.dub/cache/removed-dub-obj" -rm -rf $DUB_CACHE_PATH +rm -rf "$DUB_CACHE_PATH" ${DUB} build --compiler=${DC} -[ -d "$DUB_CACHE_PATH/obj" ] && die $LINENO "$DUB_CACHE_PATH/obj was found" +[ -d "$DUB_CACHE_PATH" ] || die $LINENO "$DUB_CACHE_PATH not found" -if [[ ${DC} == *"ldc"* ]]; 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-*/obj/test.o* was not found' - fi -fi - -exit 0 +numObjectFiles=$(find "$DUB_CACHE_PATH" -type f -iname '*.o*' | wc -l) +# note: fails with LDC < v1.1 +[ "$numObjectFiles" -eq 0 ] || die $LINENO "Found left-over object files in $DUB_CACHE_PATH"