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

Versioning does not work across compilation units #137

Closed
AzothAmmo opened this issue Nov 9, 2014 · 4 comments
Closed

Versioning does not work across compilation units #137

AzothAmmo opened this issue Nov 9, 2014 · 4 comments
Milestone

Comments

@AzothAmmo
Copy link
Contributor

When registering a type, version information is stored in two places:

  1. a static member variable for a specialization of Version<T>
  2. inside the static object (global singleton) StaticObject<Versions>.

When saving a type, we currently try to get its version number by looking at the member static variable. When loading, we access the StaticObject. This means that when something is versioned in one compilation unit, it won't be available via the specialization of Version<T>, since we never instantiate the class.

See https://groups.google.com/forum/#!topic/cerealcpp/vBYPUzGB9Mw for more information.

@AzothAmmo AzothAmmo added the bug label Nov 9, 2014
@AzothAmmo
Copy link
Contributor Author

Possible ways to fix:

  1. Make saving utilize StaticObject<Versions> instead of trying to read the specialization variable. Seems to work in initial tests across compilation units/shared libs.
  2. Something akin to how we register things for polymorphic types to try and force a type to get instantiated so that it is properly exported, probably would require Possible to use with windows dll files #113 working properly.

AzothAmmo added a commit that referenced this issue Nov 9, 2014
This is option 1 for #137 which I'm quite happy with.  Works across compilation units and
shared libs on linux, need to test on windows.

As for #113, it doesn't seem to be an issue on linux so just remains to sort that out on windows.
@AzothAmmo AzothAmmo added this to the v1.1.0 milestone Nov 10, 2014
@AzothAmmo
Copy link
Contributor Author

May still be broken on Linux, see: https://groups.google.com/forum/#!topic/cerealcpp/u0GrjJCUJts. Can likely be fixed by applying changes seen in pull request: f29728b

AzothAmmo added a commit that referenced this issue Jan 15, 2015
AzothAmmo added a commit that referenced this issue Jan 15, 2015
@AzothAmmo
Copy link
Contributor Author

Should be fixed on branch issues_113_137, will be merged into develop soon.

@AzothAmmo
Copy link
Contributor Author

fixed on develop (6e41ed8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant