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

Possible regression of cross-compiling TH with mingwW64 #2314

Open
thomasjm opened this issue Feb 4, 2025 · 2 comments
Open

Possible regression of cross-compiling TH with mingwW64 #2314

thomasjm opened this issue Feb 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@thomasjm
Copy link
Contributor

thomasjm commented Feb 4, 2025

Describe the bug

I've been trying to cross-compile a project from Linux to Windows, and noticed that several dependencies which depend on TH fail to compile in the same manner described in #1913.

There are a few examples, such as exceptions in TH code that reads from a file with file-embed, as in #1913. But for this issue I'll focus on just building aeson-typescript, where the TH doesn't even do external IO.

This is on x86_64-linux. I've tried with GHC 9.6.6 and GHC 9.8.4, which the current repro uses, and the latest Haskell.nix.

I think #2034 was meant to address these issues, but I think there might have been some regression. I'd note that the comment in overlays/wine.nix became out of date with #2034, which stopped pinning Wine. That comment mentioned Wine 5.4, but Wine on nixpkgs-unstable is up to version 10.0 now.

Steps To Reproduce

git clone [email protected]:codedownio/aeson-typescript.git
cd aeson-typescript
nix build .#windows

The build fails with a message like this (which sort of suggests a locale issue?):

       > wine: failed to open L"C:\\windows\\syswow64\\rundll32.exe": c0000135
       > wine: configuration in L"/build" has been updated.
       > Listening on port 6249
       > iserv-proxy: getBin: Unknown encoding for constructor
       > iserv-proxy-interpreter.exe:<socket:180>:hPutBuf:invalidargument(Invalid a
       > rgument)
       >
       > src/Data/Aeson/TypeScript/Instances.hs:190:25: error: [GHC-87897]
       >     • Exception when trying to run compile-time code:
       >         {handle: <file descriptor: 25>}: GHCi.Message.remoteCall: end of file
       >       Code: Language.Haskell.TH.Quote.quoteExp
       >               i "{[k: string]: #{getTypeScriptType (Proxy :: Proxy a)}}"
       >     • In the quasi-quotation:
       >         [i|{[k: string]: #{getTypeScriptType (Proxy :: Proxy a)}}|]
       >     |
       > 190 |   getTypeScriptType _ = [i|{[k: string]: #{getTypeScriptType (Proxy :: Proxy a)}}|]
       >     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       > [ 8 of 12] Compiling Data.Aeson.TypeScript.Formatting ( src/Data/Aeson/TypeScript/Formatting.hs, dist/build/Data/Aeson/TypeScript/Formatting.o )

Expected behavior

The pkgsCross.mingwW64 version of the aeson-typescript library should build successfully.

CC @amesgen and @angerman, I'd be very grateful for any help in figuring this out!

@thomasjm thomasjm added the bug Something isn't working label Feb 4, 2025
@angerman
Copy link
Collaborator

angerman commented Feb 6, 2025

@thomasjm I hope to have some time to investigate this next week 😅

@thomasjm
Copy link
Contributor Author

thomasjm commented Feb 6, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants