* [PATCH] configure: resolve real path to bash
@ 2019-01-18 14:43 Đoàn Trần Công Danh
2019-01-30 19:41 ` David Bremner
0 siblings, 1 reply; 8+ messages in thread
From: Đoàn Trần Công Danh @ 2019-01-18 14:43 UTC (permalink / raw)
To: notmuch; +Cc: Đoàn Trần Công Danh
The old code somehow resolves to `bin/sh' on Arch Linux/Void Linux
auto build systems.
cf:
https://travis-ci.org/void-linux/void-packages/jobs/470139880#L1691
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
configure | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure b/configure
index b2200be0..84a74b17 100755
--- a/configure
+++ b/configure
@@ -563,6 +563,7 @@ printf "Checking for bash... "
if command -v ${BASH} > /dev/null; then
have_bash=1
bash_absolute=$(command -v ${BASH})
+ bash_absolute=$(readlink -f "$bash_absolute")
printf "Yes (%s).\n" "$bash_absolute"
else
have_bash=0
--
2.20.1.352.g40155ab247
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-18 14:43 [PATCH] configure: resolve real path to bash Đoàn Trần Công Danh
@ 2019-01-30 19:41 ` David Bremner
2019-01-30 19:46 ` Tomi Ollila
2019-01-30 21:06 ` Danh Doan
0 siblings, 2 replies; 8+ messages in thread
From: David Bremner @ 2019-01-30 19:41 UTC (permalink / raw)
To: Đoàn Trần Công Danh, notmuch
Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
> The old code somehow resolves to `bin/sh' on Arch Linux/Void Linux
> auto build systems.
>
I'm not sure if this is better or worse than
https://nmbug.notmuchmail.org/nmweb/show/20190117021132.28327-1-david%40tethera.net
I welcome input on this.
One issue is that readlink(1) is not in POSIX, so we can expect some
portability pains.
d
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-30 19:41 ` David Bremner
@ 2019-01-30 19:46 ` Tomi Ollila
2019-01-30 21:06 ` Danh Doan
1 sibling, 0 replies; 8+ messages in thread
From: Tomi Ollila @ 2019-01-30 19:46 UTC (permalink / raw)
To: David Bremner, Đoàn Trần Công Danh, notmuch
On Wed, Jan 30 2019, David Bremner wrote:
> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>
>> The old code somehow resolves to `bin/sh' on Arch Linux/Void Linux
>> auto build systems.
>>
>
> I'm not sure if this is better or worse than
>
> https://nmbug.notmuchmail.org/nmweb/show/20190117021132.28327-1-david%40tethera.net
>
> I welcome input on this.
I'd choose your version. readlink(1) smells somewhat unportable (namual
page does mention anything else than it is part of gnu coreutils...
Tomi
>
> One issue is that readlink(1) is not in POSIX, so we can expect some
> portability pains.
>
> d
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-30 19:41 ` David Bremner
2019-01-30 19:46 ` Tomi Ollila
@ 2019-01-30 21:06 ` Danh Doan
2019-01-30 21:30 ` David Bremner
1 sibling, 1 reply; 8+ messages in thread
From: Danh Doan @ 2019-01-30 21:06 UTC (permalink / raw)
To: David Bremner, notmuch
David Bremner <david@tethera.net> writes:
> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>
>> The old code somehow resolves to `bin/sh' on Arch Linux/Void Linux
>> auto build systems.
>>
>
> I'm not sure if this is better or worse than
>
> https://nmbug.notmuchmail.org/nmweb/show/20190117021132.28327-1-david%40tethera.net
Sorry for the noise, I somehow couldn't find your patch at that time.
And I only recognized readlink(1) is not POSIX after sending the patch.
I wonder if it's better to keep `/usr/bin/env bash` instead of resolving
bash to specific file. Something like this:
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 04913a06..2252e818 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -117,7 +117,6 @@ endif
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
mkdir -p "$(DESTDIR)$(prefix)/bin/"
ifeq ($(HAVE_BASH),1)
- sed "1s|^#!.*|#! $(BASH_ABSOLUTE)|" < $(emacs_mua) > $(DESTDIR)$(prefix)/bin/notmuch-emacs-mua
chmod 755 $(DESTDIR)$(prefix)/bin/notmuch-emacs-mua
endif
ifeq ($(WITH_DESKTOP),1)
>
> I welcome input on this.
>
> One issue is that readlink(1) is not in POSIX, so we can expect some
> portability pains.
>
> d
--
Danh
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-30 21:06 ` Danh Doan
@ 2019-01-30 21:30 ` David Bremner
2019-01-31 0:08 ` Danh Doan
0 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2019-01-30 21:30 UTC (permalink / raw)
To: Danh Doan, notmuch
Danh Doan <congdanhqx@gmail.com> writes:
> David Bremner <david@tethera.net> writes:
>
>> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>>
>>> The old code somehow resolves to `bin/sh' on Arch Linux/Void Linux
>>> auto build systems.
>>>
>>
>> I'm not sure if this is better or worse than
>>
>> https://nmbug.notmuchmail.org/nmweb/show/20190117021132.28327-1-david%40tethera.net
>
> Sorry for the noise, I somehow couldn't find your patch at that time.
> And I only recognized readlink(1) is not POSIX after sending the patch.
>
> I wonder if it's better to keep `/usr/bin/env bash` instead of resolving
> bash to specific file. Something like this:
>
This will require Debian (and I think Fedora) to do the resolution
themselves, because they don't support "#! /usr/bin/env interpreter"
Of course the distro specific patches are slightly less complicated,
since they can hard code the location of bash.
d
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-30 21:30 ` David Bremner
@ 2019-01-31 0:08 ` Danh Doan
2019-01-31 1:34 ` David Bremner
0 siblings, 1 reply; 8+ messages in thread
From: Danh Doan @ 2019-01-31 0:08 UTC (permalink / raw)
To: David Bremner, notmuch
David Bremner <david@tethera.net> writes:
> Danh Doan <congdanhqx@gmail.com> writes:
>
>>
>> I wonder if it's better to keep `/usr/bin/env bash` instead of resolving
>> bash to specific file. Something like this:
>>
>
> This will require Debian (and I think Fedora) to do the resolution
> themselves, because they don't support "#! /usr/bin/env interpreter"
> Of course the distro specific patches are slightly less complicated,
> since they can hard code the location of bash.
I have nothing against your approach,
but I still slightly prefer to be able to run `configure` script without
setting environment variable.
Is it acceptable to emulate `realpath` in `configure` script?
If yes, we could borrow this script (MIT licensed).
https://github.com/chriskempson/base16-shell/blob/master/realpath/realpath.sh
--
Danh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-31 0:08 ` Danh Doan
@ 2019-01-31 1:34 ` David Bremner
2019-01-31 17:46 ` Danh Doan
0 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2019-01-31 1:34 UTC (permalink / raw)
To: Danh Doan, notmuch
Danh Doan <congdanhqx@gmail.com> writes:
> David Bremner <david@tethera.net> writes:
>
>> Danh Doan <congdanhqx@gmail.com> writes:
>>
>>>
>>> I wonder if it's better to keep `/usr/bin/env bash` instead of resolving
>>> bash to specific file. Something like this:
>>>
>>
>> This will require Debian (and I think Fedora) to do the resolution
>> themselves, because they don't support "#! /usr/bin/env interpreter"
>> Of course the distro specific patches are slightly less complicated,
>> since they can hard code the location of bash.
>
> I have nothing against your approach,
> but I still slightly prefer to be able to run `configure` script without
> setting environment variable.
>
Have you verified that you need to set an evironment variable? If there
is only one bash in $PATH, command -v should work fine. The previous bug
was using the variable BASH, which bash itself sets to /bin/sh (which I
find odd, but nobody asked me). I only have the environment variable
setting in the Debian packaging to work around a (since resolved)
misconfiguration [1] of the debian autobuilders.
> Is it acceptable to emulate `realpath` in `configure` script?
> If yes, we could borrow this script (MIT licensed).
>
> https://github.com/chriskempson/base16-shell/blob/master/realpath/realpath.sh
>
It starts to seem a bit overcomplicated at that point.
[1]: The autobuilders had /bin as a link to /usr/bin, but the resulting
binary packages were installed on systems without that link. Hilarity
ensued.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] configure: resolve real path to bash
2019-01-31 1:34 ` David Bremner
@ 2019-01-31 17:46 ` Danh Doan
0 siblings, 0 replies; 8+ messages in thread
From: Danh Doan @ 2019-01-31 17:46 UTC (permalink / raw)
To: David Bremner, notmuch
David Bremner <david@tethera.net> writes:
> Have you verified that you need to set an evironment variable? If there
> is only one bash in $PATH, command -v should work fine. The previous bug
> was using the variable BASH, which bash itself sets to /bin/sh (which I
> find odd, but nobody asked me).
I hadn't tested at that time since I had taken a quick skim over your
second patch.
I've just tested your patch, I confirm your patch is good with Void XBPS
autobuild system.
--
Danh
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-01-31 17:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-18 14:43 [PATCH] configure: resolve real path to bash Đoàn Trần Công Danh
2019-01-30 19:41 ` David Bremner
2019-01-30 19:46 ` Tomi Ollila
2019-01-30 21:06 ` Danh Doan
2019-01-30 21:30 ` David Bremner
2019-01-31 0:08 ` Danh Doan
2019-01-31 1:34 ` David Bremner
2019-01-31 17:46 ` Danh Doan
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.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).