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
Weird GCC arguments being generated on Windows for includeDirs (cabal 2.4.1.0). #6080
Comments
ghc on Windows expects things like mysql to come from mingw32, not Windows native. If you get past this, you'll have link errors because your mysql wants a native CRT, not the mingw32 one that it will be supplied. And this problem is because in mingw-think, a path beginning with "C:\" is a relative pathname (it uses Unix-style paths, not Windows native). |
@geekosaur well, all other paths which were not provided by me use windows style path. Also, if I remove that one flag and manually run the reported command then gcc can build this with no problem. What I'm trying to say is that this looks like problem with generating the flags, and also I don't see mysql or mariadb dev package in msys. Mysql_config script does return unix style path (which I've converted to win style) but problem is still the same, it appeares separately and than it is once more tacked onto this other path for some reason. |
This is not entirely correct, GHC expects a native Windows library yes, but both
I suspect you mean @reygoch you say you get the same issue when you just hardcode the path no? What happens when you have I'm rather suspicious about the |
@Mistuke I'm @reygoch, accidentally switched accounts here. If I set
Why do something else with it? This seems like a bug to me the more I look at it. This works fine if we assume we are only working with relative paths within the project, like it is the case with It seems like cabal is copying those include folders into
Here is also my output when I set
|
Ahh right, so it seems cabal is expecting a relative path not an absolute one.. That does indeed seem like a bug. Does the same happen if you have an absolute path set in a cabal file? |
So, I'm trying to get
mysql
package to build on windows and I'm nearly done, but I'm getting some weird behavior from Cabal.It generates some unexpected GCC parameters:
Basically, in the
includeDirs
field for myBuildInfo
I've added this (hardcoded for testing purposes):["\"C:\\Program Files\\MySQL\\MySQL Server 8.0\\include\""]
In the generated
gcc
command I get the following expected flag:But I also get this flag which has
C:\Program Files\MySQL\MySQL Server 8.0\include
tacked on to the end for some reason:If I remove this flag and manually execute
gcc
command the program is built, but I can't figure out why this flag is generated and how to remove it.Here is the full code of my current
Setup.hs
, mysql paths are set inmysqlBuildInfo
function:The text was updated successfully, but these errors were encountered: