unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#39999: make install fails on mac (Catilina, Guile-3.0.1)
@ 2020-03-09 13:29 Massimiliano Gubinelli
  2020-03-11 11:11 ` Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Massimiliano Gubinelli @ 2020-03-09 13:29 UTC (permalink / raw)
  To: 39999

Hi,
 make install on the last Guile 3.0.1 fails on my Mac (Catilina) with the following message


 ../build-aux/install-sh -c -d '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
 /usr/bin/install -c -m 644 version.h scmconfig.h '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
/Library/Developer/CommandLineTools/usr/bin/make  install-data-hook
 /usr/bin/install -c -m 644 libguile-3.0-gdb.scm				/Users/mgubi/t/guile3-usr/lib/libguile-3.0.a-gdb.scm
sed: -e: No such file or directory
make[5]: *** [install-data-hook] Error 1
make[4]: *** [install-data-am] Error 2
make[3]: *** [install-am] Error 2
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2


I found that the following change to libguile/Makefile go around the problem

INSTANTIATE = \
  $(SED) -i '' -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'                          \
            -e 's,[@]pkglibdir[@],$(pkglibdir),g'                               \
            -e 's,[@]GUILE_EFFECTIVE_VERSION[@],$(GUILE_EFFECTIVE_VERSION),g’


HTH,
Best
Massimiliano Gubinelli








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

* bug#39999: make install fails on mac (Catilina, Guile-3.0.1)
  2020-03-09 13:29 bug#39999: make install fails on mac (Catilina, Guile-3.0.1) Massimiliano Gubinelli
@ 2020-03-11 11:11 ` Ludovic Courtès
  2020-03-11 11:20   ` Massimiliano Gubinelli
  2020-04-29 18:22 ` bug#39999: MacOS Catalina with sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2020-03-11 11:11 UTC (permalink / raw)
  To: Massimiliano Gubinelli; +Cc: 39999

Hi,

Massimiliano Gubinelli <m.gubinelli@gmail.com> skribis:

>  make install on the last Guile 3.0.1 fails on my Mac (Catilina) with the following message
>
>
>  ../build-aux/install-sh -c -d '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
>  /usr/bin/install -c -m 644 version.h scmconfig.h '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
> /Library/Developer/CommandLineTools/usr/bin/make  install-data-hook
>  /usr/bin/install -c -m 644 libguile-3.0-gdb.scm				/Users/mgubi/t/guile3-usr/lib/libguile-3.0.a-gdb.scm
> sed: -e: No such file or directory
> make[5]: *** [install-data-hook] Error 1
> make[4]: *** [install-data-am] Error 2
> make[3]: *** [install-am] Error 2
> make[2]: *** [install] Error 2
> make[1]: *** [install-recursive] Error 1
> make: *** [install] Error 2

I suppose the ‘sed’ invocation in the INSTANTIATE variable in Makefile
assumes we’re using GNU sed, which is probably not the case on your
machine.

> I found that the following change to libguile/Makefile go around the problem
>
> INSTANTIATE = \
>   $(SED) -i '' -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'                          \
>             -e 's,[@]pkglibdir[@],$(pkglibdir),g'                               \
>             -e 's,[@]GUILE_EFFECTIVE_VERSION[@],$(GUILE_EFFECTIVE_VERSION),g’

What if you move ‘-i’ last, and without ''?  That should expand to
something like:

  sed -e … -e … -e … -i libguile-3.0-gdb.scm

Thanks,
Ludo’.





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

* bug#39999: make install fails on mac (Catilina, Guile-3.0.1)
  2020-03-11 11:11 ` Ludovic Courtès
@ 2020-03-11 11:20   ` Massimiliano Gubinelli
  2020-03-11 14:04     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Massimiliano Gubinelli @ 2020-03-11 11:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 39999

Hi Ludovic, 
 the problem seems to be the multiple -e together with -i. 

Example:

Horst:clean mgubi$ cat - > test
pippo
Horst:clean mgubi$ sed -i -e 's,pippo,pluto,g' -e 's,pippo,pluto,g' -e 's,pippo,pluto,g'  test
sed: -e: No such file or directory
Horst:clean mgubi$ sed  -e 's,pippo,pluto,g' -e 's,pippo,pluto,g' -e 's,pippo,pluto,g'  test
pluto
Horst:clean mgubi$ sed -i -e 's,pippo,pluto,g'  test
Horst:clean mgubi$ 

