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

ffi phase: copy curl-config to dynamic folder #10

Closed
shawnlaffan opened this issue Mar 8, 2020 · 5 comments
Closed

ffi phase: copy curl-config to dynamic folder #10

shawnlaffan opened this issue Mar 8, 2020 · 5 comments

Comments

@shawnlaffan
Copy link
Contributor

Proj 7.0.0 has a new dependency on libcurl. Its configure script uses the curl-config utility to set the lib paths and cflags, and it seems not to be simple to override this.

The issue is that compilation of Alien::proj with Proj 7 fails because the curl-config utility in the bin dir refers to the static build, while proj requires a dynamic build.

Copying the curl-config utility from the ffi build dir into the dynamic dir under Alien::curl->dist_dir seems to fix the issue.

I'd submit a PR now, but in looking at the code for the ffi phase in the alienfile, I'm not actually sure which of the paths refers to the build directory. If you let me know what the best way to get the build dir then I can work up a PR if needed.

Thanks,
Shawn.

@plicease
Copy link
Member

plicease commented Mar 8, 2020

Interesting, by default we drop everything that doesn't go into the dynamic directory for the ffi phase, as it usually isn't useful for FFI. Maybe we we can install the curl-config to install into the dynamic directory too? FFI::CheckLib should correctly ignore executables that go into the dynamic directory.

For now at least I want the curl-config in bin to be the static version.

Proj will have to be careful to link dynamic directories correctly, when the libraries aren't in the standard system library directories. The exact incantations aren't portable which is one of the reasons Alien-Build avoids doing it. Alien-Role-Dino supports this for some platforms (ARD is only useful Perl, but it is illustrative of some of the hoops that you have to jump through). I'm not familiar with Proj, so I don't know if portability is a concern, or if maybe you don't want to worry about that right now, but it is something to consider.

@plicease
Copy link
Member

plicease commented Mar 8, 2020

If we do install the curl-config into the dynamic directory, we can add an accessor maybe dynamic_bin_dir that returns the appropriate path.

@shawnlaffan
Copy link
Contributor Author

I think the end result will be a curl-config in each of the bin and dynamic directories. The two have different values for several of the parameters.

System libs I'll have to deal with when I get to them. A curl-config probe in Alien::proj could indicate if the system curl is static, in which case Alien::proj might need to complain that a share build is needed to get the dynamic version. I'll look at Alien-Role-Dino as well.

A dynamic_bin_dir accessor would be handy.

@plicease
Copy link
Member

plicease commented Mar 8, 2020

I think the end result will be a curl-config in each of the bin and dynamic directories. The two have different values for several of the parameters.

connect, just to be clear this is what my suggestion was intending.

System libs I'll have to deal with when I get to them. A curl-config probe in Alien::proj could indicate if the system curl is static, in which case Alien::proj might need to complain that a share build is needed to get the dynamic version. I'll look at Alien-Role-Dino as well.

ARD is just for background. But worth reviewing it has some commentary about the challenges with share install dynamic libs.

A dynamic_bin_dir accessor would be handy.

👍

shawnlaffan added a commit to shawnlaffan/Alien-curl that referenced this issue May 3, 2020
This also gets the package config file, .dll.a and .la files.
The former is useful, the other two should/hopefully have no
real effect.

Updates PerlAlien#10
shawnlaffan added a commit to shawnlaffan/Alien-curl that referenced this issue Sep 1, 2020
This also gets the package config file, .dll.a and .la files.
The former is useful, the other two should/hopefully have no
real effect.

Updates PerlAlien#10
plicease pushed a commit that referenced this issue Sep 2, 2020
This also gets the package config file, .dll.a and .la files.
The former is useful, the other two should/hopefully have no
real effect.

Updates #10
@plicease
Copy link
Member

I think we are done here? or at least some work has been done here, so if more work needs doing lets open a new ticket for that.

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

No branches or pull requests

2 participants