Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./configure works only with /bin/sh -> /bin/bash, and does not with /bin/sh -> /bin/dash #2980

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.8
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2018-09-17 22:08:47 +0000, wrote:

Void linux has "/bin/dash" symblinked to "/bin/sh" by default.

When running configure it successfully terminates:

checking for Vivante FB API... no
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
../configure: 1: ../configure: objects: not found
checking for linker option --enable-new-dtags... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sdl2-config
config.status: creating sdl2-config.cmake
config.status: creating SDL2.spec
config.status: creating sdl2.pc
config.status: creating include/SDL_config.h
config.status: include/SDL_config.h is unchanged
config.status: executing libtool commands
config.status: executing sdl2_config commands
config.status: executing summary commands
-en SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math : mmx 3dnow sse sse2 sse3
Audio drivers : disk dummy oss alsa(dynamic) pulse(dynamic)
Video drivers : dummy x11(dynamic) opengl opengl_es1 opengl_es2 vulkan wayland(dynamic)
X11 libraries : xcursor xdbe xinerama xinput2 xinput2_multitouch xrandr xscrnsaver xshape xvidmode
Input drivers : linuxev linuxkd
Using libsamplerate : YES
Using libudev : YES
Using dbus : YES
Using ime : YES
Using ibus : NO
Using fcitx : NO

(please, notice the silently ignored "objects: not found")

When I try to build it next, it fails however:

make
make: *** No rule to make target '@echo', needed by 'gen/relative-pointer-unstable-v1-client-protocol.h'. Stop.