The first command give error while the other work. If I put -i at the end I get

Horst:clean mgubi$ sed  -e 's,pippo,pluto,g' -e 's,pippo,pluto,g' -e 's,pippo,pluto,g'  -i test
sed: -i may not be used with stdin

Is ok to do

Horst:clean mgubi$ sed  -e 's,pippo,pluto,g' -e 's,pippo,pluto,g' -e 's,pippo,pluto,g'  -i ‘' test


Best,
Max



> On 11. Mar 2020, at 12:11, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> Hi,
> 
> Massimiliano Gubinelli <m.gubinelli@gmail.com> skribis:
> 
>> make install on the last Guile 3.0.1 fails on my Mac (Catilina) with the following message
>> 
>> 
>> ../build-aux/install-sh -c -d '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
>> /usr/bin/install -c -m 644 version.h scmconfig.h '/Users/mgubi/t/guile3-usr/include/guile/3.0/libguile'
>> /Library/Developer/CommandLineTools/usr/bin/make  install-data-hook
>> /usr/bin/install -c -m 644 libguile-3.0-gdb.scm				/Users/mgubi/t/guile3-usr/lib/libguile-3.0.a-gdb.scm
>> sed: -e: No such file or directory
>> make[5]: *** [install-data-hook] Error 1
>> make[4]: *** [install-data-am] Error 2
>> make[3]: *** [install-am] Error 2
>> make[2]: *** [install] Error 2
>> make[1]: *** [install-recursive] Error 1
>> make: *** [install] Error 2
> 
> I suppose the ‘sed’ invocation in the INSTANTIATE variable in Makefile
> assumes we’re using GNU sed, which is probably not the case on your
> machine.
> 
>> I found that the following change to libguile/Makefile go around the problem
>> 
>> INSTANTIATE = \
>>  $(SED) -i '' -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'                          \
>>            -e 's,[@]pkglibdir[@],$(pkglibdir),g'                               \
>>            -e 's,[@]GUILE_EFFECTIVE_VERSION[@],$(GUILE_EFFECTIVE_VERSION),g’
> 
> What if you move ‘-i’ last, and without ''?  That should expand to
> something like:
> 
>  sed -e … -e … -e … -i libguile-3.0-gdb.scm
> 
> Thanks,
> Ludo’.






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

* bug#39999: make install fails on mac (Catilina, Guile-3.0.1)
  2020-03-11 11:20   ` Massimiliano Gubinelli
@ 2020-03-11 14:04     ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2020-03-11 14:04 UTC (permalink / raw)
  To: Massimiliano Gubinelli; +Cc: 39999

Hi Massimiliano,

Massimiliano Gubinelli <m.gubinelli@gmail.com> skribis:

> Is ok to do
>
> Horst:clean mgubi$ sed  -e 's,pippo,pluto,g' -e 's,pippo,pluto,g' -e 's,pippo,pluto,g'  -i ‘' test

Does it modify the file called ‘test’ in this case?

Thanks for testing!

Ludo’.





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

* bug#39999: MacOS Catalina with sed
  2020-03-09 13:29 bug#39999: make install fails on mac (Catilina, Guile-3.0.1) Massimiliano Gubinelli
  2020-03-11 11:11 ` Ludovic Courtès
@ 2020-04-29 18:22 ` W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  2020-04-29 19:30 ` bug#39999: BSD sed vs Gnu sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  2020-04-30  0:37 ` bug#39999: sed -i non-POSIX wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  3 siblings, 0 replies; 9+ messages in thread
From: W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2020-04-29 18:22 UTC (permalink / raw)
  To: 39999

MacOS uses BSD sed.  When the -i option to sed is used, it has a mandatory argument, which should be a zero length string to edit the file in-place.  
Gnu sed’s -i option uses an optional argument, rather than a mandatory argument, which if not present allows the file to be edited in-place.   Adding a zero-length string might cause problems.

Configure needs to add a zero length quote when compiling using BSD sed, and nothing when compiling using Gnu sed, or avoid the whole problem by making a backup using a prefix, in which case both use the same syntax.

wlh




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

* bug#39999: BSD sed vs Gnu sed
  2020-03-09 13:29 bug#39999: make install fails on mac (Catilina, Guile-3.0.1) Massimiliano Gubinelli
  2020-03-11 11:11 ` Ludovic Courtès
  2020-04-29 18:22 ` bug#39999: MacOS Catalina with sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
