-
Notifications
You must be signed in to change notification settings - Fork 69
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
Simplify loading API. #145
Conversation
9ab1886
to
a826343
Compare
Are these changes (and the related ones in |
The need is for running multiple tests in parallel. Currently, |
@KyleMayes, can you have another look here? |
I will take another look tomorrow, sorry about the delay
…On Thu, Oct 20, 2022, 18:31 Markus Reiter ***@***.***> wrote:
@KyleMayes <https://github.com/KyleMayes>, can you have another look here?
—
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHYCKESYOGFES3GIUCT5Q3WEHB3PANCNFSM6AAAAAAQOYXFAA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Took another look, I'm very hesitant to merge this because it is a breaking change. I can see two alternatives:
I understand that the current loading API is more easily misused, but I don't think it's worth the breaking change. Your desire to have the ability to have multiple |
I don't agree that a breaking change is inherently a reason not to merge this, sometimes breaking stuff in inevitable when improving stuff. That is of course not to say these changes cannot be improved further before releasing this in a new version.
I guess it is possible, but this was the cleanest solution I could come up with. I will try to have another look at the |
I'm not inherently opposed to breaking changes, it's just that by the nature of this crate and how it is used, non-backwards-compatible versions cause problems in the ecosystem. I know there's stuff like the semver trick but that sounds like it would require significantly more effort than I am willing to put in. |
Ah, I see. I didn't think about the types becoming incompatible. |
As I understand from KyleMayes/clang-rs#26, the library should only be loaded once per thread.
This changes the
load
method so it returns anRc<SharedLibrary>
, since you cannot share the library across threads anyways.This also removes the
get/set_library
function, which previously claimed they allow sharing the library across threads, which should not be possible.The
unload
method returns an error if the current thread still references the library.