Skip to content

glibc: don't assume /bin/sh is bash - #1870

Closed
ttuegel wants to merge 1 commit into
NixOS:masterfrom
ttuegel:glibc
Closed

ttuegel wants to merge 1 commit into
NixOS:masterfrom
ttuegel:glibc

Conversation

@ttuegel

@ttuegel ttuegel commented Mar 3, 2014

Copy link
Copy Markdown
Member

The expression for glibc incorrectly assumes that /bin/sh is bash. That's fine on NixOS, but when running Nix on other distributions, the scripts shipped with glibc may be broken. This is particularly bad on Debian-based systems, where /bin/sh is dash!

The solution I propose is to use /usr/bin/env bash instead. This works on NixOS, and the location of env is standardized by the LSB specification, so it should work on ~all distributions. This fixes several builds that were failing on Ubuntu because ldd was broken.

Thanks to @ktosiek for pointing out that ldd is a script and that /bin/sh is not bash on Ubuntu!

@shlevy

shlevy commented Mar 3, 2014

Copy link
Copy Markdown
Member

Once #1434 is fixed we can probably fix this properly (by pointing to $out/bin/sh which will definitely be bash).

@edolstra

edolstra commented Mar 3, 2014

Copy link
Copy Markdown
Member

/usr/bin/env doesn't exist in NixOS chroots.

@ttuegel

ttuegel commented Mar 3, 2014

Copy link
Copy Markdown
Member Author

So much for that, then :)

I'll just keep this as an local override on my Ubuntu installation until it's fixed properly.

@ttuegel ttuegel closed this Mar 3, 2014
@vcunat

vcunat commented Mar 3, 2014

Copy link
Copy Markdown
Member

I also believe it's best to solve by #1434.

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

Successfully merging this pull request may close these issues.

4 participants