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

Update test compatibility matrix #51

Merged
merged 5 commits into from
Feb 1, 2024
Merged

Update test compatibility matrix #51

merged 5 commits into from
Feb 1, 2024

Conversation

nbelakovski
Copy link
Contributor

@nbelakovski nbelakovski commented Dec 20, 2023

UPDATE: This PR is now about updating the test matrix. A new PR to handle the original issue is now here. The original comments are left as they are.

On my own repo I had issues running programs compiled with gfortran 11 in CI. It turned out they were being compiled with gfortran 11, but were picking up libgfortran-5.dll from /c/mingw64/bin, which is from gcc 12, at runtime, and would crash.

I've modified hw.90 to reproduce the problem as minimally as I can, although perhaps someone else can make it more minimal.

I've temporarily added an intentionally failing action to demonstrate the issue, obviously we would remove that ahead of merging.

I also added gcc 12 to the test matrix. It claims to be supported so it seems only logical to test it in addition to 11 and 13.

[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected Fortran program output: $output"; exit 1)
rm hw

- name: Test compile (bash) (intentionally failing)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

git is displaying the diff a bit strangely - I've added this one run command here which moves the library back to its original place to demonstrate the failure. This is to be removed ahead of merging the changes in hw.f90 and setup_fortran.sh

hw.f90 Outdated
n = count(logical_array)
allocate(location_array(1:n))
location_array = pack(monotone_array, mask=logical_array)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a sketch of the function that ultimately gave me trouble in my own repo. It's pared down considerably, to the point of not even functioning since monotone_array isn't even initialized, but I found that all this was necessary to replicate the issue, up to and including the pack command (which by itself did not trigger the issue). Putting it into a separate function, as opposed to inlining these commands, was also necessary for replication.

Copy link
Contributor

Choose a reason for hiding this comment

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

it might be good to move this new test case to a separate file — in the future we might also think about test compiling a few external programs to cast a wider net for similar issues?

@nbelakovski
Copy link
Contributor Author

Link to the actions in my own repo with the intentionally failing test: https://github.com/nbelakovski/setup-fortran/actions/runs/7277645925

@nbelakovski
Copy link
Contributor Author

cc @zaikunzhang

@nbelakovski
Copy link
Contributor Author

After taking a look at how the windows github runner installs gcc 12 (it just downloads mingw64 and extracts it to /c/mingw64), maybe we should just mv the whole mingw64 folder instead of the current piecemeal approach?

@wpbonelli
Copy link
Contributor

Thanks @nbelakovski for the detailed reproduction and PR.

After taking a look at how the windows github runner installs gcc 12 (it just downloads mingw64 and extracts it to /c/mingw64), maybe we should just mv the whole mingw64 folder instead of the current piecemeal approach?

That seems better than the current approach. Want to edit setup_fortran.sh and try it out?

I also added gcc 12 to the test matrix. It claims to be supported so it seems only logical to test it in addition to 11 and 13.

Ideally we would test everything but the matrix gets very large, so currently we only test the latest of each toolchain in push/pr CI and do comprehensive testing monthly (discussion)

@nbelakovski
Copy link
Contributor Author

I've pushed a modification to mv the whole folder.

Ideally we would test everything but the matrix gets very large

I needed to add gcc 11 and 12 in order to demonstrate reproducibility of the issue and also demonstrate the fix. Up to you if you'd like to keep them or if you'd like me to remove them, just let me know. As someone trying to fix an issue with a version that's not tested it adds extra effort, and seeing the lack of testing for purportedly supported versions makes me think this is probably not a very robust project and maybe I shouldn't depend on it (I'm not saying that this is true, I'm just saying this is the impression I get when I see the lack of tests). Plus CI minutes are cheap, so why does it matter if the matrix is large?

Returning to the PR, if the changes look good, let me know and I'll remove the intentionally failing test (and also remove gcc 11/12 at your direction) and we can merge.

@wpbonelli wpbonelli requested a review from awvwgk December 30, 2023 02:28
@wpbonelli
Copy link
Contributor

We could test all combinations on PR and the minimal set on push. Or comprehensive on push and minimal on PR — so one can easily CI test on a fork before opening a PR, but we avoid saturating the fortran-lang org

@awvwgk

@awvwgk
Copy link
Member

awvwgk commented Jan 9, 2024

We can run all tests in CI like before, it will just take a little longer if the repo is saturated, but it is still better than skipping a check and risking breakage

@wpbonelli
Copy link
Contributor

@nbelakovski I pulled your branch and updated the test workflow, with your permission I can push and we can get this merged

@nbelakovski
Copy link
Contributor Author

@wpbonelli I'm not entirely sure what you mean, but yes you have my permission to push? Is the only holdup the removal of the demonstration test case?

nbelakovski and others added 3 commits January 17, 2024 09:17
On my own repo I had issues running programs compiled with gfortran 11 in CI.
It turned out they were being compiled with gfortran 11, but were picking up
libgfortran-5.dll from /c/mingw64/bin, which is from gcc 12, at runtime, and would
crash.

I've modified hw.90 to reproduce the problem as minimally as I can, although perhaps
someone else can make it more minimal.

I've temporarily added an intentionally failing action to demonstrate the issue,
obviously we would remove that ahead of merging.

I also added gcc 12 to the test matrix. It claims to be supported so it seems only
logical to test it in addition to 11 and 13.
mv the whole mingw64 folder instead of moving things piecemeal.

An investigation of how the windows image installs mingw64 (https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Install-Mingw64.ps1) shows that it just extracts the whole thing to /c/mingw64, so it should be safe and complete to mv the whole folder.
- remove reproduction test case
- comprehensive test on all trigger events
- move scripts and test programs to subdirs
- move bobyqa test program to separate file
- fix testing schedule: weekly not monthly
@wpbonelli
Copy link
Contributor

Just figure better to ask before editing someone else's branch even if GitHub allows it. I rebased and tacked on a commit.

@nbelakovski
Copy link
Contributor Author

Just figure better to ask before editing someone else's branch even if GitHub allows it. I rebased and tacked on a commit.

Eh, go ahead and make the changes! I think there's a check mark when you submit the PR as to whether others are allowed to make changes to it.

@nbelakovski
Copy link
Contributor Author

Any updates? Other than actually running the test program I think this is good to go.

…_compat.csv, reorganize in .github/compat/, update compatibility files and readme to reflect nvidia support
@wpbonelli
Copy link
Contributor

Sorry for the delay here- think it is in good shape now, if you don't mind having a final look?

The last commit makes a distinction between testing and reporting mode, on push or PR only known supported runner/toolchain/version combinations are checked, on schedule (now weekly) or manual trigger it tries them all and updates if needed

@nbelakovski
Copy link
Contributor Author

This PR was for fixing an issue with gcc11, but that doesn't seem to be the main focus of it anymore. I will remove my changes related to gcc11, put them in a separate branch and make a separate PR, and then rename this PR to something more appropriate and let the project maintainers review it, since I am not the appropriate person to review these changes.

Moving them to a separate branch since this branch has become focused on
the test matrix.
@nbelakovski nbelakovski changed the title Fix issue with installation of gfortran 11 Update test compatibility matrix Jan 31, 2024
@wpbonelli
Copy link
Contributor

@nbelakovski Thanks for separating the changesets, that makes things clearer. I made the test matrix changes here to reflect the discussion/decision above to do more frequent comprehensive testing, but it would have been better not to hijack your PR.

@wpbonelli wpbonelli merged commit 5875bb2 into fortran-lang:main Feb 1, 2024
161 checks passed
@nbelakovski nbelakovski deleted the gcc_11 branch February 1, 2024 17:05
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