;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven ;;; Copyright © 2016 Eric Le Bihan ;;; Copyright © 2016 Nikita ;;; Copyright © 2017 Ben Woodcroft ;;; Copyright © 2017, 2018 Nikolai Merinov ;;; Copyright © 2017, 2019-2022 Efraim Flashner ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018 Danny Milosavljevic ;;; Copyright © 2019 Ivan Petkov ;;; Copyright © 2020, 2021 Jakub Kądziołka ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2020 Matthew James Kraai ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 (unmatched parenthesis ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2022 Jim Newsome ;;; Copyright © 2022 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages rust) #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages curl) #:use-module (gnu packages elf) #:use-module (gnu packages flex) #:use-module (gnu packages gcc) #:use-module (gnu packages gdb) #:use-module (gnu packages jemalloc) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages ssh) #:use-module (gnu packages tls) #:use-module (gnu packages) #:use-module (guix build-system cargo) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module ((guix build utils) #:select (alist-replace)) #:use-module (guix utils) #:use-module (ice-9 match) #:use-module (srfi srfi-26)) ;; This is the hash for the empty file, and the reason it's relevant is not ;; the most obvious. ;; ;; The root of the problem is that Cargo keeps track of a file called ;; Cargo.lock, that contains the hash of the tarball source of each dependency. ;; ;; However, tarball sources aren't handled well by Guix because of the need to ;; patch shebangs in any helper scripts. This is why we use Cargo's vendoring ;; capabilities, where instead of the tarball, a directory is provided in its ;; place. (In the case of rustc, the source code already ships with vendored ;; dependencies, but crates built with cargo-build-system undergo vendoring ;; during the build.) ;; ;; To preserve the advantages of checksumming, vendored dependencies contain ;; a file called .cargo-checksum.json, which contains the hash of the tarball, ;; as well as the list of files in it, with the hash of each file. ;; ;; The patch-cargo-checksums phase of cargo-build-system runs after ;; any Guix-specific patches to the vendored dependencies and regenerates the ;; .cargo-checksum.json files, but it's hard to know the tarball checksum that ;; should be written to the file - and taking care of any unhandled edge case ;; would require rebuilding everything that depends on rust. This is why we lie, ;; and say that the tarball has the hash of an empty file. It's not a problem ;; because cargo-build-system removes the Cargo.lock file. We can't do that ;; for rustc because of a quirk of its build system, so we modify the lock file ;; to substitute the hash. (define %cargo-reference-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") (define* (nix-system->gnu-triplet-for-rust #:optional (system (%current-system))) (match system ("x86_64-linux" "x86_64-unknown-linux-gnu") ("i686-linux" "i686-unknown-linux-gnu") ("armhf-linux" "armv7-unknown-linux-gnueabihf") ("aarch64-linux" "aarch64-unknown-linux-gnu") ("mips64el-linux" "mips64el-unknown-linux-gnuabi64") ("riscv64-linux" "riscv64gc-unknown-linux-gnu") (_ (nix-system->gnu-triplet system)))) (define* (rust-uri version #:key (dist "static")) (string-append "https://" dist ".rust-lang.org/dist/" "rustc-" version "-src.tar.gz")) (define* (rust-bootstrapped-package base-rust version checksum) "Bootstrap rust VERSION with source checksum CHECKSUM using BASE-RUST." (package (inherit base-rust) (version version) (source (origin (inherit (package-source base-rust)) (uri (rust-uri version)) (sha256 (base32 checksum)))) (native-inputs (alist-replace "cargo-bootstrap" (list base-rust "cargo") (alist-replace "rustc-bootstrap" (list base-rust) (package-native-inputs base-rust)))))) ;;; Note: mrustc's only purpose is to be able to bootstap Rust; it's designed ;;; to be used in source form. (define %mrustc-commit "597593aba86fa2edbea80c6e09f0b1b2a480722d") (define %mrustc-source (let* ((version "0.10") (commit %mrustc-commit) (revision "2") (name "mrustc")) (origin (method git-fetch) (uri (git-reference (url "https://github.com/thepowersgang/mrustc") (commit commit))) (file-name (git-file-name name (git-version version revision commit))) (sha256 (base32 "09rvm3zgx1d86gippl8qzh13m641ynbw9q0zsc90g0h1khd3z3b6")) (modules '((guix build utils))) (snippet '(begin ;; Drastically reduces memory and build time requirements ;; by disabling debug by default. (substitute* (find-files "." "Makefile") (("-g ") ""))))))) ;;; Rust 1.54 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. (define rust-bootstrap (package (name "rust") (version "1.54.0") (source (origin (method url-fetch) (uri (rust-uri version)) (sha256 (base32 "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc")) (modules '((guix build utils))) (snippet '(begin (for-each delete-file-recursively '("src/llvm-project")))) (patches (search-patches "rustc-1.54.0-src.patch")) (patch-flags '("-p0")))) ;default is -p1 (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) (build-system gnu-build-system) (inputs `(("libcurl" ,curl) ("llvm" ,llvm) ("openssl" ,openssl-1.1) ("zlib" ,zlib))) (native-inputs `(("bison" ,bison) ;; A compiler bug in gcc 10/11/12/13 prevents us from using gcc-10.4. See: ;; https://github.com/thepowersgang/mrustc/issues/266 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860 ("gcc" ,gcc-9) ;; TODO: STARTFILE_PREFIX_SPEC is fixed on gcc<10 on core-updates. ,@(if (target-riscv64?) `(("gcc:lib" ,gcc-9 "lib")) '()) ("flex" ,flex) ("pkg-config" ,pkg-config) ;; Required for the libstd sources. ("mrustc-source" ,%mrustc-source))) (arguments `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' #:modules ((guix build cargo-utils) (guix build utils) (guix build gnu-build-system)) #:test-target "test" ;; Rust's own .so library files are not found in any RUNPATH, but ;; that doesn't seem to cause issues. #:validate-runpath? #f #:make-flags (list ,(string-append "RUSTC_TARGET=" (or (%current-target-system) (nix-system->gnu-triplet-for-rust))) ,(string-append "RUSTC_VERSION=" version) ,(string-append "MRUSTC_TARGET_VER=" (version-major+minor version)) "OUTDIR_SUF=") ;do not add version suffix to output dir #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-reference-to-cc ;; This prevents errors like 'error: linker `cc` not found' when ;; "cc" is not found on PATH. (lambda* (#:key inputs #:allow-other-keys) (let ((gcc (assoc-ref inputs "gcc"))) (substitute* (find-files "." "^link.rs$") (("\"cc\".as_ref") (format #f "~s.as_ref" (string-append gcc "/bin/gcc"))))))) (add-after 'unpack 'setup-mrustc-sources (lambda* (#:key inputs #:allow-other-keys) (copy-recursively (assoc-ref inputs "mrustc-source") "../mrustc") ;; The Makefile of mrustc expects the sources directory of rustc ;; to be at this location, and it simplifies things to make it ;; so. (symlink (getcwd) (string-append "../mrustc/rustc-" ,version "-src")) (with-output-to-file "dl-version" (lambda _ (format #t "~a~%" ,version))))) (add-after 'setup-mrustc-sources 'patch-makefiles ;; This disables building the (unbundled) LLVM. (lambda* (#:key inputs parallel-build? #:allow-other-keys) (let ((llvm (assoc-ref inputs "llvm"))) (with-directory-excursion "../mrustc" (substitute* '("minicargo.mk" "run_rustc/Makefile") ;; Use the system-provided LLVM. (("LLVM_CONFIG [:|?]= .*") (string-append "LLV2018-11-14daemon: Install 'authenticate' script under LIBEXECDIR/guix.Ludovic Courtès That way it is handled in the same way as other helper scripts. * nix/scripts/guix-authenticate.in: Rename to... * nix/scripts/authenticate.in: ... this. * config-daemon.ac: Adjust accordingly. * nix/local.mk (libstore_a_CPPFLAGS): Remove -DOPENSSL_PATH. (nodist_libexec_SCRIPTS): Remove. (nodist_pkglibexec_SCRIPTS): New variable. * nix/nix-daemon/guix-daemon.cc (main): Remove 'setenv' call for "PATH". * nix/libstore/local-store.cc (runAuthenticationProgram): New function. (LocalStore::exportPath, LocalStore::importPath): Use it instead of 'runProgram' and OPENSSL_PATH. 2018-01-07daemon: Make libbz2 an optional dependency.Ludovic Courtès * config-daemon.ac: Don't bail out when libbz2 is missing. Define 'HAVE_LIBBZ2' Automake conditional. * nix/libstore/build.cc: Wrap relevant bits in '#if HAVE_BZLIB_H'. * nix/libstore/globals.cc (Settings::Settings): 'logCompression' defaults to COMPRESSION_GZIP when HAVE_BZLIB_H is false. * nix/libstore/globals.hh (CompressionType): Make 'COMPRESSION_BZIP2' conditional on HAVE_BZLIB_H. * nix/local.mk (guix_register_LDADD, guix_daemon_LDADD): Add -lbz2 only when HAVE_LIBBZ2. * nix/nix-daemon/guix-daemon.cc (parse_opt): Ignore "bzip2" when not HAVE_BZLIB_H. 2018-01-07daemon: Add gzip log compression.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (GUIX_OPT_LOG_COMPRESSION): New macro. (options): Mark "disable-log-compression" as hidden and add "log-compression". (parse_opt): Handle GUIX_OPT_LOG_COMPRESSION. * nix/libstore/build.cc (DerivationGoal): Add 'gzLogFile'. (openLogFile): Initialize it when 'logCompression' is COMPRESSION_GZIP. (closeLogFile, handleChildOutput): Honor 'gzLogFile'. * nix/libstore/globals.hh (Settings)[compressLog]: Remove. [logCompression]: New field. (CompressionType): New enum. * nix/libstore/globals.cc (Settings::Settings): Initialize it. (update): Remove '_get' call for 'compressLog'. * nix/local.mk (guix_daemon_LDADD, guix_register_LDADD): Add -lz. * guix/store.scm (log-file): Handle '.gz' log files. * tests/guix-daemon.sh: Add test with '--log-compression=gzip'. * doc/guix.texi (Invoking guix-daemon): Adjust accordingly. * config-daemon.ac: Check for libz and zlib.h. 2017-06-22daemon: '--listen' can be passed several times, can specify TCP endpoints.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (DEFAULT_GUIX_PORT): New macro. (listen_options): New variable. (parse_opt): Push back '--listen' options to LISTEN_OPTIONS. (open_unix_domain_socket, open_inet_socket) (listening_sockets): New functions. (main): Use it. Pass SOCKETS to 'run'. * nix/nix-daemon/nix-daemon.cc (matchUser): Remove. (SD_LISTEN_FDS_START): Remove. (acceptConnection): New function. (daemonLoop): Rewrite to take a vector of file descriptors, to select(2) on them, and to call 'acceptConnection'. (run): Change to take a vector of file descriptors. * tests/guix-daemon.sh: Add test. 2017-06-04daemon: Add '--timeout' and '--max-silent-time'.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (GUIX_OPT_TIMEOUT) (GUIX_OPT_MAX_SILENT_TIME): New macros. * nix/nix-daemon/guix-daemon.cc (options): Add '--timeout' and '--max-silent-time'. (parse_opt): Honor them. * tests/guix-daemon.sh: Add test. * doc/guix.texi (Invoking guix-daemon): Document the options. (Common Build Options): Properly describe default timeout/max-silent-time value. Add cross-ref to "Invoking guix-daemon". 2017-01-15daemon: Client settings no longer override daemon settings.Ludovic Courtès Fixes <http://bugs.gnu.org/20217>. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x161. * nix/nix-daemon/nix-daemon.cc (performOp): "build-max-jobs", "build-max-silent-time", and "build-cores" are no longer read upfront; instead, read them from the key/value list at the end. * nix/nix-daemon/guix-daemon.cc (main): Explicitly set 'settings.maxBuildJobs'. * guix/store.scm (%protocol-version): Bump to #x161. (set-build-options): #:max-build-jobs, #:max-silent-time, and #:build-cores now default to #f. Adjust handshake to new protocol. * tests/store.scm ("build-cores"): New test. * tests/guix-daemon.sh: Add test for default "build-cores" value. 2016-03-16build: Default to "https://mirror.hydra.gnu.org/" for substitutes.Ludovic Courtès * config-daemon.ac: Check for (gnutls) and define 'GUIX_SUBSTITUTE_URLS'. * nix/nix-daemon/guix-daemon.cc (main): Use GUIX_SUBSTITUTE_URLS. * guix/store.scm (%default-substitute-urls): Use 'https' when (gnutls) is available. * doc/guix.texi (Binary Installation): Mention mirrors (Invoking guix-daemon): Mention mirror.hydra.gnu.org. (Substitutes): Mention mirrors. (Invoking guix archive): Show https URLs. 2015-12-13daemon: Add '--rounds'.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (GUIX_OPT_BUILD_ROUNDS): New macro. (options): Add --rounds. (parse_opt): Honor it. * doc/guix.texi (Invoking guix-daemon): Document it. 2015-06-10daemon: Internationalize guix-daemon.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (n_, _): New macros. (guix_textdomain): New variable. (doc): Use 'n_'. (options): Likewise, and lowercase messages. (argp): Add initializer for 'argp_domain' field. (parse_opt): Use '_' for messages. (main): Likewise, and add calls to 'setlocale', 'bindtextdomain', and 'textdomain'. * daemon.am (guix_daemon_CPPFLAGS): Add -DLOCALEDIR. * po/guix/Makevars (XGETTEXT_OPTIONS): Remove '--language' option. Add '--keyword=n_'. * po/guix/POTFILES.in: Add guix-daemon.cc. 2015-05-19Merge branch 'nix'.Ludovic Courtès * daemon.am (AM_CXXFLAGS): Change -std=c++0x to -std=c++11. (libstore_a_CPPFLAGS): Add -DDEFAULT_CHROOT_DIRS. (parse_opt): Use 'settings.get' instead of 'settings.dirsInChroot'. (main): Likewise. * tests/guix-archive.sh: Don't grep for the "importing ..." message since it is no longer produced. The nix/ part is a squashed commit of the following: commit 3bfa70b7963e12be346900e64ae45fa019850675 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Dec 10 13:53:04 2014 +0100 Don't wait for PID -1 The pid field can be -1 if forking the substituter process failed. commit 5241aec531e9c9a4b2dd5e5b6ee3f07ff049d9a5 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Nov 24 16:48:04 2014 +0100 Build derivations in a more predictable order Derivations are now built in order of derivation name, so a package named "aardvark" is built before "baboon". Fixes #399. commit 9f355738e106f4ca49bba7276e8d520a2fc2955d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Nov 24 16:44:35 2014 +0100 Don't create unnecessary substitution goals for derivations commit 554eaf5e8c82ddd6a42e4301f6d3dd5419c04060 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Nov 19 18:02:39 2014 +0100 Disable vacuuming the DB after garbage collection Especially in WAL mode on a highly loaded machine, this is not a good idea because it results in a WAL file of approximately the same size ad the database, which apparently cannot be deleted while anybody is accessing it. commit 4eb62b5230c29e2f6ab17352439521083846c259 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Nov 19 17:09:27 2014 +0100 nix-daemon: Call exit(), not _exit() This was preventing destructors from running. In particular, it was preventing the deletion of the temproot file for each worker process. It may also have been responsible for the excessive WAL growth on Hydra (due to the SQLite database not being closed properly). Apparently broken by accident in 8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74. commit f160a30d5612506de41a8206a57eccee1cd85fb7 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Nov 19 17:07:29 2014 +0100 Clean up temp roots in a more C++ way commit a64744477d95e6932ae0fefc7cc358b56b8c397f Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Nov 17 01:00:39 2014 +0100 Fix message commit b73de6e49b64d01974649a1e67a77113b768c2b1 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Nov 14 14:16:20 2014 +0100 Don't use ADDR_LIMIT_3GB This gives 32-bit builds on x86_64-linux more memory. commit e0825bd36b43f3c1d408745a9c61f92fdaf7dace Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Nov 12 11:35:53 2014 +0100 Make ~DerivationGoal more reliable commit 86b9e6d4575e5c93f428b8563ae259f0f4014173 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Nov 4 10:41:29 2014 +0100 nix-store --gc: Don't warn about missing manifests directory commit 1129a982c4e77ff465fd6102627477900af2f7f4 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Oct 31 09:36:09 2014 +0100 Improve error message if the daemon worker fails to start commit bed17f40fce27e1a31f70957b1d0dd912b58700d Author: Shea Levy <shea@shealevy.com> Date: Mon Oct 20 12:15:50 2014 -0400 Fix build on gcc < 4.7 commit ee8601cac4b353e551b238f546a0e7e8fcdcd3be Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Oct 14 10:51:19 2014 +0200 Improved error message when encountering unsupported file types Fixes #269. commit c2b65dd197a1b2e14d517b0b5ff307b149538917 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Oct 3 22:37:51 2014 +0200 Remove some duplicate code commit c95742283595cb01b44ddc8e6ff5e9c1d66db444 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Oct 3 16:53:28 2014 +0200 createDirs(): Handle ‘path’ being a symlink In particular, this fixes "nix-build -o /tmp/result" on Mac OS X (where /tmp is a symlink). commit 6092a48603ea7888f8a1f69db87835bc339c973a Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Sep 25 18:45:43 2014 +0200 nix-daemon: Close unnecessary fd commit e74390a16f74233283572661f64ed4f03ae1650d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Sep 19 15:07:22 2014 +0200 Remove bogus comment commit e63c8aaa0511d1d0a5487c45dec9f8cbd66b4cc6 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Sep 17 17:21:13 2014 +0200 On Linux, disable address space randomization commit 55939b1a4b34b904eedba90ac6c14efc6258f40d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Sep 17 15:18:13 2014 +0200 Settings: Add bool get() commit 6621195e48f8e0cbbe6e19dbcde30bd8a7da0399 Author: Ludovic Courtès <ludo@gnu.org> Date: Mon Sep 1 22:21:42 2014 +0200 Add an 'optimiseStore' remote procedure call. commit 3bb89c3a31b9cf6e056f3659389e2d2e7afd17fa Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Aug 28 18:57:13 2014 +0200 Add disallowedReferences / disallowedRequisites For the "stdenv accidentally referring to bootstrap-tools", it seems easier to specify the path that we don't want to depend on, e.g. disallowedRequisites = [ bootstrapTools ]; commit abd9d61e6201ddbde3305dd27c286e883e950bec Author: Gergely Risko <errge@nilcons.com> Date: Wed Aug 27 16:46:02 2014 +0200 Introduce allowedRequisites feature commit 8c766e48d5c4741b63a4f24dc91138f587c04a5a Author: Joel Taylor <me@joelt.io> Date: Thu Aug 21 14:06:49 2014 -0700 fix disappearing bash arguments commit d4e7c195fabf0f24c2ffbd4ca8f189489bbbf44d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 19 17:44:59 2014 +0200 Make hook shutdown more reliable commit ea837e470f70900481d00b0d1cd73e6855c4f70d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 18 11:35:50 2014 +0200 Doh commit 790271559cb8b36cd8fcdc533f41be88ec15ad08 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sun Aug 17 19:11:50 2014 +0200 Reduce verbosity commit 3f6d4f63ec0d1d6cfc3233998b7dd9608b2f6ff3 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sun Aug 17 19:09:03 2014 +0200 Propagate remote timeouts properly commit aa98ba506739b885b3ce0b392dade5e1e1bb07f7 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Aug 13 17:44:41 2014 +0200 Use regular file GC roots if possible This makes hydra-eval-jobs create roots as regular files. See 1c208f2b7ef8ffb5e6d435d703dad83223a67bd6. commit 5fe5ff77800c2911c011f582d8dfa90c44d4a3a5 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 5 16:41:42 2014 +0200 Remove unnecessary call to addTempRoot() commit 1820845c44c8cbe1121e78d5f16e7778532477f6 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 5 10:19:57 2014 +0200 Doh commit e9070bf4226b225a0b42798b20ea3947abf58a6f Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:13:14 2014 +0200 Move some options out of globals commit 31909515634d74e4c3d92be6186c5c48244582ae Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:02:29 2014 +0200 Refactor commit f530ee6f356f4299ca343dde7f4c0742300ffa08 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:00:00 2014 +0200 Add option ‘build-extra-chroot-dirs’ This is useful for extending (rather than overriding) the default set of chroot paths. commit 75f746f018e34868b8057bed87c90d2cbe2c0b6c Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 17:27:45 2014 +0200 Get rid of "killing <pid>" message for unused build hooks commit 42c6246f674ca2d5ea166d1ae676b7087ea1b0d8 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 19:38:21 2014 +0200 Remove ugly hack for detecting build environment setup errors commit b732ffd28ddf50d3150e4f276a0e8488e38eaacb Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 19:29:03 2014 +0200 Call commonChildInit() before doing chroot init This ensures that daemon clients see error messages from the chroot setup. commit c51374c128cbe1f06acd95ba2d627a118a95aabf Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 17:30:51 2014 +0200 Eliminate redundant copy commit 666c9b7108e460f0d3450015a3379bfeb3e3a497 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 17:20:25 2014 +0200 findRoots(): Prevent a call to lstat() This means that getting the roots from /nix/var/nix/.../hydra-roots doesn't need any I/O other than reading the directory. commit 82d463d9cacbf2a93b95ab5313567d593fd00d02 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 16:37:47 2014 +0200 Make readDirectory() return inode / file type commit a98fa2d9e2b06e2561330c5ef845ffaf131e95ac Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 16:46:01 2014 +0200 Allow regular files as GC roots If a root is a regular file, then its name must denote a store path. For instance, the existence of the file /nix/var/nix/gcroots/per-user/eelco/hydra-roots/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7 would cause /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7 to be a root. This is useful because it involves less I/O (no need for a readlink() call) and takes up less disk space (the symlink target typically takes up a full disk block, while directory entries are packed more efficiently). This is particularly important for hydra.nixos.org, which has hundreds of thousands of roots, and where reading the roots can take 25 minutes. commit 4ab4b0c109734bd6e265ca5f1b6415c31c03ab11 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 24 00:00:53 2014 +0200 Remove some dead code commit 1cffdf5847b065183c9aac86df3a9578020e6712 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 19:43:46 2014 +0200 nix-daemon: Less verbosity commit bb07dfe96f0d07aa18db385d3ec93b24b5568213 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 19:37:40 2014 +0200 nix-daemon: Simplify stderr handling commit 766481d606e4b1860307692d6a44723983662d45 Merge: c69944c fdee1ce Author: Ludovic Courtès <ludo@gnu.org> Date: Mon May 11 17:04:26 2015 +0200 Merge commit 'fdee1ced43fb495d612a29e955141cdf6b9a95ba' into nix commit c69944c511b89d3fdbffe00353e27d1e1c5f670c Merge: a1dd396 8e9140c Author: Ludovic Courtès <ludo@gnu.org> Date: Wed May 6 23:22:04 2015 +0200 Merge commit '8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74' into nix Conflicts: Makefile.config.in configure.ac dev-shell doc/manual/builtins.xml doc/manual/conf-file.xml doc/manual/local.mk doc/manual/nix-instantiate.xml doc/manual/nix-store.xml doc/manual/writing-nix-expressions.xml misc/emacs/nix-mode.el perl/lib/Nix/CopyClosure.pm release.nix scripts/nix-build.in scripts/nix-copy-closure.in src/download-via-ssh/download-via-ssh.cc src/libexpr/common-opts.cc src/libexpr/common-opts.hh src/libexpr/eval.cc src/libexpr/eval.hh src/libexpr/local.mk src/libexpr/nixexpr.cc src/libexpr/nixexpr.hh src/libexpr/parser.y src/libexpr/primops.cc src/libexpr/symbol-table.hh src/libmain/shared.cc src/libstore/local.mk src/nix-env/nix-env.cc src/nix-instantiate/nix-instantiate.cc src/nix-store/local.mk src/nix-store/nix-store.cc src/nix-store/serve-protocol.hh tests/lang.sh tests/lang/eval-okay-context.nix tests/lang/eval-okay-search-path.exp tests/lang/eval-okay-search-path.nix tests/local.mk tests/nix-copy-closure.nix commit a1dd396cc02922372314c35c8035a38bfeea08df Merge: 0a75126 8d5f472 Author: Ludovic Courtès <ludo@gnu.org> Date: Sun Jan 4 23:01:14 2015 +0100 Merge commit '8d5f472f2c49c79a0d3ae2e506f4d4d76224b328' into nix Conflicts: .gitignore Makefile doc/manual/installation.xml doc/manual/introduction.xml doc/manual/local.mk doc/manual/manual.xml doc/manual/nix-collect-garbage.xml doc/manual/nix-env.xml doc/manual/nix-install-package.xml doc/manual/nix-store.xml doc/manual/quick-start.xml doc/manual/release-notes.xml local.mk misc/emacs/nix-mode.el mk/functions.mk mk/install.mk mk/lib.mk mk/libraries.mk mk/patterns.mk mk/programs.mk nix.spec.in release.nix scripts/install-nix-from-closure.sh scripts/nix-build.in src/libexpr/eval-inline.hh src/libexpr/eval.cc src/libexpr/eval.hh src/libexpr/get-drvs.cc src/libexpr/nixexpr.cc src/libexpr/nixexpr.hh src/libexpr/parser.y src/libexpr/primops.cc src/libstore/local.mk src/nix-daemon/local.mk src/nix-env/nix-env.cc src/nix-env/user-env.cc src/nix-instantiate/nix-instantiate.cc src/nix-store/nix-store.cc tests/init.sh tests/nix-copy-closure.nix tests/remote-builds.nix version commit 0a751260ae54bb37ae33e0f4fc3bcda2a4ea3ceb Author: Ludovic Courtès <ludo@gnu.org> Date: Wed Dec 17 11:10:25 2014 +0100 nix: Adjust code for Guix. * nix/libstore/gc.cc (addAdditionalRoots): Refer to 'list-runtime-roots' instead of 'find-runtime-roots.pl'. * nix/libutil/hash.cc, nix/libutil/hash.hh: Change 'union Ctx' to 'struct Ctx', like 'nix/sync-with-upstream' did. * nix/AUTHORS: New file. * nix/COPYING: New file, from upstream Nix. * nix/libutil/md32_common.h, nix/libutil/md5.c, nix/libutil/md5.h, nix/libutil/sha1.c, nix/libutil/sha1.h, nix/libutil/sha256.c, nix/libutil/sha256.h: Remove. commit d4e18b05e0ab149265d3d09ae017d7337fc4176f Author: Ludovic Courtès <ludo@gnu.org> Date: Wed Dec 17 10:44:19 2014 +0100 Keep only libstore, nix-daemon, and related stuff. commit fdee1ced43fb495d612a29e955141cdf6b9a95ba Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 19:11:26 2014 +0200 startProcess: Make writing error messages from the child more robust commit 5989966ed3bd58cd362aed8cba6cd5c90b380a32 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 14:46:28 2014 +0200 Remove dead code commit ee3c5d7916b48d0c3b1cc08044e27209c14acfdc Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sat Jul 19 02:25:47 2014 +0200 Revert old useBuildHook behaviour commit 2e77bd70faee34cb2518529318a54b39f2d9143e Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Jul 18 12:54:30 2014 +0200 Better fix for strcasecmp on Darwin commit f609eec71a25a9bb8c32dd9620b7deb88633a22a Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Jul 18 00:01:06 2014 +0200 Bump commit 8ddffe7aac414756809f43732effb8951858243b Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 17 23:57:17 2014 +0200 Ugly hack to fix building on old Darwin http://hydra.nixos.org/build/12580878 commit 049c0eb49c621ae50f49c8a06dc6c3a9839ef388 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 17 16:57:07 2014 +0200 nix-daemon: Add trusted-users and allowed-users options ‘trusted-users’ is a list of users and groups that have elevated rights, such as the ability to specify binary caches. It defaults to ‘root’. A typical value would be ‘@wheel’ to specify all users in the wheel group. ‘allowed-users’ is a list of users and groups that are allowed to connect to the daemon. It defaults to ‘*’. A typical value would be ‘@users’ to specify the ‘users’ group. commit 0c730887c4ec4a03fb854490e422c134a1bf8139 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 17 15:49:33 2014 +0200 nix-daemon: Show name of connecting user commit 77c972c898b325997fa2f527264a9706f1e414a5 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 17 15:41:11 2014 +0200 nix-daemon: Only print connection info if we have SO_PEERCRED commit 8f72e702a114458e92f644160950344a7bf7166a Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 17 15:23:31 2014 +0200 nix-daemon: Fix compat with older clients commit 2304a7dd21639959dc4bcafa3e17374cc087cd0a Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 16 16:32:26 2014 +0200 Get rid of a compiler warning commit 985f1595fe9f61095c7bc94b49be1179811ec630 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 16 16:30:50 2014 +0200 Be more strict about file names in NARs commit 276a40b31f631c188d6dcbdf603a738e1380ff74 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 16 16:02:05 2014 +0200 Handle case collisions on case-insensitive systems When running NixOps under Mac OS X, we need to be able to import store paths built on Linux into the local Nix store. However, HFS+ is usually case-insensitive, so if there are directories with file names that differ only in case, then importing will fail. The solution is to add a suffix ("~nix~case~hack~<integer>") to colliding files. For instance, if we have a directory containing xt_CONNMARK.h and xt_connmark.h, then the latter will be renamed to "xt_connmark.h~nix~case~hack~1". If a store path is dumped as a NAR, the suffixes are removed. Thus, importing and exporting via a case-insensitive Nix store is round-tripping. So when NixOps calls nix-copy-closure to copy the path to a Linux machine, you get the original file names back. Closes #119. commit bb65460feb265be4d938c7dc724a76ef41a8bfaf Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 16 11:19:12 2014 +0200 Make dev-shell script work on Darwin commit de8be7c3e06b52c313e0b452b641ad5f90dca2fe Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 16 11:16:54 2014 +0200 Install systemd and Upstart stuff only