;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018 Oleg Pykhalov ;;; Copyright © 2017, 2018 Ludovic Courtès ;;; Copyright © 2017 Clément Lassieur ;;; ;;; 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 tests version-control) #:use-module (gnu tests) #:use-module (gnu system) #:use-module (gnu system file-systems) #:use-module (gnu system shadow) #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services version-control) #:use-module (gnu services cgit) #:use-module (gnu services web) #:use-module (gnu services networking) #:use-module (gnu packages version-control) #:use-module (guix gexp) #:use-module (guix store) #:use-module (guix modules) #:export (%test-cgit %test-git-http)) (define README-contents "Hello! This is what goes inside the 'README' file.") (define %make-git-repository ;; Create Git repository in /srv/git/test. (with-imported-modules (source-module-closure '((guix build utils))) #~(begin (use-modules (guix build utils)) (let ((git (string-append #$git "/bin/git"))) (mkdir-p "/tmp/test-repo") (with-directory-excursion "/tmp/test-repo" (call-with-output-file "/tmp/test-repo/README" (lambda (port) (display #$README-contents port))) (invoke git "config" "--global" "user.email" "charlie@example.org") (invoke git "config" "--global" "user.name" "A U Thor") (invoke git "init") (invoke git "add" ".") (invoke git "commit" "-m" "That's a commit.")) (mkdir-p "/srv/git") (rename-file "/tmp/test-repo/.git" "/srv/git/test"))))) (define %test-repository-service ;; Service that creates /srv/git/test. (simple-service 'make-git-repository activation-service-type %make-git-repository)) (define %cgit-configuration-nginx (list (nginx-server-configuration (root cgit) (locations (list (nginx-location-configuration (uri "@cgit") (body '("fastc2015-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 <