From 5c9156729eab2b6e2e8fec2fa1cae084162756f8 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Mon, 15 Apr 2024 16:17:21 +0200 Subject: [PATCH] Restore relative output paths for DubPathDependency targets This was recently changed to absolute paths in f1c098d3e53f87f15e98adfabd97b89a5d3b45a3. --- payload/reggae/rules/dub/external.d | 5 ++--- src/reggae/reggae.d | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/payload/reggae/rules/dub/external.d b/payload/reggae/rules/dub/external.d index 57bb0d28..15c555a0 100644 --- a/payload/reggae/rules/dub/external.d +++ b/payload/reggae/rules/dub/external.d @@ -142,9 +142,8 @@ private struct DubPathDependency { // whole path to a target. return dubBuild(subOptions, dubInfo) - .mapOutputs((string o) => buildNormalizedPath(projectPath, - subOptions.projectPath.relativePath(projectPath), - o)); + .mapOutputs((string o) => buildNormalizedPath( + subOptions.projectPath.relativePath(projectPath), o)); } } diff --git a/src/reggae/reggae.d b/src/reggae/reggae.d index 850d382c..962a701f 100644 --- a/src/reggae/reggae.d +++ b/src/reggae/reggae.d @@ -445,6 +445,8 @@ private string buildReggaefileWithReggae( import std.stdio: stdout; buildReggaefileDub(stdout, options, Yes.needDub); + const dubRecipeDir = hiddenDirAbsPath(options); + // FIXME - use correct D compiler. // The reason it doesn't work now is due to a test using // a custom compiler @@ -453,8 +455,9 @@ private string buildReggaefileWithReggae( auto newOptions = options.dup; newOptions.backend = Backend.binary; newOptions.dubObjsDir = dubObjsDir; + newOptions.projectPath = dubRecipeDir; + newOptions.workingDir = dubRecipeDir; - const dubRecipeDir = hiddenDirAbsPath(options); auto build = Build(dubPackage(newOptions, DubPath(dubRecipeDir))); runtimeBuild(newOptions, build);