Skip to content

nix: use curl with c-ares resolver #41609

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

Closed
wants to merge 2 commits into from
Closed

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Jun 7, 2018

Motivation for this change

This is an alternative to #41452. Apparently curl threaded resolver enabled in 7.60 imposes additional restrictions on usage of its API that are not present with its blocking or asynchronous resolvers.

Building with c-ares makes the asynchronous resolver the default.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Tested nix-channel --update does not wait for 10 seconds for DNS resolution.

orivej added 2 commits June 7, 2018 01:06
This reverts commit 5574df3.

Instead we will use curl 7.60 with c-ares resolver.
The threaded resolver enabled in 7.60 causes name resolution timeouts with the
way Nix uses curl API.
@orivej orivej mentioned this pull request Jun 7, 2018
8 tasks
@orivej
Copy link
Contributor Author

orivej commented Jun 7, 2018

@GrahamcOfBorg build nix

@GrahamcOfBorg GrahamcOfBorg added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jun 7, 2018
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nix

Partial log (click to expand)

running test tests/fetchGit.sh... [SKIP]
running test tests/fetchMercurial.sh... [SKIP]
running test tests/signing.sh... [PASS]
running test tests/run.sh... [PASS]
running test tests/brotli.sh... [PASS]
running test tests/pure-eval.sh... [PASS]
running test tests/check.sh... [PASS]
running test tests/plugins.sh... [PASS]
All tests succeeded
/nix/store/kkfcf5mlg95iffxi1s3clvxjgqfk6v08-nix-2.0.4

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nix

Partial log (click to expand)

/nix/store/kkfcf5mlg95iffxi1s3clvxjgqfk6v08-nix-2.0.4

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nix

Partial log (click to expand)

running test tests/fetchGit.sh... [SKIP]
running test tests/fetchMercurial.sh... [SKIP]
running test tests/signing.sh... [PASS]
running test tests/run.sh... [PASS]
running test tests/brotli.sh... [PASS]
running test tests/pure-eval.sh... [PASS]
running test tests/check.sh... [PASS]
running test tests/plugins.sh... [PASS]
All tests succeeded
/nix/store/45m9fdwbnxzdbxgmk5pd6a7d9lwxkk8k-nix-2.0.4

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nix

Partial log (click to expand)

these derivations will be built:
  /nix/store/5nybl513gkixidz0qkgnhvnp7qihy5is-curl-7.60.0.drv
  /nix/store/4d9mcfyxgldgg9m8mh4zkqqmlsycqd65-nix-2.0.4.drv
waiting for locks or build slots...
/nix/store/45m9fdwbnxzdbxgmk5pd6a7d9lwxkk8k-nix-2.0.4

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: nix

Partial log (click to expand)

running test tests/fetchGit.sh... [SKIP]
running test tests/fetchMercurial.sh... [SKIP]
running test tests/signing.sh... [PASS]
running test tests/run.sh... [PASS]
running test tests/brotli.sh... [PASS]
running test tests/pure-eval.sh... [PASS]
running test tests/check.sh... [PASS]
running test tests/plugins.sh... [PASS]
All tests succeeded
/nix/store/6xpa5j1l0wwpwryky8agd4fnwv0n699h-nix-2.0.4

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: nix

Partial log (click to expand)

running test tests/fetchGit.sh... [SKIP]
running test tests/fetchMercurial.sh... [SKIP]
running test tests/signing.sh... [PASS]
running test tests/run.sh... [PASS]
running test tests/brotli.sh... [PASS]
running test tests/pure-eval.sh... [PASS]
running test tests/check.sh... [PASS]
running test tests/plugins.sh... [PASS]
All tests succeeded
/nix/store/6xpa5j1l0wwpwryky8agd4fnwv0n699h-nix-2.0.4

@dtzWill
Copy link
Member

dtzWill commented Jun 7, 2018

I like this a lot, but c-ares means no support for glibc's nss plugins that are sometimes used for mdns/NIS/maybe-other-things.

I don't know how important that is for fetchurl, or if such things are expected to work with Nix (presumably they wouldn't in a sandbox, so only builtins.fetchurl?), but thought I'd mention it.

@orivej
Copy link
Contributor Author

orivej commented Jun 7, 2018

@dtzWill Sounds reasonable, closing in favor of #41619.

@orivej orivej closed this Jun 7, 2018
@orivej orivej deleted the nix-curl-c-arel branch March 29, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants