Improve diagnostics when command execution fails in run()#1263
Open
ZainabTravadi wants to merge 1 commit intofortran-lang:mainfrom
Open
Improve diagnostics when command execution fails in run()#1263ZainabTravadi wants to merge 1 commit intofortran-lang:mainfrom
ZainabTravadi wants to merge 1 commit intofortran-lang:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates library directory collection and error reporting to improve runtime/library-path handling and build/run diagnostics in the Fortran Package Manager codebase.
Changes:
- Adjust
get_library_dirsfiltering/behavior when collecting library output directories. - Add stderr logging in
run()when a command fails and the caller didn’t requestexitstat. - Tweak build failure messages in the backend.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/fpm_targets.f90 |
Changes which target types contribute to collected library directories (used for -L flags and runtime path setup). |
src/fpm_filesystem.F90 |
Adds an extra error print on failed execute_command_line calls when exitstat is not provided. |
src/fpm_backend.F90 |
Minor wording/capitalization changes to compilation-failure messaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1386
to
+1389
| ! Only consider shared library targets (.so) since | ||
| ! only they require runtime lookup via LD_LIBRARY_PATH. | ||
| if (.not. any(target%target_type == [FPM_TARGET_SHARED])) cycle | ||
| ! Always include the output_dir for shared libraries |
Comment on lines
+1386
to
+1388
| ! Only consider shared library targets (.so) since | ||
| ! only they require runtime lookup via LD_LIBRARY_PATH. | ||
| if (.not. any(target%target_type == [FPM_TARGET_SHARED])) cycle |
Comment on lines
+1055
to
+1058
| if (.not. present(exitstat) .and. stat /= 0) then | ||
| write(stderr,'(a,i0)') '<ERROR>: command '//cmd//redirect_str//' returned status code ', stat | ||
| end if | ||
|
|
d7f8be4 to
3a5b077
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve diagnostics when commands executed via
runfail.Changes
exitstatis not presentThis prevents silent command failures and improves debugging during builds.
Fixes #1262