Commit 5cb071af authored by Adam Sandberg Eriksson's avatar Adam Sandberg Eriksson 🐈 Committed by Ben Gamari

hadrian: use new-exec to make sure alex & happy are in PATH (#16120)

parent d0b8a16e
......@@ -31,7 +31,8 @@ if %CABMAJOR% equ 2 (
)
if %_cabal_ok% equ 1 (
"%CABAL%" --project-file=%PROJ% new-build %CABFLAGS% -j exe:hadrian
"%CABAL%" --project-file=%PROJ% new-run %CABFLAGS% exe:hadrian -- ^
rem use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
"%CABAL%" --project-file=%PROJ% new-exec %CABFLAGS% hadrian -- ^
--directory "%CD%" ^
%*
) else (
......
......@@ -24,7 +24,8 @@ CABVER=( ${CABVERSTR//./ } )
if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ];
then
"$CABAL" --project-file="$PROJ" new-build $CABFLAGS -j exe:hadrian
"$CABAL" --project-file="$PROJ" new-run $CABFLAGS exe:hadrian -- \
# use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
"$CABAL" --project-file="$PROJ" new-exec $CABFLAGS hadrian -- \
--directory "$PWD" \
"$@"
else
......
......@@ -10,6 +10,10 @@ setupEnvironment = do
-- Cabal refuses to work when GHC_PACKAGE_PATH is set (e.g. by Stack)
unsetEnv "GHC_PACKAGE_PATH"
-- cabal new-exec sets GHC_ENVIRONMENT, it needs to be unset for GHC
-- invocations to work properly
unsetEnv "GHC_ENVIRONMENT"
-- in MinGW if PWD is set to a Windows "C:\\" style path then configure
-- `pwd` will return the Windows path, and then modifying $PATH will fail.
-- See https://github.com/snowleopard/hadrian/issues/189 for details.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment