mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12125 from ethereum/fix-zero-return-on-linker-write-error
Don't return zero exit code when writing linked files to disk fails
This commit is contained in:
commit
ff052a3161
@ -16,6 +16,7 @@ Bugfixes:
|
|||||||
* Code Generator: Fix constructor source mappings for immutables.
|
* Code Generator: Fix constructor source mappings for immutables.
|
||||||
* Commandline Interface: Fix extra newline character being appended to sources passed through standard input, affecting their hashes.
|
* Commandline Interface: Fix extra newline character being appended to sources passed through standard input, affecting their hashes.
|
||||||
* Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them.
|
* Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them.
|
||||||
|
* Commandline Interface: Don't return zero exit code when writing linked files to disk fails.
|
||||||
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
|
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
|
||||||
* TypeChecker: Fix internal error when using user defined value types in public library functions.
|
* TypeChecker: Fix internal error when using user defined value types in public library functions.
|
||||||
* Yul IR Generator: Do not output empty switches/if-bodies for empty contracts.
|
* Yul IR Generator: Do not output empty switches/if-bodies for empty contracts.
|
||||||
|
@ -553,7 +553,7 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
|
|||||||
if (fs::exists(pathName) && !m_options.output.overwriteFiles)
|
if (fs::exists(pathName) && !m_options.output.overwriteFiles)
|
||||||
{
|
{
|
||||||
serr() << "Refusing to overwrite existing file \"" << pathName << "\" (use --overwrite to force)." << endl;
|
serr() << "Refusing to overwrite existing file \"" << pathName << "\" (use --overwrite to force)." << endl;
|
||||||
m_error = true;
|
m_outputFailed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ofstream outFile(pathName);
|
ofstream outFile(pathName);
|
||||||
@ -561,7 +561,7 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
|
|||||||
if (!outFile)
|
if (!outFile)
|
||||||
{
|
{
|
||||||
serr() << "Could not write to file \"" << pathName << "\"." << endl;
|
serr() << "Could not write to file \"" << pathName << "\"." << endl;
|
||||||
m_error = true;
|
m_outputFailed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -855,7 +855,7 @@ bool CommandLineInterface::actOnInput()
|
|||||||
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
|
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
|
||||||
outputCompilationResults();
|
outputCompilationResults();
|
||||||
}
|
}
|
||||||
return !m_error;
|
return !m_outputFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandLineInterface::link()
|
bool CommandLineInterface::link()
|
||||||
@ -937,6 +937,7 @@ void CommandLineInterface::writeLinkedFiles()
|
|||||||
if (!outFile)
|
if (!outFile)
|
||||||
{
|
{
|
||||||
serr() << "Could not write to file " << src.first << ". Aborting." << endl;
|
serr() << "Could not write to file " << src.first << ". Aborting." << endl;
|
||||||
|
m_outputFailed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ private:
|
|||||||
std::ostream& m_sout;
|
std::ostream& m_sout;
|
||||||
std::ostream& m_serr;
|
std::ostream& m_serr;
|
||||||
bool m_hasOutput = false;
|
bool m_hasOutput = false;
|
||||||
bool m_error = false; ///< If true, some error occurred.
|
bool m_outputFailed = false; ///< If true, creation or write to some of the output files failed.
|
||||||
FileReader m_fileReader;
|
FileReader m_fileReader;
|
||||||
std::optional<std::string> m_standardJsonInput;
|
std::optional<std::string> m_standardJsonInput;
|
||||||
std::unique_ptr<frontend::CompilerStack> m_compiler;
|
std::unique_ptr<frontend::CompilerStack> m_compiler;
|
||||||
|
Loading…
Reference in New Issue
Block a user