(address . guix-patches@gnu.org)
* guix/ssh.scm (remote-system): New variable.
* guix/remote.scm (remote-eval): Use result of 'remote-system' when
lowering the G-Expression.
(trampoline): Return a <program-file> rather than a <scheme-file>.
---
guix/remote.scm | 13 ++++++++-----
guix/ssh.scm | 7 +++++++
2 files changed, 15 insertions(+), 5 deletions(-)
Toggle diff (58 lines)
diff --git a/guix/remote.scm b/guix/remote.scm
index 853029c54f..d5738ebbfa 100644
--- a/guix/remote.scm
+++ b/guix/remote.scm
@@ -72,7 +72,7 @@ prerequisites of EXP are already available on the host at SESSION."
"Return a \"trampoline\" gexp that evaluates EXP and writes the evaluation
result to the current output port using the (guix repl) protocol."
(define program
- (scheme-file "remote-exp.scm" exp))
+ (program-file "remote-exp.scm" exp))
(with-imported-modules (source-module-closure '((guix repl)))
#~(begin
@@ -97,10 +97,13 @@ all the elements EXP refers to are built and deployed to SESSION beforehand.
When BUILD-LOCALLY? is true, said dependencies are built locally and sent to
the remote store afterwards; otherwise, dependencies are built directly on the
remote store."
- (mlet %store-monad ((lowered (lower-gexp (trampoline exp)
- #:module-path %load-path))
- (remote -> (connect-to-remote-daemon session
- socket-name)))
+ (mlet* %store-monad ((system -> (remote-system session))
+ (lowered (lower-gexp (trampoline exp)
+ #:system system
+ #:guile-for-build #f
+ #:module-path %load-path))
+ (remote -> (connect-to-remote-daemon session
+ socket-name)))
(define inputs
(cons (lowered-gexp-guile lowered)
(lowered-gexp-inputs lowered)))
diff --git a/guix/ssh.scm b/guix/ssh.scm
index ede00133c8..9b5ca68894 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -39,6 +39,7 @@
remote-inferior
remote-daemon-channel
connect-to-remote-daemon
+ remote-system
send-files
retrieve-files
retrieve-files*
@@ -282,6 +283,12 @@ be read. When RECURSIVE? is true, the closure of FILES is exported."
,(object->string
(object->string export))))))
+(define (remote-system session)
+ "Return the system type as expected by Nix, usually ARCHITECTURE-KERNEL, of
+the machine on the other end of SESSION."
+ (inferior-remote-eval '(begin (use-modules (guix utils)) (%current-system))
+ session))
+
(define* (send-files local files remote
#:key
recursive?
--
2.22.0
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1BmooACgkQ9Qb9Fp2P
2VptEA/+J/IgPRjvq/Cbe/wFJbMLxlyiq7ZEImt88YwBIHZHhXIttMa8SfNy7L+w
AZt6YhmcNH/NtxNzLGEt0uUT2zk4T/MObXuwMj4rYq0R8nOLtNOj316buNlLVz6K
VPFGrOVq/rzp3IIY88QpFCTsNLNHB//7WeBbMoFGevRPGfi3+G5fjPWIPAFVci4e
zQ2A8HkQ0vctOoD0KG95bMARsCSWY7n3IZ5BDhVW5X/sWse9IviQWRi1ijplqKFF
53OY5hG64wWxcuvmc5dvoq1u+uT1cOiNlSQ7Dc+7AkCc9fi4CsmT1C9u1NCYhDs1
agEYIC0R27bvocN9JZrad2kRiDLnRRDiarpsXaarsrB12xKIvgPSc4eMZX4oWQ4D
ETlbd6KTtMa1H5F+Nn8wHCfVV8LfJwdP511qGB/WAgO3Ka1RQ8b2IB2xUrYNVctN
Tvxh/c6QnmGPlftDoKLuF8xef7yUwv/X1sSsj+sdfgxl+n5xZIURwGJs5F5PB4qu
mc+K1cz+w2lRAClZnVqWNtdzTrc/9u77n6iHiO2TKsrnT6FA/uFAfQ2+nlqCuU05
Bq8ZPU/NYGjWebEZ8E5b3gbsNuMmiTE4Sd7EyPaawlCJDalSad94JZq9VO0z9Rd/
r0a+ZT/sOHme2VhOPpcuFCGjaofulG3TXBlw+yY4NMeCslNNBGE=
=hfQd
-----END PGP SIGNATURE-----