CI/CircleCI: Expose binaries built on Circle CI as docker images in the Circle CI artifacts (#25832)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 9af6bf15aa)
This commit is contained in:
Giacomo Pozzoni
2021-01-16 21:30:57 +01:00
committed by Shauren
parent 3d29c26c61
commit c2068bd423
4 changed files with 86 additions and 3 deletions

View File

@@ -84,17 +84,24 @@ static int CreateChildProcess(T waiter, std::string const& executable,
executable.c_str(), boost::algorithm::join(argsVector, " ").c_str());
}
// prepare file with only read permission (boost process opens with read_write)
std::shared_ptr<FILE> inputFile(!input.empty() ? fopen(input.c_str(), "rb") : nullptr, [](FILE* ptr)
{
if (ptr != nullptr)
fclose(ptr);
});
// Start the child process
child c = [&]()
{
if (!input.empty())
if (inputFile)
{
// With binding stdin
return child{
exe = boost::filesystem::absolute(executable).string(),
args = argsVector,
env = environment(boost::this_process::environment()),
std_in = input,
std_in = inputFile.get(),
std_out = outStream,
std_err = errStream
};