Skip to content
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

rdiff v2.3.4 popt.dll error on Windows #253

Closed
mariomadproductions opened this issue Feb 20, 2023 · 10 comments
Closed

rdiff v2.3.4 popt.dll error on Windows #253

mariomadproductions opened this issue Feb 20, 2023 · 10 comments

Comments

@mariomadproductions
Copy link

mariomadproductions commented Feb 20, 2023

When I try and run the rdiff exe from the v2.3.4 release, it says that popt.dll cannot be found. The build from this github action works correctly. v2.0.2 from the ubuntu repos works correctly.

@mariomadproductions mariomadproductions changed the title v2.3.4 rdiff popt.dll error on Windows rdiff v2.3.4 popt.dll error on Windows Feb 20, 2023
@dbaarda
Copy link
Member

dbaarda commented Feb 22, 2023

Are you using the rdiff exe from the release here, or built from some ubuntu repo?

If the build artifact from the branch you linked to works, it's surprising that the build from the release doesn't, as they are both produced using the same build setup.

Can you give more details about the error? If it's having trouble finding the popt.dll on your system, there must be something different about the working build runs that either means it's being run in a different path setup that can find popt.dll, or popt has been statically linked in.

You could try installing popt the same way we do in our actions setup that does the build by using vcpkg;

$ vcpkg update
$ vcpkg --triplet x64-windows install libpopt

We might need to make a static windows build for the releases to mitigate problems like this on windows.

@mariomadproductions
Copy link
Author

mariomadproductions commented Feb 22, 2023

Yeah the download from the release.

Hm yeah that is strange.

Unfortunately the error didn't provide the path it was looking for, but I logged some file events using Process Monitor:
process_monitor_log.csv

I'll try that.

Yeah I think that's probably best for windows.

@dbaarda
Copy link
Member

dbaarda commented Feb 23, 2023

Did you grab the "install" artifact or the "build" artifact from the branch? I notice that the "build" artifact includes the popt.dll installed by vcpkg so I'm guessing it was that.

The "install" artifact includes only the librsync related bits and not any dependencies, so I'm also guessing that installing the popt dependency with vcpkg will solve the problem. The "build" artifact includes the whole build input/output mess and is not what you would would want to install.

A statically linked rdiff.exe binary would avoid these problems, but those builds don't have a librsync.dll for people that want to just use the library.

Let me know how it goes.

@dbaarda
Copy link
Member

dbaarda commented Feb 24, 2023

I'm going to assume that installing the popt.dll with vcpkg fixed it and close this issue. Feel free to reopen it if you have further related discoveries or problems.

@dbaarda dbaarda closed this as completed Feb 24, 2023
@mariomadproductions
Copy link
Author

I did run the vcpkg command but the exe still gave the error. Didn't have time to look into it further yet. But yeah this is probably best solved by having a static binary, so np with closing the issue.

@dbaarda
Copy link
Member

dbaarda commented Feb 25, 2023

It depends on where popt.dll ends up installed vs where rdiff.exe and librsync.dll get installed and what your PATH is set to. I'm not sure how/where vcpkg installs stuff but if you copy them all into the same directory it should work.

@mariomadproductions
Copy link
Author

Ah. Seems to work after putting popt.dll beside the exe. I guess the release could be modified to include it?

@mariomadproductions
Copy link
Author

mariomadproductions commented Mar 6, 2023

Ah. Seems to work after putting popt.dll beside the exe. I guess the release could be modified to include it?

@dbaarda Should I make a separate issue for this?

(Just so I can link people to a ready-to-use thing hosted here, I'm uploading a zip with popt.dll: librsync-win64-2.3.4-bin-with-popt.zip)

@dbaarda
Copy link
Member

dbaarda commented Mar 15, 2023

Normally in non-windows-land it's considered bad practice to include all your dependencies in your release-build, since those dependencies are typically shared by many applications and you don't want to install them multiple times.

However, in windows-land, system configuration and package management is such a sh*t-show that it's pretty much normal practice to bundle everything with every application. This is how/why windows ends up with multiple copies of dll's installed all over the place.

Rather than copy and contribute to the windows dll mess, I think the right thing to do here is to use a statically linked binary for the windows release instead. This does mean people wanting to develop/use a librsync.dll for windows will have to build their own, but they are far more likely to do that anyway.

If you do want this, feel free to file another bug asking for a statically linked binary for windows with each release.

@mariomadproductions
Copy link
Author

Yeah, I think it'd probably be best to have a static binary. Its not urgent, but it would be good to have an easy/quick download link to point windows users towards. I'll open an issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants