You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was initially reported in #10072 (comment) but I'm not sure it's the same issue so I don't want to hijack Sebastian's ticket.
I have happy 2.0.2 globally installed (/usr/bin/happy)
For some reason Cabal puts happy 2.1.3 in the build plan and builds it
But then my globally installed happy 2.0.2 is called with the environment variable happy_lib_datadir set to /path/to/happy-lib-2.1.3/data, hence it uses the wrong HappyTemplate.hs and the generated code doesn't compile.
To Reproduce
Steps to reproduce the behavior:
In GHC's source tree:
# Preparing source files...
mkdir -p _build/stage0/src/
cp -rf ./libraries _build/stage0/src/
cp -rf ./compiler _build/stage0/src/libraries/ghc
cp -rf ./ghc _build/stage0/src/ghc-bin
cp -rf ./utils _build/stage0/src/
## Substituting variables
cp _build/stage0/src/ghc-bin/ghc-bin.cabal{.in,}
cp _build/stage0/src/libraries/ghc/ghc.cabal{.in,}
cp _build/stage0/src/libraries/ghc/GHC/CmmToLlvm/Version/Bounds.hs{.in,}
cp _build/stage0/src/libraries/ghc-boot/ghc-boot.cabal{.in,}
cp _build/stage0/src/libraries/ghc-boot-th/ghc-boot-th.cabal{.in,}
cp _build/stage0/src/libraries/ghc-heap/ghc-heap.cabal{.in,}
cp _build/stage0/src/libraries/ghci/ghci.cabal{.in,}
cp _build/stage0/src/utils/ghc-pkg/ghc-pkg.cabal{.in,}
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/ghc-bin/ghc-bin.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/ghc-bin/ghc-bin.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/libraries/ghc/ghc.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/libraries/ghc/ghc.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/libraries/ghc-boot/ghc-boot.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/libraries/ghc-boot/ghc-boot.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/libraries/ghc-boot-th/ghc-boot-th.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/libraries/ghc-boot-th/ghc-boot-th.cabal
sed -i 's/@Suffix@//' _build/stage0/src/libraries/ghc-boot-th/ghc-boot-th.cabal
sed -i 's/@SourceRoot@/./' _build/stage0/src/libraries/ghc-boot-th/ghc-boot-th.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/libraries/ghc-heap/ghc-heap.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/libraries/ghc-heap/ghc-heap.cabal
sed -i 's/@ProjectVersionForLib@/9.13/' _build/stage0/src/libraries/ghc-heap/ghc-heap.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/libraries/ghci/ghci.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/libraries/ghci/ghci.cabal
sed -i 's/@ProjectVersionForLib@/9.13/' _build/stage0/src/libraries/ghci/ghci.cabal
sed -i 's/@ProjectVersion@/9.13/' _build/stage0/src/utils/ghc-pkg/ghc-pkg.cabal
sed -i 's/@ProjectVersionMunged@/9.13/' _build/stage0/src/utils/ghc-pkg/ghc-pkg.cabal
sed -i 's/@ProjectVersionForLib@/9.13/' _build/stage0/src/utils/ghc-pkg/ghc-pkg.cabal
sed -i 's/@LlvmMinVersion@/13/' _build/stage0/src/libraries/ghc/GHC/CmmToLlvm/Version/Bounds.hs
sed -i 's/@LlvmMaxVersion@/20/' _build/stage0/src/libraries/ghc/GHC/CmmToLlvm/Version/Bounds.hs
# Building...
mkdir -p _build/stage0/cabal/
mkdir -p _build/stage0/bin/
$(CABAL) build --project-file=cabal.project-stage0 \
ghc-bin:ghc ghc-pkg:ghc-pkg genprimopcode:genprimopcode deriveConstants:deriveConstants \
-j --builddir=_build/stage0/cabal/
Describe the bug
This was initially reported in #10072 (comment) but I'm not sure it's the same issue so I don't want to hijack Sebastian's ticket.
/usr/bin/happy
)happy_lib_datadir
set to/path/to/happy-lib-2.1.3/data
, hence it uses the wrongHappyTemplate.hs
and the generated code doesn't compile.To Reproduce
Steps to reproduce the behavior:
In GHC's source tree:
Expected behavior
It should build without failing.
System information
Additional context
I've bisected and the commit introducing the issue is 8bdda9c (cc @sheaf).
The text was updated successfully, but these errors were encountered: