diff --git a/.github/workflows/d.yml b/.github/workflows/d.yml index 9d834a29..9d7722a8 100644 --- a/.github/workflows/d.yml +++ b/.github/workflows/d.yml @@ -55,10 +55,10 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-12, windows-2022] + os: [ubuntu-22.04, macos-13, windows-2022] dc: + - dmd-2.110.0 - dmd-2.108.0 - - dmd-2.105.2 - ldc-1.37.0 runs-on: ${{ matrix.os }} defaults: diff --git a/dub.json b/dub.json index f2025bb9..b62a741b 100644 --- a/dub.json +++ b/dub.json @@ -13,7 +13,7 @@ "mainSourceFile": "src/reggae/reggae_main.d", "preGenerateCommands": ["rdmd $PACKAGE_DIR/list_payload.d $PACKAGE_DIR"], "dependencies": { - "dub": "~>1.38.0" + "dub": "~>1.39.0" }, "subConfigurations": { "dub": "library" diff --git a/dub.selections.json b/dub.selections.json index b1f8b8ba..f8e0f665 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,7 +1,7 @@ { "fileVersion": 1, "versions": { - "dub": "1.38.0", + "dub": "1.39.0", "unit-threaded": "2.2.0" } } diff --git a/payload/reggae/dub/info.d b/payload/reggae/dub/info.d index 777e88b2..b1eecf7a 100644 --- a/payload/reggae/dub/info.d +++ b/payload/reggae/dub/info.d @@ -85,23 +85,7 @@ struct DubPackage { } const(string)[] compilerFlags(in string compilerBinName) @safe pure const { - import std.algorithm: among, startsWith; - - const(string)[] pkgDflags = dflags; - if(compilerBinName.among("ldc", "ldc2")) { - if (pkgDflags.length) { - // For LDC, dub implicitly adds `--oq -od=…/obj` to avoid object-file collisions. - // Remove that workaround for reggae; it's not needed and unexpected. - foreach (i; 0 .. pkgDflags.length - 1) { - if (pkgDflags[i] == "--oq" && pkgDflags[i+1].startsWith("-od=")) { - pkgDflags = pkgDflags[0 .. i] ~ pkgDflags[i+2 .. $]; - break; - } - } - } - } - - return pkgDflags; + return dflags; } } diff --git a/payload/reggae/options.d b/payload/reggae/options.d index 153572ae..8fa614ae 100644 --- a/payload/reggae/options.d +++ b/payload/reggae/options.d @@ -242,8 +242,20 @@ struct Options { maybeDubDeps ~= _dubProjectFile; const selectionsJsonPath = buildPath(projectPath, "dub.selections.json"); - if (selectionsJsonPath.exists) + if (selectionsJsonPath.exists) { maybeDubDeps ~= selectionsJsonPath; + } else version(Have_dub) { + import dub.packagemanager: PackageManager; + import dub.internal.vibecompat.inet.path: NativePath; + + () @trusted { + auto projectRoot = NativePath(projectPath); + auto pm = new PackageManager(projectRoot); + const res = pm.readSelections(projectRoot); + if (!res.isNull()) + maybeDubDeps ~= res.get().absolutePath.toNativeString(); + }(); + } } return ranFromPath ~ maybeReggaeFile ~ maybeReggaeFileDeps ~ maybeDubDeps ~ dependencies;