When I switch system alternative to let /bin/sh be /bin/bash it is configured fine (without the ""objects: not found"), and builds successfully.

It took quite a few hours to figure out what's wrong. I hope, fixing it will save them for somebody else.

Thanks!

On 2018-09-18 04:02:39 +0000, Ryan C. Gordon wrote:

Can you tell me what version of dash you're using? The version in Ubuntu 16.10 appears to work with SDL's configure script (just running "mkdir buildbot ; cd buildbot ; dash ../configure" ...but /bin/sh is also symlinked to dash, fwiw).

dash --version doesn't work, but Ubuntu's apt cache tells me it's version "0.5.8-2.3ubuntu1" ... so about 0.5.8?

--ryan.

On 2018-09-18 09:22:30 +0000, wrote:

dash-0.5.10.2_1

On 2019-09-29 10:28:32 +0000, Kim Scarborough wrote:

I just got hit by this as well, and was going crazy trying to figure it out until I found this bug. Please, if this can't be fixed, at least make a note of it in the docs.

On 2019-09-29 13:46:38 +0000, Ryan C. Gordon wrote:

Just tried this on Ubuntu 19.04, and I still can't reproduce it:

$ apt-cache show dash |grep Version
Version: 0.5.10.2-4ubuntu1

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Sep 26 19:27 /bin/sh -> dash

I changed my login shell from bash to /bin/sh, regenerated the configure script, and ran configure, and I can't get this to happen.

So there's got to be something causing this, but it's not as simple as /bin/sh pointing to dash.

--ryan.

On 2020-04-08 17:16:12 +0000, Michael Orlitzky wrote:

The reason you're unable to reproduce this is because Debian purposely cripples their Dash package so that bash will always be used for ./configure scripts:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842242

Clever, right?

To work around that helpful contribution, try specifying CONFIG_SHELL=/bin/dash on the command-line when you run ./configure, e.g.

$ CONFIG_SHELL="/bin/dash" ./configure

If that doesn't work for some reason, you can always download and build your own copy of dash (it only takes a second), and then point /bin/sh to the one you've just built. The copy you build will not be crippled, and autotools will happily use it.

We have a report of this in Gentoo now too,

https://bugs.gentoo.org/714094

but with any luck it's easy to fix now that you know how to reproduce it.

On 2020-06-01 20:34:04 +0000, Matt Whitlock wrote:

Created attachment 4365
configure-posix-conformance.patch

There are actually two distinct classes of problems at play here. On the one hand, libsdl2's configure.ac has some POSIX conformance issues — namely, the use of 'echo -n' and the passage of arguments containing embedded backslashes to 'echo', neither of which is defined by POSIX. The attached patch takes care of these issues.

On 2020-06-01 20:34:12 +0000, Matt Whitlock wrote:

Created attachment 4366
dash-bug-workaround.patch

On the other hand, Dash has a confirmed bug[1] in its handling of backslash escape sequences following embedded newlines within backquoted command substitution. The attached patch works around this bug.


[1] https://www.mail-archive.com/dash@vger.kernel.org/msg01935.html

On 2020-06-01 20:41:38 +0000, Matt Whitlock wrote:

Created attachment 4367
dash-bug-workaround.patch

Apologies. The patch I submitted was based upon the application of a downstream (Gentoo) patch. Attached here is a replacement that applies cleanly to upstream libsdl 2.0.12.

On 2020-06-01 20:53:21 +0000, Michael Orlitzky wrote:

(In reply to Matt Whitlock from comment # 8)

Apologies. The patch I submitted was based upon the application of a
downstream (Gentoo) patch.

Sorry =\

I dropped that patch from app-shells/dash-0.5.10.2 (the ~arch version) for exactly this reason.

On 2020-06-01 21:10:10 +0000, Matt Whitlock wrote:

(In reply to Michael Orlitzky from comment # 9)

(In reply to Matt Whitlock from comment # 8)

Apologies. The patch I submitted was based upon the application of a
downstream (Gentoo) patch.

I dropped that patch

I was referring to libsdl2-2.0.12-static-libs.patch, which is a patch in Gentoo to make libsdl2 support building static libraries. It is unrelated to Dash.

On 2020-06-01 22:14:09 +0000, Michael Orlitzky wrote:

(In reply to Matt Whitlock from comment # 10)

I was referring to libsdl2-2.0.12-static-libs.patch, which is a patch in
Gentoo to make libsdl2 support building static libraries. It is unrelated to
Dash.

Oh, I thought you were talking about the problems resulting from dash-0.5.9.1-dumb-echo.patch. Please ignore me =)

Thanks for working on this by the way.

On 2020-06-03 19:03:17 +0000, Matt Whitlock wrote:

The Dash bug has been fixed in Dash 0.5.11. The workaround is no longer needed as of that version, although it does not hurt to keep it.

The POSIX conformance patch is still relevant.

On 2020-12-27 11:02:00 +0000, Ozkan Sezer wrote:

configure-posix-conformance.patch applied as https://hg.libsdl.org/SDL/rev/ba2e2b27a6e0
Closing as fixed.

On 2021-01-09 17:12:42 +0000, wrote:

this bug doesn't seem to be entirely fixed yet.

i applied https://hg.libsdl.org/SDL/raw-diff/ba2e2b27a6e0/configure.ac (the patch supposedly fixing this) to 2.0.14 release sources, rebuilt configure with autoreconf -i, and still get the following output when running ./configure:

./configure: 1: ./configure: objects: not found
[several times]

when running gnu make (3.82):

make: *** No rule to make target build/SDL.lo', needed by build/libSDL2.la'. Stop.

my first guess was that the sed statements used to process DEPENDS are not posix conforming (i use busybox sed), but trying with gnu sed instead made no difference.

the produced Makefile contains this part generated from the cat << EOF > Makefile part of the configure script:

Special dependency for SDL.c, since it depends on SDL_revision.h

/src/build/sdl2/SDL2-2.0.14/src/SDL.c: update-revision
/SDL.lo: /src/build/sdl2/SDL2-2.0.14/src/SDL.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $&lt; -o $@
/SDL_assert.lo: /src/build/sdl2/SDL2-2.0.14/src/SDL_assert.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $&lt; -o $@
/SDL_dataqueue.lo: /src/build/sdl2/SDL2-2.0.14/src/SDL_dataqueue.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $&lt; -o $@
[etc]

only when running SHELL=bash SH=bash bash configure the configure errors go away and Makefile contains

Special dependency for SDL.c, since it depends on SDL_revision.h

/src/build/sdl2/SDL2-2.0.14/src/SDL.c: update-revision

$(objects)/SDL.lo: /src/build/sdl2/SDL2-2.0.14/src/SDL.c $(objects)/.created
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $&lt; -o $@

$(objects)/SDL_assert.lo: /src/build/sdl2/SDL2-2.0.14/src/SDL_assert.c $(objects)/.created
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $&lt; -o $@
[etc]

with which the make process can be successfully started.
my dash version is 0.5.11.2, built from source.

On 2021-01-09 17:44:20 +0000, Ozkan Sezer wrote:

(In reply to rose.garcia-eggl2fk from comment # 14)

this bug doesn't seem to be entirely fixed yet.

Please give us a patch.

On 2021-01-09 22:54:25 +0000, wrote:

actually, i was using dash-0.5.10.2, and not as claimed 0.5.11.2. after updating dash, the problem went away (even vanilla 2.0.14 sources build).
the confusion is the result of dash not even having a --version command line switch (-v didn't work either, and the manpage doesn't mention anything displaying the version). sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant