Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for colon seperated list of library homes #140

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ChrisspyB
Copy link
Member

@ChrisspyB ChrisspyB commented Sep 20, 2024

Allows setting multiple homes in a colon seperated string. e.g. ECKIT_HOME=/path/to/home1:/path/to/home2
This is useful for libraries which like to search for multiple configs, which may be in distinct directories. LocalPathName's tilde expansion ~eckit/file will match the first existing file from [/path/to/home1/file1, /path/to/home2/file]. If none exist, the first is used.

No change in behaviour is intended if a single home is set.

If LIB_HOME is not set, there is a change in behaviour in the tilde expansion:

  • Before: eckit would search recursively upwards from the prefix directory all the way to the root directory.
    • e.g. ~eckit/file1 -> libraryprefix/file1, libraryprefix/../file1, libraryprefix/../../file1, libraryprefix/../../../file1... /file1
  • Now: eckit will search the prefix directories and one and two levels above it, then go straight to the root. (exactly four directories)
    • e.g. ~eckit/file1 -> libraryprefix/file1, libraryprefix/../file1, libraryprefix/../../file1, libraryprefix/../../file1, /file1

note This does mean that LIB_HOME cannot be set to directories whose path contains a colon.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 63.73%. Comparing base (3598aa9) to head (beff400).
Report is 11 commits behind head on develop.

Files with missing lines Patch % Lines
src/eckit/system/Library.cc 87.50% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #140   +/-   ##
========================================
  Coverage    63.72%   63.73%           
========================================
  Files         1065     1065           
  Lines        55141    55161   +20     
  Branches      4084     4085    +1     
========================================
+ Hits         35139    35157   +18     
- Misses       20002    20004    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisspyB ChrisspyB marked this pull request as ready for review September 30, 2024 09:01
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.

2 participants