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

detect Fortran .mod files in GCCcore installations #4389

Merged
merged 8 commits into from Jan 3, 2024

Conversation

branfosj
Copy link
Member

@branfosj branfosj commented Nov 25, 2023

cfr. #4203

Targeting the 5.0.x branch so I can use ** in glob and that is not available in Python 2.7.

@branfosj branfosj marked this pull request as draft November 25, 2023 09:57
@branfosj branfosj added this to the 5.0 milestone Nov 25, 2023
@branfosj branfosj marked this pull request as ready for review November 25, 2023 12:53
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

@branfosj Would be good to have a dedicated test for this?

easybuild/framework/easyblock.py Outdated Show resolved Hide resolved
easybuild/framework/easyblock.py Outdated Show resolved Hide resolved
easybuild/framework/easyconfig/default.py Outdated Show resolved Hide resolved
easybuild/tools/options.py Outdated Show resolved Hide resolved
@branfosj
Copy link
Member Author

@branfosj Would be good to have a dedicated test for this?

done in 809b694

@branfosj branfosj requested a review from boegel November 25, 2023 13:32

fail_msg = None
if mod_files:
fail_msg = ".mod files (%s) found in the installation." % ', '.join(mod_files)
Copy link
Member

Choose a reason for hiding this comment

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

@branfosj Can we try to filter out false positives here?

I was thinking about checking the output of the file command, if that's available.
Not sure if that makes sense...

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what we would want to exclude by using file.

$ file 2.3.0-GCCcore-11.2.0/lib64/kim-api/mod/kim_unit_system_module.mod
2.3.0-GCCcore-11.2.0/lib64/kim-api/mod/kim_unit_system_module.mod:                     gzip compressed data, from Unix, original size 57651

$ file Clang/15.0.5-GCCcore-11.3.0/include/flang/omp_lib.mod
Clang/15.0.5-GCCcore-11.3.0/include/flang/omp_lib.mod:                       UTF-8 Unicode (with BOM) text

$ file json-fortran/8.3.0-GCCcore-12.2.0/include/json_value_module.mod
json-fortran/8.3.0-GCCcore-12.2.0/include/json_value_module.mod:     gzip compressed data, from Unix, original size 201261

$ file CPLEX/20.10-GCCcore-10.2.0/opl/examples/opl/cplex_staticLex/staticlex3.mod
CPLEX/20.10-GCCcore-10.2.0/opl/examples/opl/cplex_staticLex/staticlex3.mod: ASCII text

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's always a gzipped file (at least with gfortran), so you could look for that. One could technically unpack it and look for the header

GFORTRAN module version ....

but limiting this to just *.mod and gzipped file should be pretty good.

Copy link
Member

Choose a reason for hiding this comment

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

As discussed, we can refine this later to try and weed out false positives without having to whitelist...

@boegel boegel enabled auto-merge January 3, 2024 15:04
@boegel boegel merged commit 8c28dfa into easybuilders:5.0.x Jan 3, 2024
35 checks passed
@branfosj branfosj deleted the mod_files branch January 3, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants