Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dub to v1.39 #315

Merged
merged 6 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileVersion": 1,
"versions": {
"dub": "1.38.0",
"dub": "1.39.0",
"unit-threaded": "2.2.0"
}
}
18 changes: 1 addition & 17 deletions payload/reggae/dub/info.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
14 changes: 13 additions & 1 deletion payload/reggae/options.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down