-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
I/O Customizaton Rules: add support for changing the input type. #17347
Conversation
Test Results 18 files 18 suites 4d 1h 8m 31s ⏱️ Results for commit 1965fb4. ♻️ This comment has been updated with latest results. |
ba28c30
to
7b3edc4
Compare
5144078
to
285bcf6
Compare
Previously the call to RemoveStreamerInfo was working only if the slot was the the slot of the current version. (the actually removed StreamerInfo was hard-coded to be the current version
The data members are cached (because they are input of a rule) need to be read into the original type not the 'current in memory type' so that the rule can properly function if the type has changed. We should upgrade further for the in-memory type of the input of a rule to be the one specified in the rule independently of the onfile type and the final in-memory type.
73a13c5
to
2e3d281
Compare
Return the underlying type and other piece and information separately
This reverts commit e900d32. Bug fix: I/O customization rules which missing input are no longer (inappropriately) run. We now properly warn if a rule is requesting an input that is not present in the StreamerInfo that the rule is being applied to. To avoid the warning in some cases (in particular the cases used to support `HepMC` and are located in `$ROOTSYS/etc/class.rules`) we introduce a new "attribute" for I/O customization rules: `CanIgnore:` When using this attribute the rule will be ignored if the input is missing from the schema/class-layout they apply to instead of issue a `Warning` wip: Revert "Don't warn when ..."
In TStreamerInfo's Build and BuildOld update the artificial StreamerElement's description of the in memory type to be used to store the data. This allows the rule to request an implicit transformation from onfile representation to in memory representation before running the explicit customization rules
This allows to remove data member whose type is array of (sub)objects.
dim needs to be 0 for non-array
Previously the code in TStreamerElement assumed that GetClassPointer return the underlying type of the in memory representation. This was true until recently as you could not change the representation in the 'current' StreamerInfo ( GetClassPointer was matching the layout as decribed by the Clang AST ) and if the class was not loaded, the 'old/onfile' representation was the only possible choice. However we now can change the representation on file (i.e. GetClassPointer) for the current StreamerInfo of a loaded class (i.e. later using Write rule, now in the case of enum class and collection thereof) and in the case of the synthetic/artifical class created to cache inputs of rules (they are named `classname@@versionNumber`), the rule now dictates the representation in memory
This patch allows to register rules on a class which dictionary is in a different dictionary source file. Introduce the internal functions: ROOT::TMetaUtils::WriteStandaloneReadRules ROOT::TMetaUtils::WriteRulesRegistration TClass::GetReadRulesRegistry TClass::RegisterReadRules
6a3c4dc
to
d481d2c
Compare
d481d2c
to
1965fb4
Compare
@pcanal , while testing this in cmssw , we get build error/warning like [a]. the classes_def.xml file is https://github.com/cms-sw/cmssw/blob/master/DataFormats/HcalIsolatedTrack/src/classes_def.xml . Do we need some cleanup in cmssw to avoid this warning?
|
This indicates a 'real' error and the 2 rules whose Previously those rules were (likely) silently ignored. To enable them add something like |
thanks @pcanal , I will try this |
With these changes, one can request the schema evolution (usually implicit) of the input data members from the on-file type to a custom type. Example of the changes support in the test roottest/root/io/evolution/rules/execSourceTypes.cxx added by the companion roottest PR
This fixes #17346 17346