-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[proj4]Rename dll to proj.dll/projd.dll #6180
Conversation
seems like the lines 42 to 69 should probably be removed from the portfile because it changes the default behavior of the package. |
@Neumann-A thanks for advice. |
@JackBoosY: |
@Neumann-A In fact, I am not sure about it. |
@JackBoosY #3258 says that the behavior should be changed in gdal (#3258 (comment)) and not in proj4
Even though renaming proj4 here would solve the problem in gdal its just a bad temporary fix. The right solution is to fix the behavior of gdal itself and where it tries to locate the dll. |
@Neumann-A In fact, proj's README has written:
So here should change the library name to proj instead of changing other dependent ports. |
@JackBoosY: Thats probably because the version of Proj4 in vcpkg is rather old (4.9.3 on 22 Aug 2016). Proj4 is already at 6.0.0 (https://github.com/OSGeo/proj.4/releases). Also the documentation seems to lag a bit behind: Although they export correct targets in cmake they still say to link against |
@Neumann-A I found that people are always using proj.dll instead of proj_${VERSION}.dll, not changing the library name may cause other dependent port calls to fail. |
@JackBoosY: How many ports in vcpkg would be affected? |
@JackBoosY Are you sure people are using proj instead of proj_version? The problem here is that proj4 defines PROJ4_LIBRARIES as proj from its config file. This proj is not a library name but a cmake target defined by PROJ4 so renaming the library hides the true issue that someone might be missing a find_dependency(PROJ4) call in its config file. See issue #6592. How did i find that one? One of my logs told me the following:
If you then check the targets generated by proj4 you actually find that proj is a target name (The whole story is linker issue in #5543 in port pdal which I investigated and found libgeotiff as a culprit) |
@Neumann-A This really made a decisive blow to me. Okay, I will close this PR and re-solve this issue with your solution. |
@Neumann-A By looking at the proj4 output file, I found that it generated proj.lib and proj4_9.dll, maybe we should fix it too? |
@JackBoosY The renaming from the portfile should be completely removed. Currently the portfile is renaming it to proj.lib.
I also found that out. What works instead is a find_library call. In PR 6658 I changed Qt to use find_library instead of hardcoded paths. Example:
The nice thing about it you do not have to thing too much about the OS differences. unfortunately the prologue
is required because in script mode cmake does not default them. Would be nice if vcpkg would default those values somewhere before reading in the portfile. |
@Neumann-A , PR #343 please have a look. |
@JackBoosY I don't know too much about Linux builds but instead of renaming the library adding a symlink on those platforms seems more appropriate. (if it is really required.) |
@Neumann-A I don't know which way is better... |
@JackBoosY: The problem here is that there is no clear guide how to handle these cases. And even the MS team seem to not have a clear idea what should be done. I can only tell you how I would handle these cases and that would be the following:
In the case of proj: I would follow the package default because packages using the original(old) proj have probably not been updated to the changes to proj and need an update to the new library name. Also having a versioned library name with debug suffix is a perfectly reasonable thing to have (and is I believe quite important for dlls) TL;DR; I have my opinion about how to solve it but I cannot tell you how to solve it. That is not something for me to decide. |
When using port gdal functions(such as OCTTransform()), we will received errors that cannot find proj.dll, so I rename release dll and debug dll.
See #3408.