Skip to content

Improve clarity of compilation error messages in fpm_backend.F90#1261

Open
ZainabTravadi wants to merge 3 commits intofortran-lang:mainfrom
ZainabTravadi:improve-compilation-error-messages
Open

Improve clarity of compilation error messages in fpm_backend.F90#1261
ZainabTravadi wants to merge 3 commits intofortran-lang:mainfrom
ZainabTravadi:improve-compilation-error-messages

Conversation

@ZainabTravadi
Copy link
Copy Markdown
Contributor

Summary
Improve clarity and consistency of compilation error messages in src/fpm_backend.F90.

Changes

  • Simplify wording of compilation error messages
  • Standardize capitalization of error messages
  • Minor comment wording improvement

This change only affects message wording and does not modify program logic or behavior.

Fixes #1260

Copilot AI review requested due to automatic review settings March 13, 2026 13:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_package to use simpler, standardized wording.
  • Refines comments and alters get_library_dirs filtering logic in src/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 thread src/fpm_targets.f90
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 thread src/fpm_targets.f90
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 thread src/fpm_targets.f90
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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted the unrelated changes so this PR now only modifies src/fpm_backend.F90.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve clarity of compilation error messages in fpm_backend.F90

2 participants