<p>nix-build --falback์€ nixos.org๊ฐ€ ๋‹ค์šด๋˜์—ˆ์„ ๋•Œ ๋กœ์ปฌ ํŒจํ‚ค์ง€๋ฅผ ๋นŒ๋“œํ•˜๋Š” ๊ฒƒ์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</p>

์— ๋งŒ๋“  2013๋…„ 02์›” 06์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: NixOS/nix

TL;DR: nixos.org๋Š” ๋‹จ์ผ ์‹คํŒจ ์ง€์ ์ž…๋‹ˆ๋‹ค.


์–ด์ œ nix๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์‹œ์ž‘ํ•˜์—ฌ ๋‚ด ์ž์‹ ์˜ ํŒจํ‚ค์ง€๋ฅผ ์ž‘์„ฑํ•˜๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค(Mac OSX์—์„œ).
nixpkgs๋ฅผ ๋ณต์ œํ•˜๊ณ  ํ•ดํ‚น์„ ์‹œ์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค.

โžญ nix-build --version
nix-build (Nix) 1.3

์˜ค๋Š˜ ์•„์นจ nixos.org๊ฐ€ ๋‹ค์šด๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. ์•„๋งˆ์กด๋„ ๊ฐ€๋”์”ฉ ์˜คํ”„๋ผ์ธ ์ƒํƒœ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋‚˜๋Š” nixos.org๋ฅผ ๋ฌด์‹œํ•˜๋„๋ก nix-build๋ฅผ ์–ป์„ ์ˆ˜ ์—†๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์‹œํ—˜์„ ๋งˆ์นœ:

time sudo nix-build pkgs/top-level/all-packages.nix -A jzmq --fallback -vvv -K

๋ฌธ์ž ๊ทธ๋Œ€๋กœ ๊ธฐ๋‹ค๋ฆฐ ํ›„:

2,91s user 0,75s system 0% cpu 25:19,63 total

๋‹ค์Œ ์˜ค๋ฅ˜์™€ ํ•จ๊ป˜ ๋นŒ๋“œ๊ฐ€ ๊ณ„์†๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

*** Downloading โ€˜http://nixos.org/binary-cache/nar/0xl2pl3raiig8zc9d6nq374ixc3cacyf4nsf9l1vcdanbxy5j3qr.nar.bz2โ€™ to โ€˜/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82โ€™...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:02:31 --:--:--     0curl: (7) couldn't connect to host

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

