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

Multiple libraries failing with unknownsymbol 'expm1' on mingw32 #2335

Closed
Anviking opened this issue Mar 20, 2025 · 5 comments
Closed

Multiple libraries failing with unknownsymbol 'expm1' on mingw32 #2335

Anviking opened this issue Mar 20, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@Anviking
Copy link
Member

Anviking commented Mar 20, 2025

Describe the bug

After bumping dependencies in cardano-wallet we have some haskell libraries failing with unknownsymbol 'expm1' on mingw32.

  • Build system: mingw32 x86_64-linux to windows cross compilation
  • GHC version: 9.6.6
  • Haskell.nix version: 42f73d0

Steps To Reproduce

git clone https://github.com/cardano-foundation/cardano-wallet.git
cd cardano-wallet
git checkout paolino/4993/bump-node-to-10.2.1 
# PR https://github.com/cardano-foundation/cardano-wallet/pull/5031
# current commit: 3060adbe1ee818300b7d1fd0990e39967c1ad9b2
nix build -L -o result/windows .#ci.artifacts.win64.release

Expected behavior

Haskell libraries succeed to build or at least don't fail with error below.

Actual behaviour

error: builder for '/nix/store/i1j4q4dw6vfr1mm5khiyd5fwygy2in0f-parsers-lib-parsers-x86_64-w64-mingw32-0.12.12.drv' failed with exit code 1;
       last 25 log lines:
       > [2 of 8] Compiling Text.Parser.Char ( src/Text/Parser/Char.hs, dist/build/Text/Parser/Char.o )
       > ---> Starting iserv-proxy-interpreter.exe on port 9684
       > To re-use the same wine-prefix and remote-iserv, set the following environment variables:
       > export WINEPREFIX=/build/tmp.wRIjUR3UAs
       > export REMOTE_ISERV=/build/tmp.bh5w61bEsD
       > ---| iserv-proxy-interpreter.exe should have started on 9684
       > 0054:err:systray:initialize_systray Could not create tray window
       > 0090:err:setupapi:SetupDefaultQueueCallbackW copy error 1812 L"@C:\\windows\\system32\\drivers\\wineusb.sys,-1" -> L"C:\\windows\\inf\\wineusb.inf"
       > wine: failed to open L"C:\\windows\\syswow64\\rundll32.exe": c0000135
       > wine: configuration in L"/build" has been updated.
       > Listening on port 9684
       > iserv-proxy-interpreter.exe:|/nix/store/syx93hzdp3w3yvfwblbxajy8q2rsjci8-x86_
       > 64-w64-mingw32-ghc-9.6.6/lib/x86_64-windows-ghc-9.6.6/ghc-prim-0.10.0/HSghc-prim
       > -0.10.0.o:unknownsymbol`expm1'
       > iserv-proxy-interpreter.exe:CouldnotloadObjectCode/nix/store/syx93hzdp3w3y
       > vfwblbxajy8q2rsjci8-x86_64-w64-mingw32-ghc-9.6.6/lib/x86_64-windows-ghc-9.6.6/gh
       > c-prim-0.10.0/HSghc-prim-0.10.0.o.
       >
       >
       > <no location info>: error: unable to load unit `ghc-prim-0.10.0'
       > [3 of 8] Compiling Text.Parser.Expression ( src/Text/Parser/Expression.hs, dist/build/Text/Parser/Expression.o )
       > [4 of 8] Compiling Text.Parser.LookAhead ( src/Text/Parser/LookAhead.hs, dist/build/Text/Parser/LookAhead.o )
       > [5 of 8] Compiling Text.Parser.Permutation ( src/Text/Parser/Permutation.hs, dist/build/Text/Parser/Permutation.o )
       > [6 of 8] Compiling Text.Parser.Token.Highlight ( src/Text/Parser/Token/Highlight.hs, dist/build/Text/Parser/Token/Highlight.o )
       > ---> killing iserv-proxy-interpreter.exe...
       For full logs, run 'nix-store -l /nix/store/i1j4q4dw6vfr1mm5khiyd5fwygy2in0f-parsers-lib-parsers-x86_64-w64-mingw32-0.12.12.drv'.
