Skip to content

Commit

Permalink
Makefile to force a shell when running command
Browse files Browse the repository at this point in the history
Address a build break on Ubuntu 20.04 in the Makefile whereby calling `command` fails

Signed-off-by: Andy Edwards <[email protected]>
  • Loading branch information
andyedwardsibm authored Jun 9, 2023
1 parent 6db512d commit 71cae31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
###

# Default shell `/bin/sh` has different meanings depending on the platform.
SHELL := $(shell command -v bash)
SHELL := $(shell command -v bash;)
GO ?= go
GO_LDFLAGS:= $(shell if $(GO) version|grep -q gccgo ; then echo "-gccgoflags"; else echo "-ldflags"; fi)
GOCMD = CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO)
Expand Down

2 comments on commit 71cae31

@sanmai-NL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though Bash is somewhat more standardized than sh, how about running Bash with --posix then, to avoid Bashisms creeping in? See: https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html

@rhatdan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, interested in opening a PR?

Please sign in to comment.