-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix: Fix BinningValue
conversions
#2333
fix: Fix BinningValue
conversions
#2333
Conversation
In the ATLAS debug build, we're getting failures in the ActsEventCnv test: ``` ActsTrackingGeometrySvc FATAL in sysInitialize(): standard std::exception is caught ActsTrackingGeometrySvc ERROR [json.exception.type_error.302] type must be number, but is string ServiceManager ERROR Unable to initialize service "ActsTrackingGeometrySvc" ``` This is because some compilation units in Plugins/Json try to convert a BinningValue without including the header UtilitiesJsonConverter.hpp which has the NLOHMANN_JSON_SERIALIZE_ENUM declaration for BinningValue. Thus, the conversion can work differently depending on the compilation unit, and the behavior can also depend on what gets inlined, so can differ between the optimized and debug build. This change adds the missing #includes and should fix this failure.
BinningValue
conversions.BinningValue
conversions
Codecov Report
@@ Coverage Diff @@
## main #2333 +/- ##
=======================================
Coverage 49.67% 49.67%
=======================================
Files 453 453
Lines 25524 25524
Branches 11701 11701
=======================================
Hits 12678 12678
Misses 4571 4571
Partials 8275 8275 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
📊 Physics performance monitoring for 5b4bc27Summary VertexingSeedingCKFAmbiguity resolutionTruth tracking (Kalman Filter)Truth tracking (GSF) |
Pretty sure the output changes are not related. |
Since we had the same enum conversion problem a second time I propose to disable the default enum serialization via `JSON_DISABLE_ENUM_SERIALIZATION`. This results in a compile error instead of runtime errors when we actually try to read strings as integers. I set the flag `PRIVATE` in cmake so it does not sneak into user codebases but the user might face the same problems if the includes are not done correctly. Not having the enum and the `NLOHMANN_JSON_SERIALIZE_ENUM` in the same place results in these kind of issues. I wonder if we should rather bring them together and use preprocessor flags. That would also guarantee that the right conversion function will be visible all the time. References: - https://json.nlohmann.me/api/macros/json_disable_enum_serialization/ - https://json.nlohmann.me/api/macros/nlohmann_json_serialize_enum/ Related PRs and issues: - #3142 - #2333 - #2331
) Since we had the same enum conversion problem a second time I propose to disable the default enum serialization via `JSON_DISABLE_ENUM_SERIALIZATION`. This results in a compile error instead of runtime errors when we actually try to read strings as integers. I set the flag `PRIVATE` in cmake so it does not sneak into user codebases but the user might face the same problems if the includes are not done correctly. Not having the enum and the `NLOHMANN_JSON_SERIALIZE_ENUM` in the same place results in these kind of issues. I wonder if we should rather bring them together and use preprocessor flags. That would also guarantee that the right conversion function will be visible all the time. References: - https://json.nlohmann.me/api/macros/json_disable_enum_serialization/ - https://json.nlohmann.me/api/macros/nlohmann_json_serialize_enum/ Related PRs and issues: - acts-project#3142 - acts-project#2333 - acts-project#2331
) Since we had the same enum conversion problem a second time I propose to disable the default enum serialization via `JSON_DISABLE_ENUM_SERIALIZATION`. This results in a compile error instead of runtime errors when we actually try to read strings as integers. I set the flag `PRIVATE` in cmake so it does not sneak into user codebases but the user might face the same problems if the includes are not done correctly. Not having the enum and the `NLOHMANN_JSON_SERIALIZE_ENUM` in the same place results in these kind of issues. I wonder if we should rather bring them together and use preprocessor flags. That would also guarantee that the right conversion function will be visible all the time. References: - https://json.nlohmann.me/api/macros/json_disable_enum_serialization/ - https://json.nlohmann.me/api/macros/nlohmann_json_serialize_enum/ Related PRs and issues: - acts-project#3142 - acts-project#2333 - acts-project#2331
In the ATLAS debug build, we're getting failures in the ActsEventCnv test:
This is because some compilation units in Plugins/Json try to convert a BinningValue without including the header UtilitiesJsonConverter.hpp which has the NLOHMANN_JSON_SERIALIZE_ENUM declaration for BinningValue. Thus, the conversion can work differently depending on the compilation unit, and the behavior can also depend on what gets inlined, so can differ between the optimized and debug build.
fixes #2331