Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into selections-from-p…
Browse files Browse the repository at this point in the history
…arent-dir
  • Loading branch information
Geod24 committed Jun 18, 2024
2 parents 08dcd47 + 0975986 commit cd770ed
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
12 changes: 6 additions & 6 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 11 additions & 5 deletions source/dub/compilers/ldc.d
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion source/dub/version_.d
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
module dub.version_;
enum dubVersion = "v1.38.0";
enum dubVersion = "v1.38.1-rc.1";
17 changes: 6 additions & 11 deletions test/removed-dub-obj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit cd770ed

Please sign in to comment.