Skip to content

Commit

Permalink
[Chore] Fix issues with windows cross-compilation via nix
Browse files Browse the repository at this point in the history
Problem: Cross-compilation to windows is broken.

Solution:
1) Build 'bitvec' without 'simd' flag since it causes the build to fail.
2) Remove old workaround for 'iserv-proxy-interprete' because the
   aforementioned issue was fixed in newer GHC versions.
  • Loading branch information
rvem committed Apr 1, 2024
1 parent 83ea8a3 commit 75459d0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@
pkgs = haskell-nix.legacyPackages.${system}.extend
(haskell-nix.legacyPackages.${system}.lib.composeManyExtensions [
serokell-nix.overlay
# silly workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/21254
(final: prev: prev.lib.recursiveUpdate prev {
haskell-nix.iserv-proxy-exes.ghc902.iserv-proxy-interpreter.override =
attrs: prev.haskell-nix.iserv-proxy-exes.ghc902.iserv-proxy-interpreter.override
(attrs // { enableDebugRTS = false; });
})
]);

flake = (pkgs.haskell-nix.stackProject {
src = builtins.path {
name = "xrefcheck";
path = ./.;
};
modules = [{
modules = [({ pkgs, ... }: {
packages.xrefcheck = {
ghcOptions =
[ "-Werror" ];
Expand Down Expand Up @@ -57,7 +51,10 @@
xrefcheck-tests.build-tools = [ pkgs.git ];
};
};
}];
# bitvec compilation on mingw64 with 'simd' flag fails with
# unknown symbol `__cpu_model'
packages.bitvec.flags.simd = !pkgs.stdenv.targetPlatform.isWindows;
})];
}).flake { crossPlatforms = p: [ p.musl64 p.mingwW64 ]; };

in
Expand Down

0 comments on commit 75459d0

Please sign in to comment.