From bb640d6133dea0ede7e80db9ca64a9b2e451317a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 24 Nov 2018 15:59:26 +0100 Subject: daemon: Ignore '--keep-failed' for TCP/IP clients. * nix/nix-daemon/nix-daemon.cc (performOp) : When 'isRemoteConnection' is true, set 'settings.keepFailed' to zero. * doc/guix.texi (Common Build Options): Document this behavior. --- doc/guix.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index e783c16365..a2af1e9cbd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6229,6 +6229,10 @@ the end of the build log. This is useful when debugging build issues. @xref{Debugging Build Failures}, for tips and tricks on how to debug build issues. +This option has no effect when connecting to a remote daemon with a +@code{guix://} URI (@pxref{The Store, the @code{GUIX_DAEMON_SOCKET} +variable}). + @item --keep-going @itemx -k Keep going when some of the derivations fail to build; return only once -- cgit v1.2.3 From 0c17f72070cbfb04f311b776a080849b369aac25 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 24 Nov 2018 16:07:30 +0100 Subject: services: openssh: Install OpenSSH in the system profile. This ensures one can scp to or from the GuixSD machine that uses the service. * gnu/services/ssh.scm (openssh-service-type)[extensions]: Add PROFILE-SERVICE-TYPE extension. * gnu/system/examples/bare-bones.tmpl : Remove OPENSSH. * doc/guix.texi (Using the Configuration System): Adjust accordingly. --- doc/guix.texi | 6 +++--- gnu/services/ssh.scm | 10 +++++++++- gnu/system/examples/bare-bones.tmpl | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index a2af1e9cbd..917a3e9d57 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9727,9 +9727,9 @@ environment variable---in addition to the per-user profiles provides all the tools one would expect for basic user and administrator tasks---including the GNU Core Utilities, the GNU Networking Utilities, the GNU Zile lightweight text editor, @command{find}, @command{grep}, -etc. The example above adds GNU@tie{}Screen and OpenSSH to those, -taken from the @code{(gnu packages screen)} and @code{(gnu packages ssh)} -modules (@pxref{Package Modules}). The +etc. The example above adds GNU@tie{}Screen to those, +taken from the @code{(gnu packages screen)} +module (@pxref{Package Modules}). The @code{(list package output)} syntax can be used to add a specific output of a package: diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 056602248f..bb94c5f41a 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -518,7 +518,15 @@ (define openssh-service-type (service-extension activation-service-type openssh-activation) (service-extension account-service-type - (const %openssh-accounts)))) + (const %openssh-accounts)) + + ;; Install OpenSSH in the system profile. That way, + ;; 'scp' is found when someone tries to copy to or from + ;; this machine. + (service-extension profile-service-type + (lambda (config) + (list (openssh-configuration-openssh + config)))))) (compose concatenate) (extend extend-openssh-authorized-keys) (default-value (openssh-configuration)))) diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index 889dcabe64..902dacbe57 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -3,7 +3,7 @@ (use-modules (gnu)) (use-service-modules networking ssh) -(use-package-modules screen ssh) +(use-package-modules screen) (operating-system (host-name "komputilo") @@ -40,7 +40,7 @@ %base-user-accounts)) ;; Globally-installed packages. - (packages (cons* screen openssh %base-packages)) + (packages (cons screen %base-packages)) ;; Add services to the baseline: a DHCP client and ;; an SSH server. -- cgit v1.2.3 From 8856f409d13cd7376be4319b9f75df0692c009d6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Nov 2018 22:14:11 +0100 Subject: derivations: Add properties. * guix/derivations.scm (derivation): Add #:properties parameter. [user+system-env-vars]: Honor it. (derivation-properties): New procedure. (build-expression->derivation): Add #:properties and pass it to 'derivation'. * guix/gexp.scm (gexp->derivation): Likewise. * tests/derivations.scm ("derivation-properties"): New test. * tests/gexp.scm ("gexp->derivation properties"): New test. * doc/guix.texi (Derivations, G-Expressions): Adjust accordingly. --- doc/guix.texi | 8 ++++++-- guix/derivations.scm | 30 +++++++++++++++++++++++++----- guix/gexp.scm | 4 +++- tests/derivations.scm | 10 ++++++++++ tests/gexp.scm | 10 +++++++++- 5 files changed, 53 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 917a3e9d57..c040a8531a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5060,7 +5060,7 @@ a derivation is the @code{derivation} procedure: [#:system (%current-system)] [#:references-graphs #f] @ [#:allowed-references #f] [#:disallowed-references #f] @ [#:leaked-env-vars #f] [#:local-build? #f] @ - [#:substitutable? #t] + [#:substitutable? #t] [#:properties '()] Build a derivation with the given arguments, and return the resulting @code{} object. @@ -5097,6 +5097,9 @@ When @var{substitutable?} is false, declare that substitutes of the derivation's output should not be used (@pxref{Substitutes}). This is useful, for instance, when building packages that capture details of the host CPU instruction set. + +@var{properties} must be an association list describing ``properties'' of the +derivation. It is kept as-is, uninterpreted, in the derivation. @end deffn @noindent @@ -5790,7 +5793,8 @@ information about monads.) [#:leaked-env-vars #f] @ [#:script-name (string-append @var{name} "-builder")] @ [#:deprecation-warnings #f] @ - [#:local-build? #f] [#:substitutable? #t] [#:guile-for-build #f] + [#:local-build? #f] [#:substitutable? #t] @ + [#:properties '()] [#:guile-for-build #f] Return a derivation @var{name} that runs @var{exp} (a gexp) with @var{guile-for-build} (a derivation) on @var{system}; @var{exp} is stored in a file called @var{script-name}. When @var{target} is true, diff --git a/guix/derivations.scm b/guix/derivations.scm index 7afecb10cc..f6176a78fd 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -80,6 +80,7 @@ (define-module (guix derivations) substitutable-derivation? substitution-oracle derivation-hash + derivation-properties read-derivation read-derivation-from-file @@ -681,7 +682,8 @@ (define* (derivation store name builder args references-graphs allowed-references disallowed-references leaked-env-vars local-build? - (substitutable? #t)) + (substitutable? #t) + (properties '())) "Build a derivation with the given arguments, and return the resulting object. When HASH and HASH-ALGO are given, a fixed-output derivation is created---i.e., one whose result is known in @@ -708,7 +710,10 @@ (define* (derivation store name builder args derivations where the costs of data transfers would outweigh the benefits. When SUBSTITUTABLE? is false, declare that substitutes of the derivation's -output should not be used." +output should not be used. + +PROPERTIES must be an association list describing \"properties\" of the +derivation. It is kept as-is, uninterpreted, in the derivation." (define (add-output-paths drv) ;; Return DRV with an actual store path for each of its output and the ;; corresponding environment variable. @@ -763,6 +768,10 @@ (define (user+system-env-vars) `(("impureEnvVars" . ,(string-join leaked-env-vars))) '()) + ,@(match properties + (() '()) + (lst `(("guix properties" + . ,(object->string properties))))) ,@env-vars))) (match references-graphs (((file . path) ...) @@ -851,6 +860,14 @@ (define (invalidate-derivation-caches!) (invalidate-memoization! derivation-path->base16-hash) (hash-clear! %derivation-cache)) +(define derivation-properties + (mlambdaq (drv) + "Return the property alist associated with DRV." + (match (assoc "guix properties" + (derivation-builder-environment-vars drv)) + ((_ . str) (call-with-input-string str read)) + (#f '())))) + (define* (map-derivation store drv mapping #:key (system (%current-system))) "Given MAPPING, a list of pairs of derivations, return a derivation based on @@ -1129,7 +1146,8 @@ (define* (build-expression->derivation store name exp ;deprecated references-graphs allowed-references disallowed-references - local-build? (substitutable? #t)) + local-build? (substitutable? #t) + (properties '())) "Return a derivation that executes Scheme expression EXP as a builder for derivation NAME. INPUTS must be a list of (NAME DRV-PATH SUB-DRV) tuples; when SUB-DRV is omitted, \"out\" is assumed. MODULES is a list @@ -1149,7 +1167,8 @@ (define* (build-expression->derivation store name exp ;deprecated omitted or is #f, the value of the `%guile-for-build' fluid is used instead. See the `derivation' procedure for the meaning of REFERENCES-GRAPHS, -ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUILD?, and SUBSTITUTABLE?." +ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUILD?, SUBSTITUTABLE?, +and PROPERTIES." (define guile-drv (or guile-for-build (%guile-for-build))) @@ -1277,7 +1296,8 @@ (define %build-inputs #:allowed-references allowed-references #:disallowed-references disallowed-references #:local-build? local-build? - #:substitutable? substitutable?))) + #:substitutable? substitutable? + #:properties properties))) ;;; diff --git a/guix/gexp.scm b/guix/gexp.scm index f33fb198e4..786e378308 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -631,6 +631,7 @@ (define* (gexp->derivation name exp allowed-references disallowed-references leaked-env-vars local-build? (substitutable? #t) + (properties '()) ;; TODO: This parameter is transitional; it's here ;; to avoid a full rebuild. Remove it on the next @@ -800,7 +801,8 @@ (define (extension-flags extension) #:disallowed-references disallowed #:leaked-env-vars leaked-env-vars #:local-build? local-build? - #:substitutable? substitutable?)))) + #:substitutable? substitutable? + #:properties properties)))) (define* (gexp-inputs exp #:key native?) "Return the input list for EXP. When NATIVE? is true, return only native diff --git a/tests/derivations.scm b/tests/derivations.scm index 159a6971b3..5f294c1827 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -1132,6 +1132,16 @@ (define (deps path . deps) ((p2 . _) (stringderivation %store "bar" + '(mkdir %output))) + (drv2 (build-expression->derivation %store "foo" + '(mkdir %output) + #:properties '((type . test))))) + (list (derivation-properties drv1) + (derivation-properties drv2)))) + (test-equal "map-derivation" "hello" (let* ((joke (package-derivation %store guile-1.8)) diff --git a/tests/gexp.scm b/tests/gexp.scm index ab60bdab68..7ae9201c81 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -476,7 +476,15 @@ (define guile ,guile) (return (and (string=? (readlink (string-append out "/foo")) guile) (string=? (readlink out2) file) (equal? refs (list (dirname (dirname guile)))) - (equal? refs2 (list file)))))) + (equal? refs2 (list file)) + (null? (derivation-properties drv)))))) + +(test-assertm "gexp->derivation properties" + (mlet %store-monad ((drv (gexp->derivation "foo" + #~(mkdir #$output) + #:properties '((type . test))))) + (return (equal? '((type . test)) + (derivation-properties drv))))) (test-assertm "gexp->derivation vs. grafts" (mlet* %store-monad ((graft? (set-grafting #f)) -- cgit v1.2.3