error: unexpected end-of-file
download of `http://nixos.org/binary-cache/nar/0xl2pl3raiig8zc9d6nq374ixc3cacyf4nsf9l1vcdanbxy5j3qr.nar.bz2' failed: No such file or directory
could not download โ€˜/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82โ€™ from any binary cache

--fallback _not_ ์˜ ์š”์ ์€ ๋ฐ”์ด๋„ˆ๋ฆฌ ์บ์‹œ๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์Šต๋‹ˆ๊นŒ?

๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋” ๋งŽ์ด ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.

|   |   substitution of `/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82': got EOF
|   |   substitution of `/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82': woken up
|   |   substitution of `/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82': substitute finished
|   |   substitution of `/nix/store/3i1yircxji7aa9n9i4zrlrv5lvsh9a9l-zeromq-2.1.10': woken up
|   |   substitution of `/nix/store/jn33ykljd38iap3sk5xhyvbfh0alczxm-pkg-config-0.23': woken up
|   |   substitution of `/nix/store/1xbw8dkqy3schdq3pxx1fgbkh7vhfz4x-openjdk6-b16-24_apr_2009-r1': woken up
|   |   substitution of `/nix/store/673bzl40yrkaxsl00yg3dgld94md29z5-diffutils-3.2': woken up
|   |   substitution of `/nix/store/ad9hfdv0780w4cmb176ahpskyr3xyxnc-ed-1.5': woken up
|   |   substitution of `/nix/store/h20nwkpjdh17713swin8nkgh0087ywaf-gawk-4.0.0': woken up
|   |   substitution of `/nix/store/jgzcrf62crlzqj5n3rwyw1wxafnq0ps8-gzip-1.4': woken up
|   |   substitution of `/nix/store/q4fwa9yi7k2hygg17yl7nn5spdvmrlsz-findutils-4.4.2': woken up
|   |   substitution of `/nix/store/yq5barc33nbn7jp98qcc8ls6ziym9ljl-gnused-4.2.1': woken up
|   |   substitution of `/nix/store/jgwvnghydgimvjpfbly6q7h8anq5zfj7-pcre-8.21': woken up
|   |   substitution of `/nix/store/v47z8y0igawvy6vf3m2npw2ykj250yvj-libiconv-1.13.1': woken up
|   |   substitution of `/nix/store/8rqgqrn1a1zskmnyfgpwdlgv9n2iwpgh-expat-2.1.0': woken up
|   |   substitution of `/nix/store/yhjy4fy1w0bwlqn528pffxfyfhrq1dgg-python-2.7.3': woken up
|   |   substitution of `/nix/store/maf2xvaf7xq4krn4w54r42cppz8zg79l-libiconv-1.13.1': woken up
|   building of `/nix/store/wb8dn0x2kyslmxgjypw7bjd389hnpixg-jzmq-2.1.0.drv': goal destroyed
|   building of `/nix/store/lmkvbjyrxpis61sl3kfhwiccy6ai1kcb-git-export.drv': goal destroyed
|   building of `/nix/store/fz5wi1gmshai7m3sdxv0594gk12z6k1b-git-1.8.1.drv': goal destroyed
|   substitution of `/nix/store/k7r91gak4q4yirmnx6bimfva3imw309g-git-1.8.1': goal destroyed
|   substitution of `/nix/store/yhjy4fy1w0bwlqn528pffxfyfhrq1dgg-python-2.7.3': goal destroyed
|   substitution of `/nix/store/nhfh2qfh14gviv93my60nd1kpyn1cpgn-gettext-0.18.1.1': goal destroyed
|   substitution of `/nix/store/maf2xvaf7xq4krn4w54r42cppz8zg79l-libiconv-1.13.1': goal destroyed
|   substitution of `/nix/store/8rqgqrn1a1zskmnyfgpwdlgv9n2iwpgh-expat-2.1.0': goal destroyed
|   building of `/nix/store/3xxi6mdmzlm1n1zmcw4i717mrd4vwfh6-cacert-20120628.drv': goal destroyed
|   building of `/nix/store/5armkqw9dvx2vnhx7f2nh0d7sfl07pn5-cacert-20120628.pem.bz2.drv': goal destroyed
|   building of `/nix/store/rm3cqk01n4ivgmhiv44xbhm0q2ibxbha-mirrors-list.drv': goal destroyed
|   building of `/nix/store/cbbhkdjb526nyf709gr65hqjs5mmk82h-openjdk6-b16-24_apr_2009-r1.drv': goal destroyed
|   substitution of `/nix/store/1xbw8dkqy3schdq3pxx1fgbkh7vhfz4x-openjdk6-b16-24_apr_2009-r1': goal destroyed
|   building of `/nix/store/3c24kg1jsi1ck5wll20gqx1hgcywvic7-pkg-config-0.23.drv': goal destroyed
|   substitution of `/nix/store/jn33ykljd38iap3sk5xhyvbfh0alczxm-pkg-config-0.23': goal destroyed
|   building of `/nix/store/c3q9vhg9cm054cs7n75ka64w4m8zar6y-zeromq-2.1.10.drv': goal destroyed
|   substitution of `/nix/store/3i1yircxji7aa9n9i4zrlrv5lvsh9a9l-zeromq-2.1.10': goal destroyed
|   building of `/nix/store/clwd5v42l8m65iqvqjbxrckfi17q4am2-stdenv.drv': goal destroyed
|   substitution of `/nix/store/zyilsch6gvrfxfmr8j37bjgvh21n65yf-stdenv': goal destroyed
|   substitution of `/nix/store/yq5barc33nbn7jp98qcc8ls6ziym9ljl-gnused-4.2.1': goal destroyed
|   substitution of `/nix/store/xczvmbi8rxchb1wz01ii2iwphimgdxfv-gnugrep-2.10': goal destroyed
|   substitution of `/nix/store/v47z8y0igawvy6vf3m2npw2ykj250yvj-libiconv-1.13.1': goal destroyed
|   substitution of `/nix/store/jgwvnghydgimvjpfbly6q7h8anq5zfj7-pcre-8.21': goal destroyed
|   substitution of `/nix/store/q4fwa9yi7k2hygg17yl7nn5spdvmrlsz-findutils-4.4.2': goal destroyed
|   substitution of `/nix/store/kqbdpd16yjpangakz575wcsfrgbljcbb-patch-2.6.1': goal destroyed
|   substitution of `/nix/store/ad9hfdv0780w4cmb176ahpskyr3xyxnc-ed-1.5': goal destroyed
|   substitution of `/nix/store/jgzcrf62crlzqj5n3rwyw1wxafnq0ps8-gzip-1.4': goal destroyed
|   substitution of `/nix/store/h20nwkpjdh17713swin8nkgh0087ywaf-gawk-4.0.0': goal destroyed
|   lock released on `/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82.lock'
|   substitution of `/nix/store/d83wfy078cq9x6ljr1x7ba6cp287xsg9-gnumake-3.82': goal destroyed
|   substitution of `/nix/store/673bzl40yrkaxsl00yg3dgld94md29z5-diffutils-3.2': goal destroyed
error: unexpected EOF reading a line

๊ทธ๋Ÿฐ ๋‹ค์Œ ํŽธ์ง‘์„ ์‹œ๋„ํ–ˆ์Šต๋‹ˆ๋‹ค.

sudo nano /nix/store/4czrvlsn3a8ava9p3axl7wzy3j1l8746-nix-1.3/libexec/nix/substituters/download-from-binary-cache.pl

processRequests ์˜ while ๋ฃจํ”„๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

while (0 && $activeRequests) {

์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์ฆ‰์‹œ ์ข…๋ฃŒ๋˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ณ€๊ฒฝ์œผ๋กœ

time sudo nix-build pkgs/top-level/all-packages.nix -A jzmq --fallback -vvv -K

ํ›จ์”ฌ ๋น ๋ฅด๊ฒŒ ์™„๋ฃŒ๋˜์—ˆ์ง€๋งŒ ๋ฐ”์ด๋„ˆ๋ฆฌ ์บ์‹œ์—์„œ gnumake ๋ฅผ ๋‹ค์‹œ ๋‹ค์šด๋กœ๋“œํ•˜๋ ค๊ณ  ์‹œ๋„ํ•˜๊ณ  2๋ถ„ 32์ดˆ ํ›„์— ํฌ๊ธฐํ–ˆ์Šต๋‹ˆ๋‹ค.
--fallback์€ ๋‹ค์‹œ ๋ฌด์—‡์„ ํ•ฉ๋‹ˆ๊นŒ?


๊ทธ๋Ÿผ ๋‚œ ํ•ด๋ดค์–ด (์—ฌ๊ธฐ์„œ ํ•„์‚ฌ์ ์œผ๋กœ)

time sudo nix-build pkgs/top-level/all-packages.nix --option binary-caches '' --fallback -vvv -K -A jzmq

์–ด๋–ค ์ด์œ ๋กœ ๋ฐ”์ด๋„ˆ๋ฆฌ ์บ์‹œ ์˜ต์…˜์„ ๋ณ€๊ฒฝํ•  ๋•Œ nix-build๋Š” curl๊ณผ ๊ฐ™์€ ํ›จ์”ฌ ๋” ๋งŽ์€ ํŒจํ‚ค์ง€๋ฅผ ๋นŒ๋“œํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. /nix/store/ ์— ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ๋ชจ๋“  ์ข…์†์„ฑ์„ ๋ฌด์‹œํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ?!

๋นŒ๋“œ๊ฐ€ ๋งค์šฐ ๋Š๋ฆฌ๊ฒŒ ์ง„ํ–‰๋˜๊ณ  ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ์ธ์‡„๋ฉ๋‹ˆ๋‹ค.

error checking the existence of http://nixos.org/tarballs/sha256/b7f510db60f520ba0bc8a39cccee7e913362205b4a7709e16af2cba14093099b:
curl: (7) couldn't connect to host
  1. Curl์ด ๋นŒ๋“œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  2. Libssh2๋Š” ๊ฐ™์€ ์ด์œ ๋กœ ๋นŒ๋“œ์— ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.
  3. ๊ฒฐ๊ตญ nixos.org๊ฐ€ ๋‹ค์‹œ ์‹œ์ž‘๋˜๊ณ  openssl์ด ์†Œ์Šค์—์„œ ๋นŒ๋“œ๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ฌธ์ œ๊ฐ€ ๋นจ๋ฆฌ ํ•ด๊ฒฐ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค. ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์—์„œ disnix๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์ง€ ์•Š๊ณ  nixos.org๊ฐ€ ๋‹ค์šด๋˜์—ˆ์„ ๋•Œ ์„œ๋ฒ„๋ฅผ ๊ณ ์น  ์ˆ˜ ์—†๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค! ๊ทธ๊ฒƒ์€ ์‹ฌ๊ฐํ•œ ๋‹จ์ผ ์‹คํŒจ ์ง€์ ์ž…๋‹ˆ๋‹ค!
--fallback์ด ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜๋”๋ผ๋„ HTTP ์—ฐ๊ฒฐ ์‹œ๊ฐ„ ์ดˆ๊ณผ๊ฐ€ ๋„ˆ๋ฌด ๋†’์Šต๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

ํ›„์†์„ ์œ„ํ•ด: --option build-use-substitutes false ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

use-binary-caches ์˜ต์…˜์ด ์‚ฌ๋ผ์ง„ ๊ฒƒ ๊ฐ™๊ณ  connect-timetout ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ด๋ฆ„ ํ™•์ธ ์˜ค๋ฅ˜์— ๋Œ€ํ•œ ์žฌ์‹œ๋„ ๋•Œ๋ฌธ์— ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ๋นŒ๋“œ๊ฐ€ ์—ฌ์ „ํžˆ ๋งŽ์ด ๊ธฐ๋‹ค๋ฆฌ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋ชจ๋“  3 ๋Œ“๊ธ€

์ด์ œ $NIX_CONNECT_TIMEOUT ๋˜๋Š” --option connect-timeout N ๋ฅผ ํ†ตํ•ด ์—ฐ๊ฒฐ ์‹œ๊ฐ„ ์ดˆ๊ณผ๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. --option use-binary-caches false ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ”์ด๋„ˆ๋ฆฌ ์บ์‹œ ์‚ฌ์šฉ์„ ๋น„ํ™œ์„ฑํ™”ํ•˜๋Š” ๊ฒƒ์ด ์ด๋ฏธ ๊ฐ€๋Šฅํ–ˆ์Šต๋‹ˆ๋‹ค.

--fallback ์œผ๋กœ ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ํ•  ์ˆ˜๋Š” ์—†์ง€๋งŒ,

๋‚ด ์‹œ์Šคํ…œ์— ์ •ํ™•ํžˆ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. cache.nixos.org๊ฐ€ ๋‹ค์šด๋˜์—ˆ๊ณ  ๋ชจ๋“  ์˜ต์…˜( -option use-binary-caches false , --option connect-timeout N , --fallback )์„ ์‹œ๋„ํ–ˆ์ง€๋งŒ ํ•ญ์ƒ ์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. :

error: unable to download โ€˜https://cache.nixos.org/ffkdlmsag787xjdc55v4yi4vbbc0irrc.narinfoโ€™: Couldn't connect to server (7)

์˜ต์…˜์„ ๊ณ ๋ คํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋ช‡ ๊ฐ€์ง€ ์„ธ๋ถ€์ •๋ณด:

  • ๋‚˜๋Š” nixos(archlinux)๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • ๋‚˜๋Š” nix๋ฅผ ๋ถˆ์•ˆ์ •ํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

ํ›„์†์„ ์œ„ํ•ด: --option build-use-substitutes false ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

use-binary-caches ์˜ต์…˜์ด ์‚ฌ๋ผ์ง„ ๊ฒƒ ๊ฐ™๊ณ  connect-timetout ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ด๋ฆ„ ํ™•์ธ ์˜ค๋ฅ˜์— ๋Œ€ํ•œ ์žฌ์‹œ๋„ ๋•Œ๋ฌธ์— ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ๋นŒ๋“œ๊ฐ€ ์—ฌ์ „ํžˆ ๋งŽ์ด ๊ธฐ๋‹ค๋ฆฌ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