Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20188 from mppf/fix-userInsteadOfStandard
Add workarounds to get userInsteadOfStandard working for now We started seeing failures in userInsteadOfStandard in some configurations after #19884 due to the additional checking it enabled. At the same time, PR #19306 temporarily accepted this test no longer behaving as desired. This PR applies workarounds to both the compiler and the test to get it working again. However, it's my opinion that this pattern is not worth supporting, as I describe in this comment added to the top of `userInsteadOfStandard/foo2.chpl` by this PR: ``` // This test replaces an automatically-included standard library file with // a user one because AutoMath.chpl exists as a sibling to this file. // While this test uses AutoMath, as of this writing, there are 4 automatic // standard libraries: AutoMath, Errors, ChapelIO, and Types. // A workaround in parser.cpp allows this replacing process for these // except for Errors (because it runs into another workaround in the parser). // See issue #19313 for a non-workaround proposal to address this. // One challenge here is that there can only be one copy of a top-level // module in a given compilation. That means that if this test uses // ./AutoMath.chpl as the AutoMath module, the internal library will // refer to it for things like min/max instead of the real one. // A related challenge to that, and part of the issue with Errors, is that in // order for this to work, the first use of AutoMath that the compiler seeks // to resolve has to be this one (vs one coming from somewhere else, e.g. an // already-parsed included module). That presents an ordering constraint that // causes problems when doing incremental or separate compilation. This issue, // combined with the limited number of modules to which this can apply, make // it potentially not worthwhile to support this pattern. ``` Reviewed by @lydia-duncan - thanks! - [x] full local testing
- Loading branch information