Skip to content

Cross-compiling fully-static haskell binary fails #1115

Open
@573

Description

@573

My goal is to have a fully static binary of hledger on aarch64. The machine I'm building on is x86_64.

I do have set up binary caches.

Based on #1092 and the commit before the breakage (8f5819c) I searched for the version of hledger in nixpkgs-2003 and found 1.16.2.

Now I wrote this nix expression to build via nix-build:

{ haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/8f5819c0b8ca64b8d5d9ceed5acb69952e4be9a2.tar.gz") { system = "aarch64-linux"; }
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, nixpkgs ? import nixpkgsSrc nixpkgsArgs
}:
nixpkgs.haskell-nix.tool "ghc884" "hledger" "1.16.2"

I am stuck right now with (full log) an error message saying:

"inplace/bin/ghc-stage1" -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -eventlog -H32m -O -Wall -this-unit-id Cabal-3.0.1.0 -hide-all-packages -i -ilibraries/Cabal/Cabal/. -ilibraries/Cabal/Cabal/dist-install/build -Ilibraries/Cabal/Cabal/dist-install/build -ilibraries/Cabal/Cabal/dist-install/build/./autogen -Ilibraries/Cabal/Cabal/dist-install/build/./autogen -Ilibraries/Cabal/Cabal/. -optP-include -optPlibraries/Cabal/Cabal/dist-install/build/./autogen/cabal_macros.h -package-id array-0.5.4.0 -package-id base-4.13.0.0 -package-id binary-0.8.7.0 -package-id bytestring-0.10.10.1 -package-id containers-0.6.2.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.6.0 -package-id filepath-1.4.2.1 -package-id mtl-2.2.2 -package-id parsec-3.1.14.0 -package-id pretty-1.1.3.6 -package-id process-1.6.9.0 -package-id text-1.2.4.0 -package-id time-1.9.3 -package-id transformers-0.5.6.2 -package-id unix-2.7.2.2 -Wall -fno-ignore-asserts -fwarn-tabs -Wcompat -Wnoncanonical-monad-instances -XHaskell2010 -O2 -haddock -no-user-package-db -rtsopts -Wno-deprecated-flags -Wnoncanonical-monad-instances -outputdir libraries/Cabal/Cabal/dist-install/build -split-sections -c libraries/Cabal/Cabal/./Distribution/Simple/CCompiler.hs -o libraries/Cabal/Cabal/dist-install/build/Distribution/Simple/CCompiler.p_o -dyno libraries/Cabal/Cabal/dist-install/build/Distribution/Simple/CCompiler.dyn_o
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x5dd4ea
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x40197a
make[1]: *** [libraries/Cabal/Cabal/ghc.mk:4: libraries/Cabal/Cabal/dist-install/build/Distribution/PackageDescription/Quirks.p_o] Error 127
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:128: all] Error 2

which I cannot really comprehend.

Is there a way to achieve my aforementioned goal with haskell.nix ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    preservedKeep stale bot away

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions