From f86370295c5bb14d4bb93d0ccfa37a2b79f19f25 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Wed, 24 Aug 2022 19:55:14 -0400 Subject: [PATCH] Chez Scheme: patch s_process for "/bin/sh" on Guix If: 1. The nonstandard but ubiquitous macro `_PATH_BSHELL` from is defined; and 2. The path specified by `_PATH_BSHELL` exists; then `s_process` will call `execl` with the file specified by `_PATH_BSHELL` instead of "/bin/sh". Checking that the path specified by `_PATH_BSHELL` exists safeguards against obscure errors if attempting to use stand-alone executables built by the patched Racket in non-Guix envoronments. This patch does not change the behavior of `s_system`, which relies on `system` from the C library. --- racket/src/ChezScheme/c/prim5.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c index 82bbf8d687..be8f603447 100644 --- a/racket/src/ChezScheme/c/prim5.c +++ b/racket/src/ChezScheme/c/prim5.c @@ -27,6 +27,12 @@ #include #endif +/* BEGIN PATCH for Guix */ +#ifndef WIN32 +# include +#endif +/* END PATCH for Guix */ + /* locally defined functions */ static INT s_errno(void); static IBOOL s_addr_in_heap(uptr x); @@ -861,6 +867,17 @@ static ptr s_process(char *s, IBOOL stderrp) { INT tofds[2], fromfds[2], errfds[2]; struct sigaction act, oint_act; + /* BEGIN PATCH for Guix */ +#if defined(_PATH_BSHELL) + struct stat guix_stat_buf; + char *guix_sh = + (0 == stat(_PATH_BSHELL, &guix_stat_buf)) + ? _PATH_BSHELL + : "/bin/sh"; +#else /* _PATH_BSHELL */ + char *guix_sh = "/bin/sh"; +#endif + /* END PATCH for Guix */ if (pipe(tofds)) S_error("process","cannot open pipes"); if (pipe(fromfds)) { @@ -897,7 +914,9 @@ static ptr s_process(char *s, IBOOL stderrp) { } } #endif /* __GNU__ Hurd */ - execl("/bin/sh", "/bin/sh", "-c", s, NULL); + /* BEGIN PATCH for Guix */ + execl(guix_sh, guix_sh, "-c", s, NULL); + /* END PATCH for Guix */ _exit(1) /* only if execl fails */; /*NOTREACHED*/ } else { base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 -- 2.32.0 7ff6422e6b'>build/chromium-extension.scm
AgeCommit message (Expand)Author
2023-12-27chromium-extension: Compute json at argument evaluation time....* gnu/build/chromium-extension.scm (make-chromium-extension): Make use of the make-signing-key procedure inside the argument field, making sure that it is not evaluated at file-load time. This would otherwise try to resolve gnutls when we can't guarantee it's defined because of dependency cycles. Change-Id: Ia7b13acfbca475c2df073e9a88fc8bb9264dd968 Josselin Poiret
2022-07-20gnu: modifying make-chromium-extension to rely on node-crx3....* gnu/build/chromium-extension.scm (make-crx): Lift Xorg and Chromium dependencies, rely on node-crx3 instead. Signed-off-by: Marius Bakke <marius@gnu.org> Nicolas Graves
2021-12-23chromium-extension: Avoid another usage of the store-mapped /tmp....* gnu/build/chromium-extension.scm (make-crx): Use a Chromium profile relative to the build directory instead of /tmp. While here, remove obsolete comment. Marius Bakke
2021-12-16chromium-extension: Build .crx files in a deterministic fashion....* gnu/build/chromium-extension.scm (make-crx): Pass #:keep-mtime? #t to COPY-RECURSIVELY. Remove defunct FAKETIME workaround. While at it, pack the extension in the scratch working directory instead of the transient store-mapped /tmp. Marius Bakke
2021-12-16chromium-extension: Avoid usage of gcrypt at evaluation time....* gnu/build/chromium-extension.scm (make-signing-key): Wrap builder in with-extensions, and compute the seed checksum at build time. Marius Bakke
2021-12-16chromium-extension: Reduce imported-modules scope....* gnu/build/chromium-extension.scm (make-crx): Delay with-imported-modules until the builder code. (crx->chromium-json): Remove needless define* while at it. Marius Bakke
2021-12-16chromium-extension: Simplify builder code....* gnu/build/chromium-extension.scm (chromium-json->profile-object): Remove variable. (file-sha256): New variable. (make-chromium-extension): Rename OUTPUT parameter to prevent conflict. Adjust other variable names for clarity. [inputs]: Clear. [arguments]: Inline and simplify the final transformation with a gexp. Marius Bakke