Improve clarity of compilation error messages in fpm_backend.F90#1261
Open
ZainabTravadi wants to merge 3 commits intofortran-lang:mainfrom
Open
Improve clarity of compilation error messages in fpm_backend.F90#1261ZainabTravadi wants to merge 3 commits intofortran-lang:mainfrom
ZainabTravadi wants to merge 3 commits intofortran-lang:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve clarity and consistency of build/compilation messaging in the build backend, but it also includes a functional change to library directory collection used for link flags and runtime library path setup.
Changes:
- Updates compilation-failure output in
build_packageto use simpler, standardized wording. - Refines comments and alters
get_library_dirsfiltering logic insrc/fpm_targets.f90(now only includes shared-library targets).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/fpm_backend.F90 |
Simplifies compilation failure messages emitted during the build schedule. |
src/fpm_targets.f90 |
Changes how library directories are collected (and updates comments), impacting link/runtime path handling. |
💡 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
+1397
to
+1399
| ! This fix ensures that the directory where shared libraries are produced | ||
| ! (target%output_dir) is always included in the list returned, so LD_LIBRARY_PATH | ||
| ! will contain the correct path for test execution. No interface changes, no filesystem scanning. |
Comment on lines
+1381
to
+1388
| ! Start with an empty list | ||
| allocate(shared_lib_dirs(0)) | ||
|
|
||
| do i = 1, size(targets) | ||
| associate(target => targets(i)%ptr) | ||
| if (all(target%target_type /= [FPM_TARGET_SHARED,FPM_TARGET_ARCHIVE])) cycle | ||
| ! 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 |
Contributor
Author
There was a problem hiding this comment.
I've reverted the unrelated changes so this PR now only modifies src/fpm_backend.F90.
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 clarity and consistency of compilation error messages in
src/fpm_backend.F90.Changes
This change only affects message wording and does not modify program logic or behavior.
Fixes #1260