-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
GHC fails on Ubuntu 24.04 LTS because it is trying to run gcc-11 #182739
GHC fails on Ubuntu 24.04 LTS because it is trying to run gcc-11 #182739
Comments
Does doing |
It does, but But I'm questioning whether $ cat /home/linuxbrew/.linuxbrew/Cellar/ghc/9.10.1/lib/ghc-9.10.1/lib/settings
[("C compiler command", "gcc-11")
,("C compiler flags", "")
,("C++ compiler command", "g++-11")
,("C++ compiler flags", "")
...
] I am bringing this up, because the Homebrew documentation recommends installing build tools on sudo apt-get install build-essential procps curl file git Same goes for Fedora, CentOS, or Red Hat and Arch Linux, so most likely |
Yes, probably. My question was just to check that you had a quick workaround for now. A proper fix may take a bit, but PRs are welcome. |
Probably better to avoid hardcoding a particular C compiler at all. Might help to modify this line homebrew-core/Formula/g/ghc.rb Line 104 in 43360f8
to point to just |
Fixed in #183926. Do |
That indeed fixed the issue. There are a few questions remaining however. C++ compiler commandIn my previous message I have mentioned the $ cat /home/linuxbrew/.linuxbrew/Cellar/ghc/9.10.1/lib/ghc-9.10.1/lib/settings
[("C compiler command", "cc")
,("C compiler flags", "")
,("C++ compiler command", "g++-11")
,("C++ compiler flags", "")
...
] As you can see the ENV["CXX"] = ENV["ac_cv_path_CXX"] = OS.linux? ? "c++" : ENV.cxx Other versionsThen there would be the question on what to do about the other versions of GHC. There are in total five other versions, three of those are not deprecated or disabled. Maybe it could make sense to apply the same fix to those versions as well?
|
I wonder if, instead of setting
at install-time? This way we can use This way we try to ensure we're using a compiler compatible with the one that |
I'm not sure if that is a good idea. I have taken some time to think about it and came up with two concerns. PermissionsFor one the permissions of the file are set to read-only: $ ls -l settings
-r--r--r--. 1 notfirefox notfirefox 1687 May 10 07:18 settings Possible breakageBesides that there is also the possibility that this could break in certain scenarios. Consider the following: An user installs |
I found a use case for Haskell FFI with C++ example
#include <iostream>
extern "C" {
void cppFunction() { std::cout << "Hello from C++!" << std::endl; }
}
{-# LANGUAGE ForeignFunctionInterface #-}
module Main where
import Foreign
import Foreign.C.Types
foreign import ccall "cppFunction" cppFunction :: IO ()
main = do
cppFunction One should be able to compile the program using the command shown below. This currently fails as explained above. $ ghc Main.hs example.cpp -o main -lstdc++
ghc-9.10.1: could not execute: g++-11 |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Tried to install
ghc
on Ubuntu 24.04 LTS and compile simple Haskell program.What happened (include all command output)?
The Haskell compiler was not able to compile the program.
Main.hs
file:Compile the program:
What did you expect to happen?
The GHC compiler compiles the file.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: