diff mbox

gnu: %static-inputs: Use bash from PATH in bootstrap tar.

Message ID 7ttwc9fy7o.fsf@gmail.com
State New
Headers show

Commit Message

Carlos Sánchez de La Lama Oct. 18, 2016, 3:55 p.m. UTC
See
<http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.

gnu/packages/make-bootstrap.scm (%static-inputs): Use bash from PATH.
---
 gnu/packages/make-bootstrap.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Ludovic Courtès Oct. 19, 2016, 3:34 p.m. UTC | #1
csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:

> See
> <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.

Could you put this URL next to the “Do not use /bin/sh” comment?

> gnu/packages/make-bootstrap.scm (%static-inputs): Use bash from PATH.

Otherwise LGTM, thanks!

Ludo’.
Efraim Flashner Oct. 19, 2016, 5:13 p.m. UTC | #2
On Wed, Oct 19, 2016 at 05:34:17PM +0200, Ludovic Courtès wrote:
> csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:
> 
> > See
> > <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
> 
> Could you put this URL next to the “Do not use /bin/sh” comment?
> 
> > gnu/packages/make-bootstrap.scm (%static-inputs): Use bash from PATH.
> 
> Otherwise LGTM, thanks!
> 
> Ludo’.
> 

Was this tested with the other bootstrap binaries? I'm still having
trouble with the aarch64 ones, didn't check if/how it affected the ones
that are already in Guix (which I assume would be not at all)
Ludovic Courtès Oct. 19, 2016, 7:48 p.m. UTC | #3
Efraim Flashner <efraim@flashner.co.il> skribis:

> On Wed, Oct 19, 2016 at 05:34:17PM +0200, Ludovic Courtès wrote:
>> csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:
>> 
>> > See
>> > <http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
>> 
>> Could you put this URL next to the “Do not use /bin/sh” comment?
>> 
>> > gnu/packages/make-bootstrap.scm (%static-inputs): Use bash from PATH.
>> 
>> Otherwise LGTM, thanks!
>> 
>> Ludo’.
>> 
>
> Was this tested with the other bootstrap binaries?

It changes execv("/bin/sh", …) to execvp("sh", …) so it looks right.

> I'm still having trouble with the aarch64 ones, didn't check if/how it
> affected the ones that are already in Guix (which I assume would be
> not at all)

What kind of problems?  After this patch?

Thanks,
Ludo’.
Efraim Flashner Oct. 19, 2016, 8 p.m. UTC | #4
On October 19, 2016 10:48:11 PM GMT+03:00, ludo@gnu.org wrote:
>Efraim Flashner <efraim@flashner.co.il> skribis:
>
>> On Wed, Oct 19, 2016 at 05:34:17PM +0200, Ludovic Courtès wrote:
>>> csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:
>>> 
>>> > See
>>> >
><http://lists.gnu.org/archive/html/guix-devel/2016-09/msg02272.html>.
>>> 
>>> Could you put this URL next to the “Do not use /bin/sh” comment?
>>> 
>>> > gnu/packages/make-bootstrap.scm (%static-inputs): Use bash from
>PATH.
>>> 
>>> Otherwise LGTM, thanks!
>>> 
>>> Ludo’.
>>> 
>>
>> Was this tested with the other bootstrap binaries?
>
>It changes execv("/bin/sh", …) to execvp("sh", …) so it looks right.
>
>> I'm still having trouble with the aarch64 ones, didn't check if/how
>it
>> affected the ones that are already in Guix (which I assume would be
>> not at all)
>
>What kind of problems?  After this patch?
>
>Thanks,
>Ludo’.

Sorry, unrelated to this patch. Nvm and carry on
diff mbox

Patch

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index def9c23..180ca72 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -186,6 +186,16 @@  for `sh' in $PATH, and without nscd, and with static NSS modules."
                 (inputs (if (%current-target-system)
                             `(("bash" ,%bash-static))
                             '()))))
+	(tar (package (inherit tar)
+	       (arguments
+		'(#:phases (modify-phases %standard-phases
+			     (add-before 'build 'set-shell-file-name
+			       (lambda _
+				 ;; Do not use "/bin/sh" to run programs.
+				 (substitute* "src/system.c"
+				   (("/bin/sh") "sh")
+				   (("execv ") "execvp "))
+				 #t)))))))
         (finalize (compose static-package
                            package-with-relocatable-glibc)))
     `(,@(map (match-lambda