Week 11 was focused on stability and regression handling. After the large StructType and String Refactor PRs were merged last week, FPM builds showed several issues. This week, I systematically created 10+ MREs for breaking cases, triaged them, and submitted some corresponding fixes and workarounds in LFortran. Now, with ~15 workarounds, FPM builds fully again using LFortran to LLVM.
Work done this week:
-
Regression Handling and Fixes:
- Created MREs while compiling FPM after string refactor and structType refactor
- Remove Previous workarounds by sending PR against it.
- Created workarounds for errors for which I was not able to create MREs (5-6). But I will tackle this afterwards.
-
I also set up FPM at LFortran CI Pipeline, so that we can secure this compilation. Merged PR for setting up CI: PR #8195
-
Sample Workarounds:
-
Relevant Issues Opened:
- Issue #8180: Handle string array passed to a BindC functionCall
- Issue #8176: Handle assignment of StructInstanceMember to ArrayInitializer consists of another structType which has lhs structType var as a member
- Issue #8189: Handle passing base class pointer variable to subroutine in select type
-
PRs submitted and reviewed:
- PR #8157: Add type_declaration for struct type args in pack, unpack, spread, move_alloc. During Function instantiation of intrinsic function previously LFortran was not adding type declaration (structType) to variable initialised in intrinsic function body. So this was causing issue and I fixed that
- PR #8165: Handle direct struct parent member assignments. It is for assignments like
extended_type_var%my_type = my_type_var
, where my_type is a base class and extended_type is its extended type. So we need to assign all members of my_type (my_type_var => extended_type_var) for this type of statements. So I fixed this by breaking down this into simpler statements which only assign single member at a time
- PR #8160: Prioritize direct arg matching, then look for elemental while selecting generic procedure. Consider there are two procedures defined using a generic keyword, one expects array of integer and other takes integer but it is elemental also. So when array is passed to it both function can be call as per fortran compatibility, but we should prioritize direct argument matching than see for elemental matching
I spent around 25 hours this week solely on debugging and solving regressions. The current workaround-heavy solution ensures FPM builds with LFortran completely to LLVM. This serves as the staging ground for final stability polishing next week.
Special thanks again to my mentors Ondřej and Pranav for guiding during tough regressions and reviews. Also I want to thanks to Saurabh for doing StructType Refactoring and helping a lot towards its regressions on fpm compilation.
Plan for next week:
- Remove temporary workarounds with proper fixes. Clean up workarounds.
- Also remove few workarounds that were created during compiling fpm's dependencies.
- Start with testing dependencies.