Skip to content

Commit 8293104

Browse files
author
Samat Gaynutdinov
committed
cd in stub compile commands
1 parent 2dc8709 commit 8293104

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

server/src/KleeGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ Result<fs::path> KleeGenerator::defaultBuild(const fs::path &hintPath,
202202
command.setOutput(bitcodeFilePath);
203203

204204
printer::DefaultMakefilePrinter makefilePrinter;
205-
auto printingCommand = utbot::CompileCommand(command, true);
206-
makefilePrinter.declareTarget("build", {printingCommand.getSourcePath()}, {printingCommand.toStringWithChangingDirectory()});
205+
auto commandWithChangingDirectory = utbot::CompileCommand(command, true);
206+
makefilePrinter.declareTarget("build", {commandWithChangingDirectory.getSourcePath()}, {commandWithChangingDirectory.toStringWithChangingDirectory()});
207207
fs::path makefile = projectTmpPath / "BCForKLEE.mk";
208208
FileSystemUtils::writeToFile(makefile, makefilePrinter.ss.str());
209209

210210
auto makefileCommand = MakefileUtils::MakefileCommand(projectContext, makefile, "build");
211211
auto [out, status, _] = makefileCommand.run();
212212
if (status != 0) {
213213
LOG_S(ERROR) << "Compilation for " << sourceFilePath << " failed.\n"
214-
<< "Command: \"" << printingCommand.toString() << "\"\n"
214+
<< "Command: \"" << commandWithChangingDirectory.toString() << "\"\n"
215215
<< "Directory: " << buildDirPath << "\n"
216216
<< out << "\n";
217217
return out;

server/src/building/Linker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,9 @@ Result<CollectionUtils::FileSet> Linker::generateStubsMakefile(
451451
auto command = kleeGenerator->getCompileCommandForKlee(sourcePath, {}, {});
452452
command->setSourcePath(stubPath);
453453
command->setOutput(bitcodeFile);
454+
auto commandWithChangingDirectory = utbot::CompileCommand(command.value(), true);
454455
makefilePrinter.declareTarget(bitcodeFile, { stubPath },
455-
{ command.value().toStringWithChangingDirectory() });
456+
{ commandWithChangingDirectory.toStringWithChangingDirectory() });
456457
return bitcodeFile;
457458
});
458459
makefilePrinter.declareVariable(STUB_BITCODE_FILES_NAME,

0 commit comments

Comments
 (0)