@@ -180,7 +180,8 @@ bool runcpp2::CopyFiles(const ghc::filesystem::path& destDir,
180180 const std::vector<std::string>& filePaths,
181181 std::vector<std::string>& outCopiedPaths)
182182{
183- ssLOG_FUNC_DEBUG ();
183+ ssLOG_FUNC_INFO ();
184+ INTERNAL_RUNCPP2_SAFE_START ();
184185
185186 std::error_code e;
186187 for (const std::string& srcPath : filePaths)
@@ -213,6 +214,8 @@ bool runcpp2::CopyFiles(const ghc::filesystem::path& destDir,
213214 }
214215
215216 return true ;
217+
218+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (false );
216219}
217220
218221runcpp2::PipelineResult
@@ -221,6 +224,9 @@ runcpp2::RunProfileCommands(const Data::ProfilesCommands* commands,
221224 const std::string& workingDir,
222225 const std::string& commandType)
223226{
227+ ssLOG_FUNC_INFO ();
228+ INTERNAL_RUNCPP2_SAFE_START ();
229+
224230 if (commands != nullptr )
225231 {
226232 const std::vector<std::string>* commandSteps =
@@ -246,6 +252,8 @@ runcpp2::RunProfileCommands(const Data::ProfilesCommands* commands,
246252 }
247253 }
248254 return PipelineResult::SUCCESS;
255+
256+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
249257}
250258
251259runcpp2::PipelineResult runcpp2::ValidateInputs (const std::string& scriptPath,
@@ -254,6 +262,7 @@ runcpp2::PipelineResult runcpp2::ValidateInputs(const std::string& scriptPath,
254262 ghc::filesystem::path& outScriptDirectory,
255263 std::string& outScriptName)
256264{
265+ ssLOG_FUNC_INFO ();
257266 INTERNAL_RUNCPP2_SAFE_START ();
258267
259268 if (profiles.empty ())
@@ -298,6 +307,7 @@ runcpp2::ParseAndValidateScriptInfo(const ghc::filesystem::path& absoluteScriptP
298307 const Data::ScriptInfo* lastScriptInfo,
299308 Data::ScriptInfo& outScriptInfo)
300309{
310+ ssLOG_FUNC_INFO ();
301311 INTERNAL_RUNCPP2_SAFE_START ();
302312
303313 // Check if there's script info as yaml file instead
@@ -360,6 +370,9 @@ runcpp2::PipelineResult runcpp2::HandleCleanup( const Data::ScriptInfo& scriptIn
360370 const ghc::filesystem::path& absoluteScriptPath,
361371 BuildsManager& buildsManager)
362372{
373+ ssLOG_FUNC_INFO ();
374+ INTERNAL_RUNCPP2_SAFE_START ();
375+
363376 const Data::ProfilesCommands* cleanupCommands =
364377 runcpp2::GetValueFromPlatformMap (scriptInfo.Cleanup );
365378
@@ -407,6 +420,8 @@ runcpp2::PipelineResult runcpp2::HandleCleanup( const Data::ScriptInfo& scriptIn
407420 return PipelineResult::UNEXPECTED_FAILURE;
408421 }
409422 return PipelineResult::SUCCESS;
423+
424+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
410425}
411426
412427runcpp2::PipelineResult
@@ -417,6 +432,9 @@ runcpp2::InitializeBuildDirectory( const ghc::filesystem::path& configDir,
417432 ghc::filesystem::path& outBuildDir,
418433 IncludeManager& outIncludeManager)
419434{
435+ ssLOG_FUNC_INFO ();
436+ INTERNAL_RUNCPP2_SAFE_START ();
437+
420438 // Create build directory
421439 ghc::filesystem::path buildDirPath = useLocalBuildDir ?
422440 ghc::filesystem::current_path () / " .runcpp2" :
@@ -458,6 +476,8 @@ runcpp2::InitializeBuildDirectory( const ghc::filesystem::path& configDir,
458476 }
459477
460478 return PipelineResult::SUCCESS;
479+
480+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
461481}
462482
463483runcpp2::PipelineResult
@@ -470,6 +490,9 @@ runcpp2::CheckScriptInfoChanges(const ghc::filesystem::path& buildDir,
470490 bool & outRelinkNeeded,
471491 std::vector<std::string>& outChangedDependencies)
472492{
493+ ssLOG_FUNC_INFO ();
494+ INTERNAL_RUNCPP2_SAFE_START ();
495+
473496 ghc::filesystem::path lastScriptInfoFilePath = buildDir / " LastScriptInfo.yaml" ;
474497 Data::ScriptInfo lastScriptInfoFromDisk;
475498
@@ -631,6 +654,8 @@ runcpp2::CheckScriptInfoChanges(const ghc::filesystem::path& buildDir,
631654 }
632655
633656 return PipelineResult::SUCCESS;
657+
658+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
634659}
635660
636661runcpp2::PipelineResult
@@ -643,6 +668,9 @@ runcpp2::ProcessDependencies( Data::ScriptInfo& scriptInfo,
643668 std::vector<Data::DependencyInfo*>& outAvailableDependencies,
644669 std::vector<std::string>& outGatheredBinariesPaths)
645670{
671+ ssLOG_FUNC_INFO ();
672+ INTERNAL_RUNCPP2_SAFE_START ();
673+
646674 for (int i = 0 ; i < scriptInfo.Dependencies .size (); ++i)
647675 {
648676 if (IsDependencyAvailableForThisPlatform (scriptInfo.Dependencies .at (i)))
@@ -730,13 +758,18 @@ runcpp2::ProcessDependencies( Data::ScriptInfo& scriptInfo,
730758 }
731759
732760 return PipelineResult::SUCCESS;
761+
762+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
733763}
734764
735765void runcpp2::SeparateDependencyFiles ( const Data::FilesTypesInfo& filesTypes,
736766 const std::vector<std::string>& gatheredBinariesPaths,
737767 std::vector<std::string>& outLinkFilesPaths,
738768 std::vector<std::string>& outFilesToCopyPaths)
739769{
770+ ssLOG_FUNC_INFO ();
771+ INTERNAL_RUNCPP2_SAFE_START ();
772+
740773 std::unordered_set<std::string> linkExtensions;
741774
742775 // Populate the set of link extensions
@@ -777,12 +810,16 @@ void runcpp2::SeparateDependencyFiles( const Data::FilesTypesInfo& filesTypes,
777810 ssLOG_INFO (" Files to copy:" );
778811 for (int i = 0 ; i < outFilesToCopyPaths.size (); ++i)
779812 ssLOG_INFO (" " << outFilesToCopyPaths[i]);
813+
814+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (void ());
780815}
781816
782817runcpp2::PipelineResult runcpp2::HandlePreBuild (const Data::ScriptInfo& scriptInfo,
783818 const Data::Profile& profile,
784819 const ghc::filesystem::path& buildDir)
785820{
821+ ssLOG_FUNC_INFO ();
822+
786823 const Data::ProfilesCommands* preBuildCommands =
787824 runcpp2::GetValueFromPlatformMap (scriptInfo.PreBuild );
788825
@@ -793,6 +830,8 @@ runcpp2::PipelineResult runcpp2::HandlePostBuild( const Data::ScriptInfo& scri
793830 const Data::Profile& profile,
794831 const ghc::filesystem::path& buildDir)
795832{
833+ ssLOG_FUNC_INFO ();
834+
796835 const Data::ProfilesCommands* postBuildCommands =
797836 GetValueFromPlatformMap (scriptInfo.PostBuild );
798837
@@ -807,6 +846,9 @@ runcpp2::RunCompiledOutput( const ghc::filesystem::path& target,
807846 const std::unordered_map<CmdOptions, std::string>& currentOptions,
808847 int & returnStatus)
809848{
849+ ssLOG_FUNC_INFO ();
850+ INTERNAL_RUNCPP2_SAFE_START ();
851+
810852 // Prepare run arguments
811853 std::vector<std::string> finalRunArgs;
812854 finalRunArgs.push_back (target.string ());
@@ -837,6 +879,8 @@ runcpp2::RunCompiledOutput( const ghc::filesystem::path& target,
837879 }
838880
839881 return PipelineResult::SUCCESS;
882+
883+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
840884}
841885
842886runcpp2::PipelineResult
@@ -847,6 +891,9 @@ runcpp2::HandleBuildOutput( const ghc::filesystem::path& target,
847891 const std::string& buildOutputDir,
848892 const std::unordered_map<CmdOptions, std::string>& currentOptions)
849893{
894+ ssLOG_FUNC_INFO ();
895+ INTERNAL_RUNCPP2_SAFE_START ();
896+
850897 // Copy the output file
851898 std::vector<std::string> filesToCopy = filesToCopyPaths;
852899 filesToCopy.push_back (target);
@@ -869,6 +916,8 @@ runcpp2::HandleBuildOutput( const ghc::filesystem::path& target,
869916
870917 ssLOG_BASE (" Build completed. Files copied to " << buildOutputDir);
871918 return PipelineResult::SUCCESS;
919+
920+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
872921}
873922
874923runcpp2::PipelineResult
@@ -878,6 +927,9 @@ runcpp2::GetTargetPath( const ghc::filesystem::path& buildDir,
878927 const std::unordered_map<CmdOptions, std::string>& currentOptions,
879928 ghc::filesystem::path& outTarget)
880929{
930+ ssLOG_FUNC_INFO ();
931+ INTERNAL_RUNCPP2_SAFE_START ();
932+
881933 std::string exeExt = " " ;
882934 #ifdef _WIN32
883935 exeExt = " .exe" ;
@@ -913,13 +965,18 @@ runcpp2::GetTargetPath( const ghc::filesystem::path& buildDir,
913965 }
914966
915967 return PipelineResult::SUCCESS;
968+
969+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (PipelineResult::UNEXPECTED_FAILURE);
916970}
917971
918972bool runcpp2::GatherSourceFiles (const ghc::filesystem::path& absoluteScriptPath,
919973 const Data::ScriptInfo& scriptInfo,
920974 const Data::Profile& currentProfile,
921975 std::vector<ghc::filesystem::path>& outSourcePaths)
922976{
977+ ssLOG_FUNC_INFO ();
978+ INTERNAL_RUNCPP2_SAFE_START ();
979+
923980 if (!currentProfile.FileExtensions .count (absoluteScriptPath.extension ()))
924981 {
925982 ssLOG_ERROR (" File extension of script doesn't match profile" );
@@ -1005,6 +1062,8 @@ bool runcpp2::GatherSourceFiles(const ghc::filesystem::path& absoluteScriptPath,
10051062 }
10061063
10071064 return true ;
1065+
1066+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (false );
10081067}
10091068
10101069bool runcpp2::GatherIncludePaths ( const ghc::filesystem::path& scriptDirectory,
@@ -1013,7 +1072,9 @@ bool runcpp2::GatherIncludePaths( const ghc::filesystem::path& scriptDirectory
10131072 const std::vector<Data::DependencyInfo*>& dependencies,
10141073 std::vector<ghc::filesystem::path>& outIncludePaths)
10151074{
1016- ssLOG_FUNC_DEBUG ();
1075+ ssLOG_FUNC_INFO ();
1076+ INTERNAL_RUNCPP2_SAFE_START ();
1077+
10171078 outIncludePaths.clear ();
10181079
10191080 if (!scriptDirectory.is_absolute ())
@@ -1077,20 +1138,24 @@ bool runcpp2::GatherIncludePaths( const ghc::filesystem::path& scriptDirectory
10771138 }
10781139
10791140 return true ;
1141+
1142+ INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (false );
10801143}
10811144
10821145bool runcpp2::GatherFilesIncludes ( const std::vector<ghc::filesystem::path>& files,
10831146 const std::vector<ghc::filesystem::path>& includePaths,
10841147 SourceIncludeMap& outSourceIncludes)
10851148{
1149+ ssLOG_FUNC_INFO ();
10861150 INTERNAL_RUNCPP2_SAFE_START ();
1087- ssLOG_FUNC_DEBUG ();
10881151
10891152 outSourceIncludes.clear ();
10901153 std::unordered_set<std::string> visitedFiles;
10911154
10921155 for (const ghc::filesystem::path& file : files)
10931156 {
1157+ ssLOG_INFO (" Gathering includes for " << file.string ());
1158+
10941159 std::vector<ghc::filesystem::path>& currentIncludes = outSourceIncludes[file.string ()];
10951160 std::queue<ghc::filesystem::path> filesToProcess;
10961161 filesToProcess.push (file);
@@ -1148,6 +1213,7 @@ bool runcpp2::GatherFilesIncludes( const std::vector<ghc::filesystem::path>& fi
11481213
11491214 if (found)
11501215 {
1216+ ssLOG_INFO (" Found include file: " << resolvedInclude.string ());
11511217 currentIncludes.push_back (resolvedInclude);
11521218 filesToProcess.push (resolvedInclude);
11531219 }
0 commit comments