@ 2020-04-29 19:30 ` W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  2020-04-30  0:04   ` Greg Troxel
  2020-04-30  0:37 ` bug#39999: sed -i non-POSIX wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  3 siblings, 1 reply; 9+ messages in thread
From: W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2020-04-29 19:30 UTC (permalink / raw)
  To: 39999

Sorry; my explanation above is not correct.  
What I meant to say is that to edit a file in place WITHOUT CREATING a backup file, BSD sed’s -i option requires a zero-length string as a mandatory argument, while Gnu sed’s -i option does not take any argument.  If a backup file is wanted, then their option -i syntax is identical.

The INSTANTIATE macro as written is not including any argument to sed’s -i option, meaning that no backup file is wanted.  

Therefore, a very simply solution to this problem is to make a backup file, then delete it.  Both sed versions would work correctly.
A more complicated solution is to determine which version of sed is being used, and change the INSTANTIATE macro to use the correct syntax.

Gnu sed has a version option (—version), but BSD sed does not (it throws an error when either -v or —version are used).

wlh




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

* bug#39999: BSD sed vs Gnu sed
  2020-04-29 19:30 ` bug#39999: BSD sed vs Gnu sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
@ 2020-04-30  0:04   ` Greg Troxel
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Troxel @ 2020-04-30  0:04 UTC (permalink / raw)
  To: 39999

"W. Lincoln Harvey" via "Bug reports for GUILE, GNU's Ubiquitous
Extension Language" <bug-guile@gnu.org> writes:

> backup file, BSD sed’s -i option requires a zero-length string as a
> mandatory argument, while Gnu sed’s -i option does not take any
> argument.

In cases like this, it is good to read the POSIX specs.

However, you will find that -i is not specified at all.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html





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

* bug#39999: sed -i non-POSIX
  2020-03-09 13:29 bug#39999: make install fails on mac (Catilina, Guile-3.0.1) Massimiliano Gubinelli
                   ` (2 preceding siblings ...)
  2020-04-29 19:30 ` bug#39999: BSD sed vs Gnu sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
@ 2020-04-30  0:37 ` wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  2020-05-01 14:37   ` Greg Troxel
  3 siblings, 1 reply; 9+ messages in thread
From: wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2020-04-30  0:37 UTC (permalink / raw)
  To: 39999

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Greg,

Good point.  The BSD sed man page says:

"The -E, -a and -i options are non-standard FreeBSD extensions and may not be available on other operating systems."

So perhaps a better solution is to not use the -i option at all and be POSIX compliant?

Informally looking through some of the code, this was the only use of the -i option that I found.

wlh

[-- Attachment #2: Type: text/html, Size: 1949 bytes --]

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

* bug#39999: sed -i non-POSIX
  2020-04-30  0:37 ` bug#39999: sed -i non-POSIX wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language
@ 2020-05-01 14:37   ` Greg Troxel
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Troxel @ 2020-05-01 14:37 UTC (permalink / raw)
  To: 39999

wlharvey4--- via "Bug reports for GUILE, GNU's Ubiquitous Extension
Language" <bug-guile@gnu.org> writes:

> Greg,
>
> Good point.  The BSD sed man page says:
>
> "The -E, -a and -i options are non-standard FreeBSD extensions and may not be available on other operating systems."
>
> So perhaps a better solution is to not use the -i option at all and be POSIX compliant?
>
> Informally looking through some of the code, this was the only use of the -i option that I found.

If that is at all reasonable, then I think it's the best thing to do.

FWIW, the saem text about -i being a FreeBSD extension appears in the
NetBSD man page.





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

end of thread, other threads:[~2020-05-01 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 13:29 bug#39999: make install fails on mac (Catilina, Guile-3.0.1) Massimiliano Gubinelli
2020-03-11 11:11 ` Ludovic Courtès
2020-03-11 11:20   ` Massimiliano Gubinelli
2020-03-11 14:04     ` Ludovic Courtès
2020-04-29 18:22 ` bug#39999: MacOS Catalina with sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2020-04-29 19:30 ` bug#39999: BSD sed vs Gnu sed W. Lincoln Harvey via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2020-04-30  0:04   ` Greg Troxel
2020-04-30  0:37 ` bug#39999: sed -i non-POSIX wlharvey4--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2020-05-01 14:37   ` Greg Troxel

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).