Skip to content

Conversation

@cresswellp
Copy link

Description

IFS experiments fail on Atos from ecbundle 2.2.1 onwards due to #16, because the link path and target path see different representations of the filesystem when linking bundle.yml and arch:

target = /lus/h2resw02/fws5/...
link_name = /ec/fws5/...
# Resulting relative path:
rel_target = ../../../../../../../../lus/h2resw02/fws5/...

This massively overcomplicates the link, but more importantly the result is invalid because the two representations of the same directory have different depths.

As a workaround, if an absolute target path is converted to a relative path, check if the resulting link is valid; if not, repeat with the original, absolute path.

(An alternative workaround would be target = os.path.relpath(target, os.path.dirname(os.path.realpath(link_name))), but when generating internal project links such as

    - ifs_dp :
        dir    :  ifs-source

this produces ifs_dp -> ../../../../../../../../../ec/fws2/... which, though valid, is barely any better.)

If the link to bundle.yml fails, ecbundle-create still succeeds, but any build which invokes options defined in the bundle will fail with seemingly unrelated errors, e.g.

ecbundle-build: error: unrecognized arguments: --nemo-version=V34 --nemovar-version=V34 ...

because the build couldn't find bundle.yml, and so these options were never defined. (Not finding the arch file is also obviously bad, for other reasons.) Therefore I've added an extra check to abort if the final symlink is invalid, to prevent builds continuing in an untenable state.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@cresswellp cresswellp force-pushed the bugfix/invalid_relative_symlink branch from eeb5e31 to 04a6116 Compare September 4, 2025 16:41
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@412dfa1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
ecbundle/util.py 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #30   +/-   ##
==========================================
  Coverage           ?   40.66%           
==========================================
  Files              ?       48           
  Lines              ?    10129           
  Branches           ?        0           
==========================================
  Hits               ?     4119           
  Misses             ?     6010           
  Partials           ?        0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cresswellp
Copy link
Author

@wdeconinck Please could this be looked at? I don't have permissions to request a review but am usually happy to wait till they get picked up in a day or two, but this one seems to have slipped through the gaps.

v2.3.0+ is now needed for CY49R3 so this has become a showstopper. If there's a better way to fix this I'm happy for this PR to be discarded, but it needs addressing somehow.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

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

Hi @cresswellp sorry this fell through the grid. It looks good!

@wdeconinck wdeconinck merged commit 460350f into ecmwf:develop Sep 30, 2025
4 checks passed
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.

3 participants