error: 1 dependencies of derivation '/nix/store/ylhanzyhl5lc1l1p321rfc0sns6sqji0-tree-diff-lib-tree-diff-x86_64-w64-mingw32-0.3.3.drv' failed to build
error: 1 dependencies of derivation '/nix/store/81m6v600aymbk6i501y77sr6ky50qkd5-cardano-ledger-core-lib-testlib-x86_64-w64-mingw32-1.16.0.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j3ifzc858sxmwsb17r43cy0d33r63g0i-cardano-api-lib-internal-x86_64-w64-mingw32-10.8.0.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/69y2vs0w085ys6gk5bxacmwn3hx640hz-cardano-api-lib-cardano-api-x86_64-w64-mingw32-10.8.0.0.drv' failed to build
error (ignored): error: cannot unlink '"/tmp/nix-build-quickcheck-arbitrary-adt-lib-quickcheck-arbitrary-adt-x86_64-w64-mingw32-0.3.1.0.drv-0/build/tmp.2BQQIbLwm2/lib/x86_64-windows-ghc-9.6.6/ghc-9.6.6/GHC"': Directory not empty
error: 1 dependencies of derivation '/nix/store/ysf7zn2mn8xa2pcw8xpz9rql26cldy6z-cardano-wallet-api-lib-cardano-wallet-api-x86_64-w64-mingw32-0.2025.3.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ky4vmlih50137y78lj1lryiqqsp1q2a3-cardano-wallet-lib-cardano-wallet-x86_64-w64-mingw32-0.2025.3.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1w97l6kcx3sqs6vq42jryvpy2dkn2n7x-cardano-wallet-primitive-lib-cardano-wallet-primitive-x86_64-w64-mingw32-0.2025.3.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/z34d4ijzl61l4a6hskh4k2p1n7mshsv3-cardano-wallet-application-exe-cardano-wallet-x86_64-w64-mingw32-2025.3.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j3ym7aldbz6j0g8v17nsp4yl41rxa50d-cardano-wallet.exe-2025.3.4.drv' failed to build
error (ignored): error: cannot unlink '"/tmp/nix-build-uuid-types-lib-uuid-types-x86_64-w64-mingw32-1.0.6.drv-0/build/tmp.psVXCe0AMM"': Directory not empty
error (ignored): error: cannot unlink '"/tmp/nix-build-strict-lib-strict-x86_64-w64-mingw32-0.5.1.drv-0/build/tmp.3a0hCagr10/lib/x86_64-windows-ghc-9.6.6"': Directory not empty
error: 1 dependencies of derivation '/nix/store/fihsqlfjjjpd41y0jxakjrn7acrgnm5d-cardano-wallet.exe-v2025-03-04-win64.drv' failed to build

Additional context

Bumping selective-0.5 to 0.7.0.1 appears to make it compile, and fail on parsers-0.12.12 instead.

parsers-0.12.12 is the latest one though so can't bump any further.

@Anviking Anviking added the bug Something isn't working label Mar 20, 2025
@Anviking Anviking changed the title Multiple libraries failing with unknownsymbolexpm1'` on mingw32 Multiple libraries failing with unknownsymbol 'expm1' on mingw32 Mar 20, 2025
@Anviking
Copy link
Member Author

@hamishmack @angerman any ideas here? 🙏 I think it looks different from #2314

@angerman
Copy link
Collaborator

Yes, this should be easier than the dreaded #2314. This is basically just iserv missing some symbol.

@hamishmack
Copy link
Collaborator

Please try using ucrt64 instead of mingwW64:

diff --git a/flake.nix b/flake.nix
index 4785fcd4df..1d81f87315 100644
--- a/flake.nix
+++ b/flake.nix
@@ -340,7 +340,7 @@
                 let
                   # windows is cross-compiled from linux
                   windowsPackages =
-                    mkPackages project.projectCross.mingwW64 // {
+                    mkPackages project.projectCross.ucrt64 // {
                       cardano-cli =
                         cardano-node-runtime.hydraJobs.x86_64-linux.windows.cardano-cli;
                       cardano-node =

@Anviking
Copy link
Member Author

Anviking commented Mar 24, 2025

Thanks, it fixed the windows build but somehow the linux build broke in a weird way https://buildkite.com/cardano-foundation/cardano-wallet/builds/9823#0195b949-695d-4e3f-a9ec-756b9e8f49b5

cardano-wallet.exe-v2025> cp: missing destination file operand after 'cardano-wallet.exe-v2025-03-04-linux64/auto-completion/bash/cardano-wallet.exe.sh'

It seems suspecicious that the linux build mentions .exe and that the linux build even got affected given the patch looked like it only affected windows.

Does this ring any bells for you?

Edit: wait nvm hold up a minute, I was pretty sure I changed only the windows build but looks I didn't 🧐 🧐

@Anviking
Copy link
Member Author

Yes works perfectly. Thanks a lot, @hamishmack !

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

3 participants