Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Sep 21, 2021

  • Factor out pick_system_specific_value to be used by pick_dep_version
  • Allow arch specific entries in sanity check paths

Example: 'files': [{'arch=x86_64': 'correct.a'}, 'all_archs.a']

Note that the arch-specific stuff are single files or alternatives (tuple), not a full list of files (again) to keep it simple.

@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from eb40cb2 to b789d2b Compare September 21, 2021 09:16
@boegel boegel added this to the 4.x milestone Sep 29, 2021
@boegel
Copy link
Member

boegel commented Sep 29, 2021

@Flamefire Are the failing tests making sense to you?

@Flamefire
Copy link
Contributor Author

@boegel They are secondary. The primary issue is that I basically changed the allowed format to accept dicts in addition to strings and tuples in the list. See https://github.com/easybuilders/easybuild-framework/pull/3845/files#diff-c63ede120b91884bda5e7d0df599ac170866c050ccec036bdf61c3d456846f43R572
However I never really understood that part of the code. I'd think it's better to have simple "conversion" functions (like I did with https://github.com/easybuilders/easybuild-framework/pull/3845/files#diff-c63ede120b91884bda5e7d0df599ac170866c050ccec036bdf61c3d456846f43R352) which errors out on wrong formats instead of having to specify a conversion function and some kind of type-specification.

The conversion function works, however it seems for yeb-files (the YAMLs) the type-spec is used and fails.
So I'll need help here as I thought the way I did it was correct.

@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from b789d2b to 9332d65 Compare July 26, 2022 15:11
@Flamefire
Copy link
Contributor Author

Ah I needed to add SANITY_CHECK_PATHS_ENTRY to CHECKABLE_TYPES. Now those tests work for me

@easybuilders easybuilders deleted a comment from boegelbot Aug 3, 2022
@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from 9332d65 to 81e59c3 Compare August 23, 2022 11:47
@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from 81e59c3 to ddf7d89 Compare September 6, 2022 07:24
@Flamefire
Copy link
Contributor Author

@boegel All green now.

@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from 4f6b4a5 to 78c95a3 Compare September 9, 2022 14:27
`False` is a valid value to return to skip a dependency for an
architecture, so don't error in that case.
@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from 78c95a3 to 761c732 Compare September 22, 2022 08:50
@easybuilders easybuilders deleted a comment from boegelbot Feb 15, 2023
@easybuilders easybuilders deleted a comment from boegelbot Feb 15, 2023
@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch 2 times, most recently from de23dc0 to 390d625 Compare February 15, 2023 17:56
Mention that `dict`s are also an option
@Flamefire Flamefire force-pushed the alternative_sanity_check_paths branch from 390d625 to 8f21e20 Compare February 15, 2023 18:50
Comment on lines +393 to +406
if isinstance(elem, (string_type, tuple)):
result.append(elem)
elif isinstance(elem, list):
result.append(tuple(elem))
elif isinstance(elem, dict):
for key, value in elem.items():
if not isinstance(key, string_type):
raise EasyBuildError("Expected keys to be of type string, got %s (%s)", key, type(key))
elif isinstance(value, list):
elem[key] = tuple(value)
elif not isinstance(value, (string_type, tuple)):
raise EasyBuildError("Expected elements to be of type string, tuple or list, got %s (%s)",
value, type(value))
result.append(elem)
Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking, every value in a list (turned tuple) or tuple, should be of string_type, or at least not list/tuple/dicts,
and we should perhaps check that too, or?

The question then becomes, are we doing that strictly in all the other to_xxx functions?

I don't think we need to change this here, but rather take a look at all of them at the same time in a separate PR.

Copy link
Contributor Author

@Flamefire Flamefire Feb 16, 2023

Choose a reason for hiding this comment

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

You are right that should be done as one should (be able to) assume that what comes out from those functions is valid.
Maybe keep that in an issue

Semi-related: #4177

Copy link
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

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

LGTM

@akesandgren
Copy link
Contributor

Going in, thanks @Flamefire!

@akesandgren akesandgren merged commit 6f598eb into easybuilders:develop Feb 16, 2023
@Flamefire Flamefire deleted the alternative_sanity_check_paths branch February 16, 2023 15:43
@boegel boegel modified the milestones: 4.x, next release (4.7.1?) Feb 25, 2023
@boegel boegel changed the title Add option to make sanity_check_paths arch dependent add option to make sanity_check_paths arch dependent Feb 25, 2023
@boegel
Copy link
Member

boegel commented Feb 25, 2023

@Flamefire Can you also update the documentation to mention that this is now supported?
Cfr. https://docs.easybuild.io/writing-easyconfig-files/#sanity-check

@Flamefire
Copy link
Contributor Author

@Flamefire Can you also update the documentation to mention that this is now supported? Cfr. https://docs.easybuild.io/writing-easyconfig-files/#sanity-check

Not in the next couple weeks at least. A quick message is all I can do at the moment, a rebase when required is pushing my time limits already.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants