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

fixing bashisms in test code #1593

Merged
merged 1 commit into from Oct 6, 2017
Merged

fixing bashisms in test code #1593

merged 1 commit into from Oct 6, 2017

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Oct 6, 2017

This fixed the build on ubuntu/debian, where dash is the sh.

This fixed the build on ubuntu/debian, where dash is the sh.
@Mic92 Mic92 mentioned this pull request Oct 6, 2017
@edolstra edolstra merged commit b2e00fd into NixOS:master Oct 6, 2017
@copumpkin
Copy link
Member

Damn Ubuntu, that dash decision they made has screwed me over so often (and not just with stuff I write 😦)

Makes me sad to see the padding go but I guess this is better than not working at all.

@Mic92 Mic92 deleted the bashism branch October 6, 2017 17:58
@Mic92
Copy link
Member Author

Mic92 commented Oct 6, 2017

I have not find an elegant way to do this with posix shell.

@copumpkin
Copy link
Member

Can we just somehow tell Make to use /bin/bash?

@Mic92
Copy link
Member Author

Mic92 commented Oct 6, 2017

then everybody needs to remember to use make SH=/bin/bash

@orivej
Copy link
Contributor

orivej commented Oct 6, 2017

Can we just somehow tell Make to use /bin/bash?

Yes, with SHELL = /bin/bash in the Makefile. But there is no /bin/bash in NixOS by default. This can be accounted for with:

SHELL := $(wildcard /bin/bash)
ifneq ($(SHELL), /bin/bash)
SHELL := /bin/sh
endif

@bjornfor
Copy link
Contributor

bjornfor commented Oct 6, 2017

Or SHELL = bash? (Does it have to be absolute path?)

@orivej
Copy link
Contributor

orivej commented Oct 6, 2017

@bjornfor That's perfect!

@bjornfor
Copy link
Contributor

bjornfor commented Oct 7, 2017

The linux kernel has this Makefile snippet, but I figure we can skip right to the $PATH lookup part :-)

CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
	  else if [ -x /bin/bash ]; then echo /bin/bash; \
	  else echo sh; fi ; fi)

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.

None yet

5 participants