Skip to content
Open
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
3 changes: 2 additions & 1 deletion rdmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ int main(string[] args)
}

// Compute the object directory and ensure it exists
immutable workDir = getWorkPath(root, compilerFlags);
auto environmentFlags = environment.get("DFLAGS", "").split(" ");
immutable workDir = getWorkPath(root, compilerFlags ~ environmentFlags);
lockWorkPath(workDir); // will be released by the OS on process exit
string objDir = buildPath(workDir, "objs");
Filesystem.mkdirRecurseIfLive(objDir);
Expand Down
21 changes: 21 additions & 0 deletions rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,27 @@ SHELL = %s
assert(res.status == 0, res.output);
assert(std.file.read(textOutput) == "hello world\n");
}

// https://issues.dlang.org/show_bug.cgi?id=18423
// rdmd ignores changes in DFLAGS
{
string srcName = tempDir().buildPath("force_rebuild_dflags.d");
std.file.write(srcName, `void main() { import std.stdio; version(Foo) {"foo".writeln;} else { "bar".writeln; }}`);

res = execute(rdmdArgs ~ [srcName]);
assert(res.status == 0, res.output);
assert(res.output.canFind("bar"));

environment["DFLAGS"] = "-version=Foo";
res = execute(rdmdArgs ~ [srcName]);
assert(res.status == 0, res.output);
assert(res.output.canFind("foo"), res.output);

environment.remove("DFLAGS");
res = execute(rdmdArgs ~ [srcName]);
assert(res.status == 0, res.output);
assert(res.output.canFind("bar"));
}
}

void runConcurrencyTest(string rdmdApp, string compiler, string model)
Expand Down