Skip to content

Commit

Permalink
[ci] Revert windows to ghc 9.0
Browse files Browse the repository at this point in the history
Build segfaults on 9.4.5
  • Loading branch information
lierdakil committed Jun 25, 2023
1 parent 6a1262f commit 8cfdbb2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 45 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
pandocver: ["3.1.4"]
ghcver: ['9.4.5']
include:
- os: windows-latest
pandocver: "3.1.4"
ghcver: '9.0.2'
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{matrix.ghcver}}
cabal: '3.8'
- name: Cabal init
shell: pwsh
run: |
Expand Down
80 changes: 37 additions & 43 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
in
flake-utils.lib.eachSystem supportedSystems (system:
let
linker-workaround = pkgs_.writeShellScript "linker-workaround" ''
linker-workaround = pkgs: pkgs.writeShellScript "linker-workaround" ''
# put all flags into 'params' array
source ${pkgsStatic.stdenv.cc}/nix-support/utils.bash
source ${pkgs.stdenv.cc}/nix-support/utils.bash
expandResponseParams "$@"
# check if '-shared' flag is present
Expand All @@ -44,56 +44,50 @@
# invoke the actual linker with the new params
exec x86_64-unknown-linux-musl-cc @<(printf "%q\n" "''${newParams[@]}")
'';
hixProject = args@{ static ? false, ... }:
(pkgs args).haskell-nix.cabalProject {
compiler-nix-name = "ghc945";
src = nix-filter.lib {
root = ./.;
include = [
./docs
./lib
./lib-internal
./src
./test
./pandoc-crossref.cabal
./cabal.project.freeze
./cabal.project
./Setup.hs
./.gitignore
./LICENSE
./README.md
./CHANGELOG.md
];
};
evalSystem = "x86_64-linux";
modules = [{
packages.pandoc-crossref.ghcOptions =
if static then ["-pgml=${linker-workaround}"] else [];
}];
hixProject = pkgs.haskell-nix.cabalProject {
compiler-nix-name = "ghc945";
src = nix-filter.lib {
root = ./.;
include = [
./docs
./lib
./lib-internal
./src
./test
./pandoc-crossref.cabal
./cabal.project.freeze
./cabal.project
./Setup.hs
./.gitignore
./LICENSE
./README.md
./CHANGELOG.md
];
};
overlays = [ haskellNix.overlay (final: prev: {}) ];
pkgsStatic = pkgs_.pkgsCross.musl64;
pkgs_ = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
pkgs = {static ? false }: if static then pkgsStatic else pkgs_;
flake = (hixProject {}).flake {};
flakeStatic = (hixProject { static = true; }).flake {};
in {
legacyPackages = pkgs {};
evalSystem = "x86_64-linux";
modules = [({pkgs, ...}: with pkgs; {
packages.pandoc-crossref.ghcOptions =
lib.optional stdenv.hostPlatform.isMusl "-pgml=${linker-workaround pkgs}";
})];
};
overlays = [ haskellNix.overlay ];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = hixProject.flake {
crossPlatforms = ps: with ps; [ musl64 ];
};
in pkgs.lib.recursiveUpdate { inherit (flake) packages apps checks; } {
packages = {
default = flake.packages."pandoc-crossref:exe:pandoc-crossref";
static = flakeStatic.packages."pandoc-crossref:exe:pandoc-crossref";
pandoc = (hixProject {}).pandoc-cli.components.exes.pandoc;
static = flake.packages."x86_64-unknown-linux-musl:pandoc-crossref:exe:pandoc-crossref";
pandoc = hixProject.pandoc-cli.components.exes.pandoc;
};
apps = {
default = flake.apps."pandoc-crossref:exe:pandoc-crossref";
test = flake.apps."pandoc-crossref:test:test-pandoc-crossref";
test-integrative = flake.apps."pandoc-crossref:test:test-integrative";
};
devShells.default = pkgs_.mkShell {
buildInputs = [
self.packages.${system}.default
self.packages.${system}.pandoc
];
devShells.default = pkgs.mkShell {
buildInputs = with self.packages.${system}; [ default pandoc ];
};
});

Expand Down

0 comments on commit 8cfdbb2

Please sign in to comment.