-
Notifications
You must be signed in to change notification settings - Fork 593
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
Remove Swift dependency on non-public C++ APIs #2648
Conversation
slicingCat: "Slicing", | ||
logger: LoggerWrapper(handle: communicator.getLogger())) | ||
let kind = sliceType == SliceType.ExceptionSlice ? "exception" : "object" | ||
communicator.getLogger().trace(category: "Slicing", message: "unknown \(kind) type '\(typeId)'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we apply this change to other mappings?
I don't understand the motivation for this PR. What's wrong with depending on symbols defined in IceImpl? We have many ICE_API symbols in IceImpl (e.g. used by the generated code). And there many undocumented APIs in namespace Ice (say ConnectionI). For me, the distinction between namespace Ice and IceImpl is fairly meaningless. Then:
This is a rather unfortunate change. In all langue mappings, the have this "duplicate log suppression" logic for class/exception slicing diagnostics. But now, you want to change this logic for Swift and embrace duplicate and very verbose tracing?
I would rather keep this escapeString as it's more correct and consistent with what we do in other language mappings. |
These are not part of the public headers, so they're not part of the public API and will not be in the framework. I've updated the title and description.
I'm also fine applying the same logic in Swift or making the C++ API public.
I agree, we'll need to either make the API public or copy the logic into Swift. |
For APIs that we use (traceSlicing, espaceString) from Swift (and presumably other C++-based language mappings), I would move them to "public" headers in include/Ice. Even though they are in public headers, they remain undocumented and in namespace IceImpl. |
Swift is actually the only language to use them. It's not so obvious we can move these headers to be public. I think The issue with |
In theory, we should have the same "trace slicing" logic in MATLAB, but the code looks buggy.
InputStream does not have a traceSkipSlice in MATLAB. |
Looking a little more it's actually a bit worse. I think I can fix However we're currently using |
Closing this for now as there's no simple way to not rely all of the internal headers. It's fine that they're not in the XCFramework as we always do a build from the repo were the private headers are available. |
This PR removes Swift's dependency on non public C++ APIs.
Namely:
traceSlicing
. This means we'll log every call now in Swift. Currently C++ caches ids and only logs once per id, which seems a bit excessive to me.escapeString
. We only use this to escape facets and category names when throwing a few exceptions. Not having this is not 100% correct. We should either copy the logic into Swift or make the C++ function public (or just not worry about it) in a future PR. I'm not sure how we handle this in Python.errorToString
anderrorToStringDNS
which were just wrappers of theirIceInternal
counterpart. They were untested and unused.