Remove redundant work in sanity check of extensions#5185
Open
Flamefire wants to merge 9 commits into
Open
Conversation
1575ed2 to
10e94e4
Compare
10e94e4 to
373c48b
Compare
Using the "fake module environment" creates a module file. However in `--module-only` setups we want to use the real module file instead. This also avoids potentially loading the real AND the fake module.
373c48b to
9b60663
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I identified a few things we do in the sanity check of extensions we should not:
--sanity-check-onlymodeI'm fixing the first one in #5184
The main one here is the 2nd one with this simple diff in
extensioneasyblock:Not only does this avoid the complex, time-consuming logic of creating a module and manipulating MODULEPATH it might fail if module creation requires information from the build process.
See e.g. easybuilders/easybuild-easyblocks#4122 where
get_software_versionwas used, i.e. the dependency module was required to be loaded.I added a
sanity_check_module_environmentcontext manager to load & unload the sanity check module (real module or fake module)I'm also starting to remove the
extensionparameter to those methods, which I did in a PR prior to the 5.3.0 release but took out to get that PR merged without this change.Reason is to avoid potential mismatches, e.g. by forgetting to pass the parameter.
Ultimately I want to use
self.is_extensionto allow multiple extension to fail their sanity check step and having a "parallel" source of truth makes that harder.The cause here is that the failing exts_filter allows to check other extensions but failing commands does not as that aborts directly. Easy to fix when relying on
self.is_extensionIf there are no objections I'll also remove it from
sanity_check_load_modulewhich is similarly simple but requires an update to the easyblocks that use it. Just want to get feedback before doing that extra work.