Dyno: add workaround for finding 'serialize' methods in ChapelIO #26691
+19
−1
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.
Closes https://github.com/Cray/chapel-private/issues/7090.
Probably closes https://github.com/Cray/chapel-private/issues/7098 (the assertion is during
canPass
for compiler-generated tuple functions, which this PR ought to disable).In production, we generate
serialize
functions for types if noserialize
function is present anywhere in the program. Dyno, however, is an incremental compiler, and as a result, it cannot use "anywhere in the program" properties (not to mention, due to various scoping rules, the "anywhere in the program" rule can get you into hot water). Instead, Dyno uses a type's definition point to search forserialize
etc.This would be nice, except that we define some serialization functions for builtin types in
ChapelIO
, away from the types' definition points. This PR works around this in Dyno, by deliberately includingChapelIO
as a place where we search for existingserialize
fns.In the ideal world, we would like for this to be solved using interfaces. In this world,
serialize
would not be automatically generated except when auto-satisfying thewriteSerializable
interface, and only using functions available in the current scope. This would solve the problem with checking "anywhere in the program", as well as other non-dyno-related problems ("serialize
should only be special if the interface is present, but right now it's special anyway"). However, we are not yet in the ideal world, and production cannot handle that sort of implementation today.Reviewed by @benharsh -- thanks!
Testing