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

Restore relative output paths for DubPathDependency targets #294

Merged
merged 3 commits into from
Apr 19, 2024
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
5 changes: 2 additions & 3 deletions payload/reggae/rules/dub/external.d
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/reggae/reggae.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion tests/it/runtime/dub/dependencies.d
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,14 @@ unittest {
}
);

enum relativeOutputPath = "over/there/bin/ut" ~ exeExt;

runReggae("-b", "ninja");
ninja.shouldExecuteOk;
shouldSucceed("over/there/bin/ut" ~ exeExt);
shouldSucceed(relativeOutputPath);

// make sure the ninja target is relative, not absolute
ninja([relativeOutputPath]).shouldExecuteOk;
}
}

Expand Down
Loading