Skip to content

Commit 8b88dc2

Browse files
codegen: Pass --installdir flag to cabal install (#249)
In some configurations, 'cabal install' will install the binary into the current directory instead of in the global directory on 'PATH', which can cause the haskell step to fail. Pass the --installdir flag to avoid that.
1 parent ac02b14 commit 8b88dc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dev/proto-generate.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ fi
1919

2020
echo "--- Haskell ---"
2121
command -v cabal > /dev/null 2>&1 || { echo >&2 "Haskell's 'cabal' command is not installed. Please install it first via https://www.haskell.org/ghcup/"; exit 1; }
22-
cabal install proto-lens-protoc-0.7.1.1 ghc-source-gen-0.4.3.0 --overwrite-policy=always --ghc-options='-j2 +RTS -A32m'
23-
ln -sfv `which proto-lens-protoc` "$PWD/.bin/protoc-gen-haskell"
22+
cabal install proto-lens-protoc-0.7.1.1 ghc-source-gen-0.4.3.0 --overwrite-policy=always --ghc-options='-j2 +RTS -A32m' --installdir="$PWD/.bin"
23+
# buf requires the generator to be named protoc-gen-*
24+
ln -sfv "$PWD/.bin/proto-lens-protoc" "$PWD/.bin/protoc-gen-haskell"
2425
PATH="$PWD/.bin:$PATH"
2526

2627
echo "--- buf ---"

0 commit comments

Comments
 (0)