-
Notifications
You must be signed in to change notification settings - Fork 81
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
splitFileName and minusFileName Variable not in scope causes builds to fail #1832
Comments
Hi @istathar, thank you for the bug report! Unfortunately, this is a known issue and we cannot really do anything about it. Specifically, it is a regression in Cabal introduced in 3.6.0 which was only recently fixed in haskell/cabal#8220 Once there is a new Cabal release, we should look into how we can support using that with existing GHC bindists. |
This is indeed an issue with cabal, that has been identified a few months ago and for which a pull request has been issued (and merged, but sadly not included in a released version yet). The only workaroud we can offer currently is to do as suggested in https://github.com/tweag/gazelle_haskell_modules#using-ghc-version-92 ie use a forked version of cabal (42f04c3f639f10dc3c7981a0c663bfe08ad833cb of github.com/tweag/cabal is cabal 3.6.3.0 with the fix of haskell/cabal#8220) and explicitly declare that every package which uses a This is definitely bad UX, we are aware of it, but as stated by Claudio, there is not much more we can do. |
I wonder why do we need cabal in the first place? |
I've hit this bug too :( mac os, bazel 5.2.0, ghc 9.2.4 |
So far it seems to be the weird mixture of artefacts from bazel, cabal, stack and even nix if you need it. I wish that it was self contained. |
Cabal is used for third-party dependencies imported from Stackage (or Hackage) via Stack and built via Cabal. You can read more about the motivation behind this approach in this blog post.
Does the workaround mentioned by @GuillaumeGen above work for you? |
I'm sorry to say but I've tried it for an hour and have failed to create working snippet for WORKSPACE. I've tried those snippets and they produce various errors. So I can not report back on that workaround as I've failed to setup the things. |
I'm sorry to hear you're struggling with this. The Gazelle repo includes a full setup, the corresponding local snapshot is here, and the If that doesn't work, could you share your
The use of Nix in rules_haskell is optional, if you don't want to use Nix, then you don't have to. You can take a look at this blog post or at this talk if you're interested in the motivation for Nix+Bazel. |
Thanks for thorough reply and guidance. I'll study it and will try again. I'll report on my progress. Thanks again for guidance and this project |
Please note that a workaround was also added to rules_haskell during the upgrade to GHC 9.2.5 - see #1869 Also, GHC 9.6.1 is shipping with Cabal 3.10.1 which includes the fix for this bug. |
Describe the bug
Autogenerated Paths_ modules are failing to compile
To Reproduce
This started happening when we tried to upgrade from a
nightly
snapshot from mid July tolts-20.1
. We know we had to downgrade to GHC 9.2.4, that doesn't appear to be a problem. We've upgraded NixPkgs, Bazel, rules_haskell, anything we can think of, but the problem keeps reoccuring. It's not just regex-base as above; it's also happening with transformers-compat, unliftio-core, ...A few months ago this problem cropped up in relation to "relocatable", #1749 (comment). The fix there (to not enable relocatable) was reverted. I've since tried that patch again, but still no luck; disabling relocatable makes the bild fail much earlier.
I tried latest version of rules_haskell from Git (no difference), tried upgrading Cabal (couldn't get that to build),
Expected behavior
Be delighted if we could keep using Bazel to build the Haskell code, but unsure what to try next. Any suggestions would be appreciated!
Environment
The text was updated successfully, but these errors were encountered: