-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add (Windows): Unicode and long-paths support #36
Conversation
Really appreciate all the work you've put into this! Sorry to ask this of you, but would you be able to file this PR to the upstream project instead? I don't actually intend to maintain par2cmdline - this fork is mostly a simple modification, but I intend to pull down changes made upstream. I haven't looked at either, but you also might be interested in this PR made there, which sounds like it tries to do something similar. The other changes you intend to make sound really useful to me, but please also file PRs for them upstream. Alternatively, if you prefer to not be an 'official' par2cmdline maintainer, you could maintain your own fork, and I'll consider re-pointing this project to that as upstream. |
I see, thanks. |
That will be very helpful, thank you! |
@dnzbk We at SABnzbd have been waiting/hoping for par2cmdline-turbo with UTF8 and Long-path support, so if you could get this fixed in general also for the executable version, that would really help us ❤️ |
@Safihre |
Re f65eb8a: not freeing is actually intentional.
Good on you for identifying it nonetheless. |
@animetosho thanks for the feedback. Yes, it's not that important if Par2 is used as a standalone command line tool, but I think it’s crucial when it used as a library as we do in NZBGet. |
I'm interested in changing things to avoid issues, but I don't understand how this would be an issue when used as a library? |
Each new instance of Par2Repairer calls gfmat_init() as it aggregates PAR2Proc which leads to memory allocations without freeing it when PAR2Proc and Par2Repairer are destroyed. |
That's not quite it, only the first call allocates memory. Subsequent instances do not allocate memory. |
Yes, you're right. Memory is indeed allocated only once. Valgrind was producing false positives as the memory is not actually explicitly freed up at program termination but this is not really something we should care about. |
Ah that makes sense - thanks for letting me know! Maybe I can look at adding a Valgrind leak suppression file so that it doesn't turn up in reports (though people running Valgrind will need to know to include it). |
@dnzbk I saw you merged the nzbget PR. Is there also a way to get par2cmdline (turbo) with proper long path and utf8 support as a stand-alone binary? :) |
@Safihre |
ffee646
to
2a27e47
Compare
@Safihre @animetosho
After updating
I hope my investigation will help you fix this. Or maybe I’ll take care of it when I have some free time. |
Ah yes, diagnosing failing Github Actions - lots of fun. |
@animetosho still can't persuade you to merge this into turbo directly? 🤗 |
I had a quick look at the changes made in nzbgetcom's fork. I mostly don't get the intention behind moving the headers around, and this could make future updates a little finicky. So I'm a bit reluctant to use the repository as an upstream at the moment. For @Safihre's purposes, using the nzbgetcom fork might do everything you need it to. I'm reiterating, but appreciate the work @dnzbk has put in. |
The nzbget branch includes some changes (signals, namespaces, headers refactoring and etc.) specific to nzbget and is not needed by anyone else except nzbget itself. |
Ah I see, thanks for the explanation! |
@animetosho we can merge the utf8 branch? |
@dnzbk I tried it but it still has a problem with our unicode-test case NZB (which works with Multipar). |
@Safihre Thanks, I'll take a look. |
Success! |
Now we can finally switch to par2cmdline (from Multipar) for the Windows release of SABnzbd. It was the only platform where we didn't use it yet 🥳 |
If you're happy with maintaining a fork, I can point this repository to that as upstream. |
Not sure how to make this file obvious to those that need it, but at least it's here Ref animetosho/par2cmdline-turbo#36 (comment)
@animetosho hi,
I added support for Unicode and long-paths on Windows - looking forward to your feedback,
NZBGet currently uses the par2cmdline library, which was vendored and patched to support Unicode some time ago. However, I’d like to switch to your improved fork as it offers better performance and maintenance. I’m aiming to use it as an external dependency, pulling it directly from the repository. To achieve this, I’ll need to refactor the code significantly, as par2cmdline-turbo isn’t currently designed for easy library integration. This will involve creating namespaces, separating header files for external and internal usage, and making other necessary changes.
Additionally, I’d like to transition from using msbuild and autotools to CMake, primarily due to its cross-platform compatibility and better dependency management.
I plan to implement these changes in my fork. Would you be interested in reviewing my changes and potentially incorporating them into your main repository?
I’d appreciate any feedback or suggestions you might have on this plan. Are there any aspects I might have overlooked?