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

[json] provide workaround for TStyle::fLineStyle member #8181

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

linev
Copy link
Member

@linev linev commented May 17, 2021

it has similar name as field in TAttLine and produces duplicated members
in JSON. This makes impossible to correctly read it back

Solves https://root-forum.cern.ch/t/error-restoring-tstyle-from-json/44879/

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann
Copy link
Member

Doesn't this need a bump of the ClassDef version number, @pcanal ?

@linev
Copy link
Member Author

linev commented May 17, 2021

I also have same question
From one side, on binary level it remains absolutely the same.
And if we change class version, how ROOT will get idea that old fLineStyle should be converted into new fLineStyles?

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

You need to also add a I/O customization rule to actually fill the new data member with the date from the old member.

@linev
Copy link
Member Author

linev commented May 17, 2021

@pcanal Are there such examples?

@pcanal
Copy link
Member

pcanal commented May 17, 2021

I also this is not forward compatible. (Unless we patch all the old release to know about the new version, they will lose the line style information.

I may be more beneficial to solve the underlying JSON I/O problem (not supporting base/derived class aliasing)

@linev
Copy link
Member Author

linev commented May 17, 2021

It may be more beneficial to solve the underlying JSON I/O problem (not supporting base/derived class aliasing)

That do you mean?
Provide different layout for created JSON structures?
It will have huge side effect on JSROOT - one have to rewrite it from scratch complete JavaScript code.

@linev
Copy link
Member Author

linev commented May 17, 2021

Doesn't this need a bump of the ClassDef version number

This does not work.

@linev linev marked this pull request as draft May 17, 2021 12:08
@linev
Copy link
Member Author

linev commented May 17, 2021

I convert into draft, while simple member name change does not work.
Also increase of class version does not help.

@Axel-Naumann
Copy link
Member

It will have huge side effect on JSROOT - one have to rewrite it from scratch complete JavaScript code.

Depends on how you do it. If you use the name as before, but Derived::fMember in case the derived re-uses a member name from a base, then it should be strictly an improvement, and backwards compatible?

@linev
Copy link
Member Author

linev commented May 17, 2021

If you use the name as before, but Derived::fMember in case the derived re-uses a member name from a base, then it should be strictly an improvement, and backwards compatible?

It will require search for member names in all base classes for each write operation - huge performance degradation.

@Axel-Naumann
Copy link
Member

Axel-Naumann commented May 17, 2021

That depends on the implementation. If during the serialization you create a map member-name => value-as-string then it's easy to find dupe member names.

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@linev linev changed the title Rename fLineStyle member in TStyle [json] provide workaround for TStyle::fLineStyle member May 17, 2021
@linev linev marked this pull request as ready for review May 17, 2021 15:31
@linev linev requested a review from pcanal May 17, 2021 15:31
it has similar name as field in TAttLine and produces duplicated members
in JSON. This makes impossible to correctly read it back
@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

This needs a more compete solution but get around the immediate problem.

@linev linev merged commit 6dc3c47 into root-project:master Jun 1, 2021
@linev linev deleted the style_json branch June 1, 2021 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants