Skip to content
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

lld: error: unknown argument: -r #8780

Closed
kkurkiewicz opened this issue Feb 18, 2023 · 5 comments
Closed

lld: error: unknown argument: -r #8780

kkurkiewicz opened this issue Feb 18, 2023 · 5 comments

Comments

@kkurkiewicz
Copy link

kkurkiewicz commented Feb 18, 2023

Describe the bug
I'm not sure if this really is a bug, but, trying to upgrade my project from GHC 8.6.5 to 9.4.4, every time I run cabal install -w ghc-9.4.4 --dependencies-only, the command proceeds to build the first library from my build-depends list and does build it (seemingly without any errors), but then simply displays the linking error and throws ExitFailure 1.

To Reproduce

>cabal install -w "C:\Program Files\Haskell\ghc-9.4.4\bin\ghc.exe" --dependencies-only
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
Notice: installing into a sandbox located at
C:\Users\kkurkiewicz\Desktop\hlink\.cabal-sandbox
Starting     ghc-lib-parser-9.4.4.20221225
Building     ghc-lib-parser-9.4.4.20221225
Failed to install ghc-lib-parser-9.4.4.20221225
Build log ( C:\Users\kkurkiewicz\Desktop\hlink\.cabal-sandbox\logs\ghc-9.4.4\ghc-lib-parser-9.4.4.20221225-GuIVgCTKKGN8C570UhV3aW.log ):
Preprocessing library for ghc-lib-parser-9.4.4.20221225..
Building library for ghc-lib-parser-9.4.4.20221225..
[  1 of 380] Compiling GHC.BaseDir      ( libraries\ghc-boot\GHC\BaseDir.hs, dist\dist-sandbox-14a89ea1\build\GHC\BaseDir.o )
[  2 of 380] Compiling GHC.Data.SizedSeq ( libraries\ghc-boot\GHC\Data\SizedSeq.hs, dist\dist-sandbox-14a89ea1\build\GHC\Data\SizedSeq.o )
...
[380 of 380] Compiling GHC.Driver.Config ( compiler\GHC\Driver\Config.hs, dist\dist-sandbox-14a89ea1\build\GHC\Driver\Config.o )
lld: error: unknown argument: -r
cabal: Leaving directory 'C:\Users\KKURKI~1\AppData\Local\Temp\cabal-tmp-5000\ghc-lib-parser-9.4.4.20221225'
cabal: Error: some packages failed to install:
ghc-lib-parser-9.4.4.20221225-GuIVgCTKKGN8C570UhV3aW failed during the
building phase. The exception was:
ExitFailure 1

System information

  • Operating system
>systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
OS Name:                   Microsoft Windows 10 Education
OS Version:                10.0.19045 N/A Build 19045
  • cabal, ghc versions
cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library

>ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5

Additional context

  • The newer version of the compiler is not on my PATH. (I have it specified in cabal.project, but Cabal seems to ignore it.)
  • The name of the library doesn't matter – you could replace ghc-lib-parser with any library you want, but the outcome will be the same.
  • I only use the legacy commands.
@ulysses4ever
Copy link
Collaborator

Thank you for the report. First step in inspecting this would be to upgrade your cabal to something reasonable (e.g version 3.8). 2.4 is ancient.

@ulysses4ever
Copy link
Collaborator

Actually, GHC 9.4 on Windows requires cabal 3.8 or later

@kkurkiewicz
Copy link
Author

Oh, sorry. I didn't know that. I'll upgrade to 3.8 and let you know later.

@kkurkiewicz
Copy link
Author

@ulysses4ever, upgrading Cabal to 3.8 helped. Thank you and sorry for the spam :D

@ulysses4ever
Copy link
Collaborator

@kkurkiewicz Not all! This particular restriction on cabal from GHC 9.4 on Windows is rather annoying, and I tend to forget about it myself once in a while.

Happy hacking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants