-
Notifications
You must be signed in to change notification settings - Fork 10
ghc-lib-parser 9.12.2 fails to build with ghc-9.8.4 and ghc-lib-parser-9.10.1 fails to build with ghc-9.6.7 #595
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
Comments
Actually the issue is here. It seems related to this #581 |
I see this is actually fixed in d4e1bc6#diff-472eaebd24c7e540a4d552d3b13cab6de8eb8d327990ae09778d91f30ae430f1 . |
i'm not sure you want to close this? i can't reproduce a failure but i don't like the contents of genSym.c in that version of ghc-lib for 9.8.4 -- looks wrong. lmk! |
Well, I didn't want to clutter. The issue is that I don't have ghc-9.6.7 on my local machine to test just yet. I assumed that your commit fixed it, but if your happy with it, I'll investigate! |
@GuillaumedeVolpiano can you try installing ghc 9.6.7 using ghcup (should support installation to gentoo afaik) and test it that way? |
Indeed, I was able to reproduce the issue locally (getting the same build error when building stylish-haskell with ghc 9.6.7). |
OK, sorry for the noob question, but when running cabal run exe:ghc-lib-build-tool -- --ghc-flavor=ghc-9.12.2 in my ghc-9.8.4 sandbox, I get the following error message… config.status: creating ghcautoconf.h.autoconf ghc-lib-gen: Failed when running system command: cabal -v0 path --store-dir Same thing in my ghc-9.6.6 sandbox. ghc-9.6.7 sandbox in construction. I'm also creating an Ubuntu container to see what gives there. |
Just confirming that I hit the same issue with ghc-9.6.7/ghc-lib-parser-9.10 and ghc-9.8.4/ghc-lib-parser-9.12.2 on clean ubuntu based sandboxes. No such issue with ghc-9.8.4/ghc-lib-parser-9.10.1 |
|
i think the easiest and fastest way forward here is if i repro this myself and work out the fix. would you be able to post me instructions for that? |
what issue? the link error? |
Sorry, by sandbox I meant an incus container. Basically a virtual machine with less overhead as it shares the kernel with the host. Full build logs here Gentoo: cabal run exe:ghc-lib-build-tool -- --ghc-flavor=9.10.1 with ghc-9.6.6 https://bpa.st/B3QA Ubuntu cabal run exe:ghc-lib-build-tool -- --ghc-flavor=9.10.1 with ghc-9.6.7 https://bpa.st/2QKQ (Interestingly enough, I can't build on either side, but I don't get the same error) As for your other questions:
with ghc-9.6.7, just try the head of the main repo of stylish-haskell git clone https://github.com/haskell/stylish-haskell with ghc-9.8.4, you need my ghc9.12 branch git clone https://github.com/GuillaumedeVolpiano/stylish-haskell.git Do tell me how else I can help |
awesome. i'll put this on my stack and get back to you. out of interest, in one of your sandboxes that exhibits the ghc-lib build error, what does |
Ubuntu Interesting. I'll try to understand why we don't get the path command in Gentoo |
hmmm.
builds & test pass here |
do you need an upgrade?
|
however, i'm on darwin. good chance that i need to be on linux to make this exhibit. will let you know. |
Oh yes, on the stylish-haskell ci, tests pass on darwin |
Oh duh. On gentoo, we have the bundled version, so it's Cabal 3.10.3.0… |
FYI here's the (failing build) output of building stylish-haskell, main branch, with ghc 9.6.7, building with cabal 3.14.2.0. ~/Devel/github.com/haskell/stylish-haskell> cabal buildConfiguration is affected by the following files: - cabal.project Resolving dependencies... Build profile: -w ghc-9.6.7 -O1 In order, the following will be built (use -v for more details): - Cabal-syntax-3.14.2.0 (lib) (requires build) - optparse-applicative-0.18.1.0 (lib) (requires build) - Cabal-3.14.2.0 (lib) (requires build) - stylish-haskell-0.15.0.0 (lib) (configuration changed) - stylish-haskell-0.15.0.0 (test:stylish-haskell-tests) (configuration changed) - stylish-haskell-0.15.0.0 (exe:stylish-haskell) (first run) Starting optparse-applicative-0.18.1.0 (lib) Starting Cabal-syntax-3.14.2.0 (lib) Building optparse-applicative-0.18.1.0 (lib) Building Cabal-syntax-3.14.2.0 (lib) Installing optparse-applicative-0.18.1.0 (lib) Completed optparse-applicative-0.18.1.0 (lib) Installing Cabal-syntax-3.14.2.0 (lib) Completed Cabal-syntax-3.14.2.0 (lib) Starting Cabal-3.14.2.0 (lib) Building Cabal-3.14.2.0 (lib) Installing Cabal-3.14.2.0 (lib) Completed Cabal-3.14.2.0 (lib) Configuring library for stylish-haskell-0.15.0.0... Preprocessing library for stylish-haskell-0.15.0.0... Building library for stylish-haskell-0.15.0.0... [23 of 26] Compiling Language.Haskell.Stylish.Config.Cabal ( lib/Language/Haskell/Stylish/Config/Cabal.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish/Config/Cabal.o, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish/Config/Cabal.dyn_o ) [Source file changed] [24 of 26] Compiling Language.Haskell.Stylish.Config ( lib/Language/Haskell/Stylish/Config.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish/Config.o, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish/Config.dyn_o ) [Language.Haskell.Stylish.Config.Cabal changed] [25 of 26] Compiling Paths_stylish_haskell ( dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/autogen/Paths_stylish_haskell.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Paths_stylish_haskell.o, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Paths_stylish_haskell.dyn_o ) [dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/autogen/cabal_macros.h changed] [26 of 26] Compiling Language.Haskell.Stylish ( lib/Language/Haskell/Stylish.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish.o, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/build/Language/Haskell/Stylish.dyn_o ) [Language.Haskell.Stylish.Config changed] Configuring test suite 'stylish-haskell-tests' for stylish-haskell-0.15.0.0... Configuring executable 'stylish-haskell' for stylish-haskell-0.15.0.0... Preprocessing test suite 'stylish-haskell-tests' for stylish-haskell-0.15.0.0... Building test suite 'stylish-haskell-tests' for stylish-haskell-0.15.0.0... Preprocessing executable 'stylish-haskell' for stylish-haskell-0.15.0.0... Building executable 'stylish-haskell' for stylish-haskell-0.15.0.0... [1 of 1] Compiling Main ( src/Main.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/x/stylish-haskell/build/stylish-haskell/stylish-haskell-tmp/Main.o ) [ 3 of 16] Compiling Language.Haskell.Stylish.Tests ( tests/Language/Haskell/Stylish/Tests.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/t/stylish-haskell-tests/build/stylish-haskell-tests/stylish-haskell-tests-tmp/Language/Haskell/Stylish/Tests.o ) [Language.Haskell.Stylish changed] [15 of 16] Compiling Language.Haskell.Stylish.Config.Tests ( tests/Language/Haskell/Stylish/Config/Tests.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/t/stylish-haskell-tests/build/stylish-haskell-tests/stylish-haskell-tests-tmp/Language/Haskell/Stylish/Config/Tests.o ) [Language.Haskell.Stylish.Config changed] [2 of 2] Linking dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/x/stylish-haskell/build/stylish-haskell/stylish-haskell [16 of 16] Compiling Main ( tests/TestSuite.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/t/stylish-haskell-tests/build/stylish-haskell-tests/stylish-haskell-tests-tmp/Main.o ) [Language.Haskell.Stylish.Config.Tests changed] [17 of 17] Linking dist-newstyle/build/x86_64-linux/ghc-9.6.7/stylish-haskell-0.15.0.0/t/stylish-haskell-tests/build/stylish-haskell-tests/stylish-haskell-tests /usr/bin/ld.gold: error: /home/jhrcek/.ghcup/ghc/9.6.7/lib/ghc-9.6.7/lib/../lib/x86_64-linux-ghc-9.6.7/rts-1.0.2/libHSrts-1.0.2.a(Globals.o): multiple definition of 'ghc_unique_counter64' /usr/bin/ld.gold: /home/jhrcek/.cabal/store/ghc-9.6.7/ghc-lib-parser-9.10.1.20250103-6822c1bb167729f4c6ea71be204d04266e852a68038c599260f1664e7c2cb181/lib/libHSghc-lib-parser-9.10.1.20250103-6822c1bb167729f4c6ea71be204d04266e852a68038c599260f1664e7c2cb181.a(genSym.o): previous definition here /usr/bin/ld.gold: error: /home/jhrcek/.ghcup/ghc/9.6.7/lib/ghc-9.6.7/lib/../lib/x86_64-linux-ghc-9.6.7/rts-1.0.2/libHSrts-1.0.2.a(Globals.o): multiple definition of 'ghc_unique_counter64' /usr/bin/ld.gold: /home/jhrcek/.cabal/store/ghc-9.6.7/ghc-lib-parser-9.10.1.20250103-6822c1bb167729f4c6ea71be204d04266e852a68038c599260f1664e7c2cb181/lib/libHSghc-lib-parser-9.10.1.20250103-6822c1bb167729f4c6ea71be204d04266e852a68038c599260f1664e7c2cb181.a(genSym.o): previous definition here collect2: error: ld returned 1 exit status ghc-9.6.7: `gcc' failed in phase `Linker'. (Exit code: 1) collect2: error: ld returned 1 exit status ghc-9.6.7: `gcc' failed in phase `Linker'. (Exit code: 1) Error: [Cabal-7125] Failed to build exe:stylish-haskell from stylish-haskell-0.15.0.0. Failed to build test:stylish-haskell-tests from stylish-haskell-0.15.0.0. |
For ghc-9.8.4/ghc-lib-parser-9.12.2, my two cents at the moment is that line 966 of Ghclibgen.hs need to be updated from when (ghcFlavor <= Ghc9121) $ to when (ghcFlavor <= Ghc9122) $ Still hitting snags building ghc-lib-parsers, so can't test. |
FWIW, on Gentoo with ghc-9.10 (and thus Cabal 3.12), I get the same kind of ambiguous module name issue as on Ubuntu, albeit on a different module. |
my read of that is there are two versions of unix with different hashes installed at cabal path --store. delete the contents of that dir and it might come good. don't get hung up though. i can get back to you with a fix if you can wait a few days |
Indeed, it worked. |
Just to confirm that |
exactly. create a branch, try this hack in Ghclibgen.hs
check it in (to prevent the build system from checking it out and overwriting your changes). it will probably fix the problem. if not, after the build ( |
there has been so much churn in genSym.c regarding this. i think the condition for that definition has changed multiple times over the course of the last year or so invalidating released (ghc-lib-parser) packages. hopefully when we fix this, it is behind us for good. |
And we're good |
No pressure, but once we get this fixed, do you mind making a release so that we can get stylish-haskell go forward and then hls-stylish-haskell-plugin? ;) |
we'll do that. |
assuming we land #596 what flavors do we need new releases for? ghc-9.10.1, ghc-9.12.2? |
Both if you don't mind |
Question: with ghc-9.10.2-rc1 being released today and the final release scheduled for week after next, do we want to wait for it to make the release? |
i would say it's not a big deal to push packages so we'll just do what we can when we can. i think the likely order will be, the fix is landed we push new packages for 9.10.1, 9.12.2, put up a diff for 9.10.2 support and push 9.10.2 after landing that. |
All right ! |
packages tagged 20250421 pushed |
Thanks |
Probably related to this https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10568
(patch here https://gitlab.haskell.org/ghc/ghc/-/commit/e421ec3c8fc9688b3f7ee08c0d1baaf1cb7aa750)
Linking /root/github/stylish-haskell/dist-newstyle/build/x86_64-linux/ghc-9.8.4/stylish-haskell-0.14.6.0/t/stylish-haskell-tests/build/stylish-haskell-tests/stylish-haskell-tests /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-9.8.4/lib/../lib/x86_64-linux-ghc-9.8.4/rts-1.0.2/libHSrts-1.0.2.a(Globals.o):(.bss+0x0): multiple definition of
ghc_unique_counter64'; /root/.local/state/cabal/store/ghc-9.8.4/ghc-lib-parser-9.12.2.20250320-48b5863d60855e9cdc5daef7f57fb49458d3bd0c527dd8950e22b0a76fe73a30/lib/libHSghc-lib-parser-9.12.2.20250320-48b5863d60855e9cdc5daef7f57fb49458d3bd0c527dd8950e22b0a76fe73a30.a(genSym.o):(.bss+0x0): first defined here`The text was updated successfully, but these errors were encountered: