unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling
@ 2016-10-18 16:07 Carlos Sánchez de La Lama
  2016-10-19 15:33 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Sánchez de La Lama @ 2016-10-18 16:07 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly
when cross compiling.
---
 gnu/packages/bash.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index f3d8517..b07367c 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -247,7 +247,8 @@ without modification.")
                  "--disable-nls"
 
                  ,@(if (%current-target-system)
-                       '("bash_cv_job_control_missing=no")
+                       '("bash_cv_job_control_missing=no"
+			 "bash_cv_getcwd_malloc=yes")
                        '()))))))))
 
 (define-public static-bash
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling
  2016-10-18 16:07 [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling Carlos Sánchez de La Lama
@ 2016-10-19 15:33 ` Ludovic Courtès
  2016-10-19 19:54   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-10-19 15:33 UTC (permalink / raw)
  To: Carlos Sánchez de La Lama; +Cc: guix-devel

csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:

> * gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly
> when cross compiling.
> ---
>  gnu/packages/bash.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
> index f3d8517..b07367c 100644
> --- a/gnu/packages/bash.scm
> +++ b/gnu/packages/bash.scm
> @@ -247,7 +247,8 @@ without modification.")
>                   "--disable-nls"
>  
>                   ,@(if (%current-target-system)
> -                       '("bash_cv_job_control_missing=no")
> +                       '("bash_cv_job_control_missing=no"
> +			 "bash_cv_getcwd_malloc=yes")

No tabs please.  Otherwise LGTM, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling
  2016-10-19 15:33 ` Ludovic Courtès
@ 2016-10-19 19:54   ` Ludovic Courtès
  2016-10-19 20:54     ` Carlos Sánchez de La Lama
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-10-19 19:54 UTC (permalink / raw)
  To: Carlos Sánchez de La Lama; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

> csanchezdll@gmail.com (Carlos Sánchez de La Lama) skribis:
>
>> * gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly
>> when cross compiling.
>> ---
>>  gnu/packages/bash.scm | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
>> index f3d8517..b07367c 100644
>> --- a/gnu/packages/bash.scm
>> +++ b/gnu/packages/bash.scm
>> @@ -247,7 +247,8 @@ without modification.")
>>                   "--disable-nls"
>>  
>>                   ,@(if (%current-target-system)
>> -                       '("bash_cv_job_control_missing=no")
>> +                       '("bash_cv_job_control_missing=no"
>> +			 "bash_cv_getcwd_malloc=yes")
>
> No tabs please.  Otherwise LGTM, thanks!

I spoke too fast.  On master (Bash 4.3), this is unnecessary AFAICS:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build bash-minimal --target=mips64el-linux-gnu --no-grafts --no-build-hook
/gnu/store/1v6l54xzmzb19hdg5bizvzfz995lh1cp-bash-minimal-4.3.42-doc
/gnu/store/gawbc9mj2i37ycym06rbybi1k4kn8zfq-bash-minimal-4.3.42-include
/gnu/store/vic4zf9gpdzrcvj8kimb9cs3049ld60d-bash-minimal-4.3.42
$ git describe
v0.11.0-1743-gfe9bdb5
--8<---------------cut here---------------end--------------->8---

Is this addressing a problem you had with Bash 4.4 (on core-updates)?

TIA,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling
  2016-10-19 19:54   ` Ludovic Courtès
@ 2016-10-19 20:54     ` Carlos Sánchez de La Lama
  2016-10-20 12:55       ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Sánchez de La Lama @ 2016-10-19 20:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi Ludo,

>>> * gnu/packages/bash.scm (bash-minimal): Assume getcwd works correctly
>>> when cross compiling.
>> No tabs please.  Otherwise LGTM, thanks!
> I spoke too fast.  On master (Bash 4.3), this is unnecessary AFAICS:
> 
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix build bash-minimal --target=mips64el-linux-gnu --no-grafts --no-build-hook
> /gnu/store/1v6l54xzmzb19hdg5bizvzfz995lh1cp-bash-minimal-4.3.42-doc
> /gnu/store/gawbc9mj2i37ycym06rbybi1k4kn8zfq-bash-minimal-4.3.42-include
> /gnu/store/vic4zf9gpdzrcvj8kimb9cs3049ld60d-bash-minimal-4.3.42
> $ git describe
> v0.11.0-1743-gfe9bdb5
> --8<---------------cut here---------------end--------------->8---

Building bash was never a problem, it worked also for me without the patch. The problem is that, when cross-compiling, bash "configure" scrip cannot test whether system getcwd works properly or not, and thus decides to use its own version of it, which does not correctly work inside bind mounts (and therefore fails in the chroot, but works outside it).

Thus, unpatched bash will fail when used to build another derivation. The problem was first reported here:

https://lists.gnu.org/archive/html/guix-devel/2013-10/msg00063.html

Although in that case Mark worked it around by having /tmp in a different partition, which incidentally causes bash-provided getcwd to work correctly.

Maybe I can put a more detailed explanation on bash.scm; I packed the patch in a hurry in case Efraim needed it for its bootstrapping also.

My changes make bash "configure" assume the system getcwd works correctly (which in our case we know it does as dependencies are controlled).

> Is this addressing a problem you had with Bash 4.4 (on core-updates)?

No, it happens with bash-4.3 in master (and probably with most other recent versions as well).

Thanks!

Carlos

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling
  2016-10-19 20:54     ` Carlos Sánchez de La Lama
@ 2016-10-20 12:55       ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-10-20 12:55 UTC (permalink / raw)
  To: Carlos Sánchez de La Lama; +Cc: guix-devel

Hi Carlos,

Carlos Sánchez de La Lama <csanchezdll@gmail.com> skribis:

>>>> * gnu/packages/bash.scm (bash-minimal): Assume getcwd works
>>>> correctly when cross compiling.
>>> No tabs please.  Otherwise LGTM, thanks!  I spoke too fast.  On
>> master (Bash 4.3), this is unnecessary AFAICS:
>> 
>> --8<---------------cut here---------------start------------->8--- $
>> ./pre-inst-env guix build bash-minimal --target=mips64el-linux-gnu
>> --no-grafts --no-build-hook
>> /gnu/store/1v6l54xzmzb19hdg5bizvzfz995lh1cp-bash-minimal-4.3.42-doc
>> /gnu/store/gawbc9mj2i37ycym06rbybi1k4kn8zfq-bash-minimal-4.3.42-include
>> /gnu/store/vic4zf9gpdzrcvj8kimb9cs3049ld60d-bash-minimal-4.3.42 $
>> git describe v0.11.0-1743-gfe9bdb5 --8<---------------cut
>> here---------------end--------------->8---
>
> Building bash was never a problem, it worked also for me without the
> patch. The problem is that, when cross-compiling, bash "configure"
> scrip cannot test whether system getcwd works properly or not, and
> thus decides to use its own version of it, which does not correctly
> work inside bind mounts (and therefore fails in the chroot, but works
> outside it).
>
> Thus, unpatched bash will fail when used to build another
> derivation. The problem was first reported here:
>
> https://lists.gnu.org/archive/html/guix-devel/2013-10/msg00063.html

OK, I see.

> Although in that case Mark worked it around by having /tmp in a
> different partition, which incidentally causes bash-provided getcwd to
> work correctly.
>
> Maybe I can put a more detailed explanation on bash.scm; I packed the
> patch in a hurry in case Efraim needed it for its bootstrapping also.

A detailed explanation in bash.scm would be awesome.  :-)
Could you do that?

I reread the thread and it’s not clear to me what the conclusion is.  I
don’t clearly see how Bash’s ‘getcwd’ could be wrong.  Most likely this
has to do with “..” lookup in the presence of bind mounts and
assumptions that Bash’s ‘getcwd’ makes on st_ino and st_dev values.  Oh
well, it’s probably enough to know that that ‘getcwd’ is buggy.  ;-)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-20 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 16:07 [PATCH] gnu: bash-minimal: Assume getcwd works correctly when cross-compiling Carlos Sánchez de La Lama
2016-10-19 15:33 ` Ludovic Courtès
2016-10-19 19:54   ` Ludovic Courtès
2016-10-19 20:54     ` Carlos Sánchez de La Lama
2016-10-20 12:55       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).