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

raise error for patches without .patch extension and no destination given (WIP) #3738

Closed
wants to merge 1 commit into from

Conversation

smoors
Copy link
Contributor

@smoors smoors commented Jun 12, 2021

fixes #3688

@smoors smoors added the change label Jun 12, 2021
@boegelbot
Copy link

@smoors: Tests failed in GitHub Actions, see https://github.com/easybuilders/easybuild-framework/actions/runs/930954127
Output from first failing test suite run:

ERROR: test_exts_list (test.framework.easyconfig.EasyConfigTest)
Test handling of list of extensions.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/runner/6d4aa4fdc0b5a03ef8615fca018a066aacb6668e/lib/python2.7/site-packages/test/framework/easyconfig.py", line 477, in test_exts_list
    exts_sources = eb.fetch_extension_sources()
  File "/tmp/runner/6d4aa4fdc0b5a03ef8615fca018a066aacb6668e/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 626, in fetch_extension_sources
    ext_patches = self.fetch_patches(patch_specs=ext_options.get('patches', []), extension=True)
  File "/tmp/runner/6d4aa4fdc0b5a03ef8615fca018a066aacb6668e/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 471, in fetch_patches
    "For file to copy, use tuple(filename, destination)", patch_spec)
EasyBuildError: "No '.patch' suffix in file toy-0.0.eb implies file to copy, but no destination path given. For file to copy, use tuple(filename, destination)"

----------------------------------------------------------------------
Ran 782 tests in 1059.240s

FAILED (errors=1)
ERROR: Not all tests were successful.

bleep, bloop, I'm just a bot (boegelbot v20200716.01)
Please talk to my owner @boegel if you notice you me acting stupid),
or submit a pull request to https://github.com/boegel/boegelbot fix the problem.

@boegel
Copy link
Member

boegel commented Jun 14, 2021

@smoors Isn't the copy location implicitly the current directory then, in the current implementation? Cfr. the failing test...

So, rather than making this a backwards-incompatible change, maybe we should deprecate it instead, and make it an error only in EasyBuild 5.0?

Can you also check whether any of the easyconfigs in the central repository will need to be updated?

@boegel boegel added this to the next release (4.4.1) milestone Jun 14, 2021
@smoors
Copy link
Contributor Author

smoors commented Jun 15, 2021

@boegel no, the failing test stops at fetch_extension_sources(), so it's not actually doing anything with the patch beyond fetching and checking.

In the current implementation, implicit copy is currently only done for patches without .patch suffix that have a path associated with them, as in tuple(filename, destination). In all other cases it is treated as a normal patch.

I also checked the central EB repository, and the few 'patches' that don't have a .patch suffix all have a path, so there's nothing to update there.

It's only backward incompatible for the rare cases where users deviate from the documentation that says patches should have .patch suffix: https://caylo-easybuild.readthedocs.io/en/latest/Writing_easyconfig_files.html#source-files-and-patches

For me the current behavior is problematic, especially for new users, because in some cases it's ok to have a patch without .patch suffix, while in other cases it just copies the patch without actually patching anything.

But if you prefer to deprecate it first, that's ok with me. Do you still prefer that?

@boegel boegel modified the milestones: 4.4.2, release after 4.4.2 Sep 1, 2021
@boegel boegel modified the milestones: 4.5.0, 4.x Oct 13, 2021
@smoors
Copy link
Contributor Author

smoors commented Dec 28, 2021

superseded by #3920

@smoors smoors closed this Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

surprising behavior with patch files that don't have .patch extension
3 participants