-
Notifications
You must be signed in to change notification settings - Fork 9
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
Upgrade to Dokan 2.0.4+fix #5
Conversation
e84a281
to
bfe57a0
Compare
I am going to release 2.0.5, @KoltesDigital would you be interested to maintain the rust wrapper ? It should not require much time unless there is an API breakage which rarely happened in the past. |
@Liryna Hi sorry for the delay. Agreed to be maintainer, hopefully you'll be right 😄 BTW, I'd like your opinion on the way this binding "tags" the upstream Dokan version. Currently, semver's build metadata is used to inform: I've read that some crates use an old lib version by default, and opt in new versions through features. This makes sense for backward-compatible changes, but it won't help upgrading Dokan from 1.5 to 2.0. Besides, these considerations apply for Linux where it's common to have lib*.so globally available, while this project targets Windows and it's common for each app to embed their dependency DLLs. So maybe it should be made clear that every app should embed its Dokan DLL. This may be specific to Rust, but it seems no other Rust maintainers are available, and maybe you know enough of it. But I'm also having this question with other frameworks (e.g. creating a Chocolatey package for an app), and it seems the correct way does depend on the framework (e.g. Chocolatey packages should use a forth segment in the version id). Well if you've ever thought about it, I'd be glad to hear. |
Thanks @KoltesDigital for accepting the role! 🥳 Welcome to the family. Regarding the versioning I would propose to have the native dokan library version used (so that users can directly understand for which dokan library it works with) + a version number that gives the wrapper the capability to apply fixes. |
Joined! Thanks! The problem with the forth segment is it's not in the semver specs, that's an addition of NuGet. Pretty sure most language package managers won't accept it. What I ended up doing is using the third segment, as it should be fine to update to any patch release. But in this case where there is a Rusty wrapper on top of the binding, the wrapper may change in a non-backward compatible way with the same DLL. This comment suggests semver can't handle usage complexity by design. So after all, maybe the best way is to log a message like Well, that was future-oriented. For now I'll just push this PR 😉 |
Sounds good to me! Thanks again for helping the community! |
Any updates on this since July? |
Ha yes sorry I'll push tomorrow. BTW while you're here, as it seems you're interested in that feature, feel free to review the code |
8d6a099
to
3510148
Compare
I'm still on it, I overlooked unit tests. Sorry for the couple of force-pushes, and the still broken main branch. Some changes are needed in the high-level wrapper lib, and I think it's okay to do them now as there also will be changes due to moving from Dokan 1 to 2. I'll do that in a further commit, put the reasons and move instructions in a changelog. Briefly, the main reason is that the current high-level lib creates the FS with the options being on the stack, and depending whether the function is inlined, the process may segfault. This issue is already present, but the stars were so aligned that it was never caught by the tests or example apps. @Liryna I saw that The high-level lib also states that |
@KoltesDigital This is really only historical and yes you are correct, the free functions and the create file system functions will affect the same global variables.
It does stdout! Here: https://github.com/dokan-dev/dokany/blob/2352816c996537e90a5786b84219b708f6cfeb02/dokan/dokanc.h#L64 FYI, there is dokan-dev/dokany#851 to |
Also, If ever you consider fixing that while staying backward compatible as much as possible, I'm thinking about a nasty hack: return a non-null value and set |
I'm doing a lot of NodeJS stuff and most libraries allow to pass a custom function to receive log messages, which I find a good thing, so I'm rather for the idea of function pointer. I can try a PR too. However, this would mean the two bitflags would be removed -> breaking change -> major release. Or they can be marked as deprecated to avoid the breaking change. The link you provided indicates |
Good idea! Created dokan-dev/dokany#1109 and will take of it.
For the library this is fine. It would just be a |
Sorry https://github.com/dokan-dev/dokany/blob/2352816c996537e90a5786b84219b708f6cfeb02/dokan/dokanc.h#L66 |
Great! All tests are passing now, except two, and I'd like to have your opinion on them. The first one concerns The second failing test concerns |
Indeed the memory container type was changed and the order of how they are inserted with. It should not have any impact so I would suggest to just adapt the tests. For |
Ok, one test left! The test is here, which triggers this handler. |
Oh yes this is expected. It is the system that sends us the buffer with this limited size. In that case the test should return |
Oh I see. Well this wasn't implemented, although the tests did pass... Anyway, they all pass again! I'll clean and push very soon. Thanks for your help! |
One more question related to the C lib: is there a reason why you hold a whole |
That was introduced a while ago. I don't recall if there were any specific reason it is like that. Maybe it is one way to limit the size of the descriptor which will be copied to the struct sent to the driver during mount. Same way as the MountPoint. |
8d18422
to
27eb02e
Compare
27eb02e
to
80efdd2
Compare
80efdd2
to
51d6372
Compare
51d6372
to
d88cbf1
Compare
Yay the CICD is fine now. Upgraded to the latest 2.0.6 as well! Although some runs failed, apparently because of transient errors. The debug messages are output to find out if they occur again. I force-pushed a couple of times, more or less purposefully, but it hasn't happened yet. I've added changelogs with the same formatting as the main repo. Since this is a monorepo of two crates, I'll also start to tag releases with the crate as prefix: @Liryna sadly the publishing of crates is not part of the CICD. Are you owner of the crates on crates.io, and if so, would you rather publish them yourself or invite me as publisher? |
I have no access unfortunately :( @DDoSolitary could it be possible to give access to myself and @KoltesDigital ? |
@KoltesDigital added |
@DDoSolitary Indeed I had not account, it should work now. Thanks! |
@DDoSolitary thanks! While you're here, please consider reviewing the code before I publish it. Because you use the lib for your own projects, you'll be impacted. |
@KoltesDigital Please just go ahead. Currently I don't even have time for maintaining the project that uses yasfw. |
@Liryna Owner invitation sent. |
Got it! Thanks! |
Thanks @KoltesDigital for the contribution! |
Finally it's there! Sorry for the delay. I'll soon begin an app, therefore I'll double-check the changes in the API. |
Proposal to upgrade, please review and give feedback but do not accept it yet, it relies on a fix in the dokany repository which hasn't been released yet. It may lead to dokany 2.0.5 or 2.1.0.
Now
DokanInit
andDokanShutdown
must be called accordingly. I've tried to that with a RAII pattern, i.e. an empty struct with call the former in the constructor and the latter inDrop
impl, but I found it too cumbersome: the struct had to beSend
etc. Besides users can instantiate it twice: to prevent that, an extra runtime cost would be required. I finally went simply for two functions which have to be called when users know best.I've added a config file to ensure formatting rules are the same for all contributors. I've done that in separated commits to keep the upgrade apart.