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

Dub coming with ldc-binary-1.34 doesn't find curl, reason unclear. #69

Open
dukc opened this issue May 4, 2024 · 1 comment
Open

Dub coming with ldc-binary-1.34 doesn't find curl, reason unclear. #69

dukc opened this issue May 4, 2024 · 1 comment

Comments

@dukc
Copy link
Collaborator

dukc commented May 4, 2024

DUB can't access the Internet to download packages. Strace says it isn't searching the curl path when trying to do so:

# ...
openat(AT_FDCWD, "/nix/store/1q6qwq8csbhyy0pv54sab00jxlmb3rw2-gcc-12.3.0-libgcc/lib/libcurl-gnutls.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/gqghjch4p1s69sv4mcjksb2kb65rwqjy-glibc-2.38-23/lib/libcurl-gnutls.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/sdhmm56jv7r449hf7f57cl3pvnsy3cbg-xgcc-12.3.0-libgcc/lib/libcurl-gnutls.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/1q6qwq8csbhyy0pv54sab00jxlmb3rw2-gcc-12.3.0-libgcc/lib/libcurl-nss.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/gqghjch4p1s69sv4mcjksb2kb65rwqjy-glibc-2.38-23/lib/libcurl-nss.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/sdhmm56jv7r449hf7f57cl3pvnsy3cbg-xgcc-12.3.0-libgcc/lib/libcurl-nss.so.4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
# and so on...

I figured out it doesn't do this because it's trying to open curl at runtime, so that Autopatchelf at pkgs/ldc/binary.nix can't figure out it'll do so. So I went ahead and added runtimeDependencies = [curl]; and rebuilt my LDC binary derivation. Both patchelf and objdump confirm that RPATH now correctly includes Curl.

But for some reason. this does not fix the issue nor change what strace prints. ltrace confirms that dlopen is being used, so it can't be some custom library searching either. I'm confused.

@PetarKirov
Copy link
Owner

Thanks for detailed analysis @dukc! I recall encountering the same (or at least very similar issue) with our Dub derivation. I didn't debug the issue, but what you're saying makes sense to me.

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